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

#   How to add fields like firstdata 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 [\#330389](#330389) by [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")  *[How to add fields like firstdata payment plugin](/forum/31-development/902097-how-to-add-fields-like-firstdata-payment-plugin#330389 "Hi.  I had some attempts to make some fields type file in the backend config form (I added those fields in plugin.xml file), but it was impossible to access files inside my plugin (in the onAfterOrderConfirm method). On those fields the admin of the page would have to add it's certificates for the payment (ca, cert, key; which fields are visible only in admin page).  I saw firstdata plugin, in which there were some similar fields in the ''Specific Configuration'' section, and their values was stored in $this-&gt;payment&#95;params (this-&gt;payment&#95;params-&gt;pem&#95;file, this-&gt;payment&#95;params-&gt;key&#95;file in their case).  My question is: how can I make something like that, how is this possible, or can I add those fields or form programatically as I mentioned above?  There is documentation of Firstdata plugin:   www.hikashop.com/support/documentation/9...-firstdata-form.html  Lirim.")* was created by *[lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")*

Hi.

I had some attempts to make some fields type file in the backend config form (I added those fields in plugin.xml file), but it was impossible to access files inside my plugin (in the onAfterOrderConfirm method).
On those fields the admin of the page would have to add it's certificates for the payment (ca, cert, key; which fields are visible only in admin page).

I saw firstdata plugin, in which there were some similar fields in the ''Specific Configuration'' section, and their values was stored in $this-&gt;payment_params (this-&gt;payment_params-&gt;pem_file, this-&gt;payment_params-&gt;key_file in their case).

My question is: how can I make something like that, how is this possible, or can I add those fields or form programatically as I mentioned above?

There is documentation of Firstdata plugin:
[ www.hikashop.com/support/documentation/9...-firstdata-form.html](https://www.hikashop.com/support/documentation/99-hikashop-payment-firstdata-form.html)

Lirim.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwMjA5Ny1ob3ctdG8tYWRkLWZpZWxkcy1saWtlLWZpcnN0ZGF0YS1wYXltZW50LXBsdWdpbj90bXBsPW1hcmtkb3du) 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 [\#330394](#330394) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to add fields like firstdata payment plugin](/forum/31-development/902097-how-to-add-fields-like-firstdata-payment-plugin#330394 "Hi.  I had some attempts to make some fields type file in the backend config form (I added those fields in plugin.xml file), but it was impossible to access files inside my plugin (in the onAfterOrderConfirm method). On those fields the admin of the page would have to add it's certificates for the payment (ca, cert, key; which fields are visible only in admin page).  I saw firstdata plugin, in which there were some similar fields in the ''Specific Configuration'' section, and their values was stored in $this-&gt;payment&#95;params (this-&gt;payment&#95;params-&gt;pem&#95;file, this-&gt;payment&#95;params-&gt;key&#95;file in their case).  My question is: how can I make something like that, how is this possible, or can I add those fields or form programatically as I mentioned above?  There is documentation of Firstdata plugin:   www.hikashop.com/support/documentation/9...-firstdata-form.html  Lirim.")*

Hi,

Yes, you can add such fields there too.
Check the file plugins/hikashoppayment/firstdata/firstdata.php
There, you can see near the top such code: Code:

var $pluginConfig = array( 'login' =&gt; array('Store ID', 'input'), 'password' =&gt; array('API Password', 'input'), 'domain' =&gt; array('Payment Server', 'list',array( 'ws.firstdataglobalgateway.com' =&gt; 'Production Server', 'ws.merchanttest.firstdataglobalgateway.com' =&gt; 'Test Server' )), 'pem_file' =&gt; array('PEM file', 'input'), 'key_file' =&gt; array('KEY file', 'input'), 'key_passwd' =&gt; array('KEY password', 'input'), 'ask_ccv' =&gt; array('Ask CCV', 'boolean','1'), 'debug' =&gt; array('DEBUG', 'boolean','0'), 'return_url' =&gt; array('RETURN_URL', 'input'), 'verified_status' =&gt; array('VERIFIED_STATUS', 'orderstatus') );

This defines the list of options the shop owner will see when creating/editing the payment method. And you can see the "key_file" and "key_passwd" lines.
Please note that these will generate a text input field where the shop owner will have to enter the path of the file which he will have previously uploaded.

Now, if you want to have upload fields there, instead of text input fields, it's possible too but much more complex. You need to not have that pluginConfig variable in your class, and instead you need to add a configuration PHP file to specify the HTML of your specific options. Then, you also need a onPaymentConfigurationSave function in your plugin to store the files and process the settings. A good example of that is the ATOS plugin: [ www.hikashop.com/support/documentation/8...yment-atos-form.html](https://www.hikashop.com/support/documentation/85-hikashop-payment-atos-form.html)
You can check its file plugins/hikashoppayment/atos/atos_configuration.php and the function onPaymentConfigurationSave in the file plugins/hikashoppayment/atos/atos.php for an example of what to do.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwMjA5Ny1ob3ctdG8tYWRkLWZpZWxkcy1saWtlLWZpcnN0ZGF0YS1wYXltZW50LXBsdWdpbj90bXBsPW1hcmtkb3du) 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.040 seconds

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