[Skip to main content](#vessel-content)

#   Acess the backend fields value in payment plugin

##

- **[lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")**
- [![lirimimeri's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/60924-lirimimeri "View lirimimeri's Profile") Topic Author
- [ Offline](/forum/user/60924-lirimimeri)

Less More

- Posts: 12
- Thank you received: 0
-
-

5 years 8 months ago [\#329890](#329890) by [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")  *[Acess the backend fields value in payment plugin](/forum/30-integrations/901999-acess-the-backend-fields-value-in-payment-plugin#329890 "Hi, hope you are well. I am new in Joomla, recently I am developing a hikashop payment plugin, I have issues accessing the fields from the backend. Can't access in Joomla documentation way with: inside the onAfterOrderConfirm function.  Here is my example code.")* was created by *[lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")*

Hi, hope you are well.
I am new in Joomla, recently I am developing a hikashop payment plugin, I have issues accessing the fields from the backend.
Can't access in Joomla documentation way with: Code:

$input = JFactory::getApplication()-&gt;input; $input-&gt;get('fieldName', '', 'string');

inside the onAfterOrderConfirm function.

Here is my example code.
Code:

&lt;config&gt; &lt;fields&gt; &lt;fieldset name="basic" enctype="multipart/form-data"&gt; &lt;field name="merchantId" required="true" label="Merchant ID" /&gt; &lt;field name="status" label="Status" type="list"&gt; &lt;option value="1"&gt;Enabled&lt;/option&gt; &lt;option value="0"&gt;Disabled&lt;/option&gt; &lt;/field&gt; &lt;field name="language" label="Language" type="list"&gt; &lt;option value="EN"&gt;English&lt;/option&gt; &lt;option value="AL"&gt;Albanian&lt;/option&gt; &lt;option value="SR"&gt;Serbian&lt;/option&gt; &lt;/field&gt; &lt;field name="mode" label="Mode" type="list"&gt; &lt;option value="live"&gt;Live&lt;/option&gt; &lt;option value="test"&gt;Test&lt;/option&gt; &lt;/field&gt; &lt;/fieldset&gt; &lt;/fields&gt; &lt;/config&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDE5OTktYWNlc3MtdGhlLWJhY2tlbmQtZmllbGRzLXZhbHVlLWluLXBheW1lbnQtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

5 years 8 months ago [\#329893](#329893) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Acess the backend fields value in payment plugin](/forum/30-integrations/901999-acess-the-backend-fields-value-in-payment-plugin#329893 "Hi, hope you are well. I am new in Joomla, recently I am developing a hikashop payment plugin, I have issues accessing the fields from the backend. Can't access in Joomla documentation way with: inside the onAfterOrderConfirm function.  Here is my example code.")*

Hi,

In case you didn't, I would recommend to download the example payment plugin we provide here:
[ www.hikashop.com/support/documentation/6...on.html#howtopayment](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#howtopayment)
And read its code and base yourself off of it.
You'll see that the way we recommend you to go about it is to have your plugin class extend the hikashopPaymentPlugin class and use the $pluginConfig attribute to add settings to the plugin. You'll see that in the onAfterOrderConfirm function there, the settings values are available with $this-&gt;payment_params-&gt;fieldName
Doing it like that instead of using Joomla's plugin setting system allows the merchant to have several instances of settings for the same payment plugin (so when you go in the menu System&gt;Payment methods in HikaShop and click on the "new" button, you can select your plugin to generate one instance of settings for your plugin, and you can repear the process if necessary to get several payment methods for the same payment plugin). That's useful for example if you want to have a payment price added to the cart and that the value needs to change based on the total amount, or based on the user group of the user, or based on the shipping method selected etc).

Now if you really want to have normal Joomla plugin options, it's possible... To read them in your plugin's code, you can use such code: Code:

$plugin = JPluginHelper::getPlugin('hikashoppayment', 'xxx'); $this-&gt;params = new JRegistry(@$plugin-&gt;params); echo $this-&gt;params-&gt;get('yyy');

where xxx is the folder name of your plugin and yyy the name of the setting.

The following user(s) said Thank You: [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDE5OTktYWNlc3MtdGhlLWJhY2tlbmQtZmllbGRzLXZhbHVlLWluLXBheW1lbnQtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")**
- [![lirimimeri's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/60924-lirimimeri "View lirimimeri's Profile") Topic Author
- [ Offline](/forum/user/60924-lirimimeri)

Less More

- Posts: 12
- Thank you received: 0
-
-

5 years 8 months ago -  5 years 8 months ago [\#329930](#329930) by [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")  Replied by *[lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")* on topic *[Acess the backend fields value in payment plugin](/forum/30-integrations/901999-acess-the-backend-fields-value-in-payment-plugin#329930 "Hi, hope you are well. I am new in Joomla, recently I am developing a hikashop payment plugin, I have issues accessing the fields from the backend. Can't access in Joomla documentation way with: inside the onAfterOrderConfirm function.  Here is my example code.")*

Hi Nicolas, it really helped me.

At the moment, I'm stuck reading the file (from custom field type file) I added manually in the the .xml file of my plugin, visible only in admin page, specifically to read the contents of that file (.pem file). I do not know if I should address here or in the Joomla forum, however, thank you very much for the answer.

Last edit: 5 years 8 months ago by [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile"). Reason: To be more clearer.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDE5OTktYWNlc3MtdGhlLWJhY2tlbmQtZmllbGRzLXZhbHVlLWluLXBheW1lbnQtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

5 years 8 months ago [\#329937](#329937) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Acess the backend fields value in payment plugin](/forum/30-integrations/901999-acess-the-backend-fields-value-in-payment-plugin#329937 "Hi, hope you are well. I am new in Joomla, recently I am developing a hikashop payment plugin, I have issues accessing the fields from the backend. Can't access in Joomla documentation way with: inside the onAfterOrderConfirm function.  Here is my example code.")*

Hi,

I'm not sure what you mean. We might be able to help but we will need more information on what you're trying to do to be able to help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDE5OTktYWNlc3MtdGhlLWJhY2tlbmQtZmllbGRzLXZhbHVlLWluLXBheW1lbnQtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")**
- [![lirimimeri's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/60924-lirimimeri "View lirimimeri's Profile") Topic Author
- [ Offline](/forum/user/60924-lirimimeri)

Less More

- Posts: 12
- Thank you received: 0
-
-

5 years 8 months ago -  5 years 8 months ago [\#329987](#329987) by [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")  Replied by *[lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")* on topic *[Acess the backend fields value in payment plugin](/forum/30-integrations/901999-acess-the-backend-fields-value-in-payment-plugin#329987 "Hi, hope you are well. I am new in Joomla, recently I am developing a hikashop payment plugin, I have issues accessing the fields from the backend. Can't access in Joomla documentation way with: inside the onAfterOrderConfirm function.  Here is my example code.")*

Hi.

I'm trying to make a payment plugin, this plugin has some custom fields I added manually in example.xml file.

Here is code how I added.
[ ![1&#95;2021-02-24.png](/forum/attachment/52043) ](/forum/attachment/52043 "1&#95;2021-02-24.png")

How it displays:
[ ![5.png](/forum/attachment/52042) ](/forum/attachment/52042 "5.png")

So far, everything is fine.

My problem is with last 3 fields, I can't accessing them correctly.
Access to the fields above them works perfectly, but with files it doesn't.

I am trying the code You provided like this: Code:

$plugin = JPluginHelper::getPlugin('hikashoppayment', 'example'); $this-&gt;params = new JRegistry(@$plugin-&gt;params); echo $this-&gt;params-&gt;get('caTest');

This shows me only the name of the file I entered.
The question is how can i get the entire file added there? I need the file and its content inside to make request.

Hope I was clear.
Regards.

- [ ![5.png](/forum/attachment/52042) ](/forum/attachment/52042 "5.png") [ ](/forum/attachment/52042?download=1 "5.png")
- [ ![1&#95;2021-02-24.png](/forum/attachment/52043) ](/forum/attachment/52043 "1&#95;2021-02-24.png") [ ](/forum/attachment/52043?download=1 "1&#95;2021-02-24.png")

Last edit: 5 years 8 months ago by [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDE5OTktYWNlc3MtdGhlLWJhY2tlbmQtZmllbGRzLXZhbHVlLWluLXBheW1lbnQtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

5 years 8 months ago [\#329996](#329996) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Acess the backend fields value in payment plugin](/forum/30-integrations/901999-acess-the-backend-fields-value-in-payment-plugin#329996 "Hi, hope you are well. I am new in Joomla, recently I am developing a hikashop payment plugin, I have issues accessing the fields from the backend. Can't access in Joomla documentation way with: inside the onAfterOrderConfirm function.  Here is my example code.")*

Hi,

It's normal you only get the file name with this.
You need to prepend the path of the folder where the file is uploaded.
Now I don't know where Joomla put the files uploaded with that type.
And it's not mentioned here:
[ docs.joomla.org/File\_form\_field\_type](https://docs.joomla.org/File_form_field_type)
I would recommend to ask this on forum.joomla.org

Also, I would recommend to have these files in a folder not accessible by a URL. Otherwise, anyone would be able to download these files and they might be able to impersonate the merchant on their own website, or validate orders without any payment made.

The following user(s) said Thank You: [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy85MDE5OTktYWNlc3MtdGhlLWJhY2tlbmQtZmllbGRzLXZhbHVlLWluLXBheW1lbnQtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.062 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
