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

#   How to make a payment plugin?

##

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

Less More

- Posts: 25
- Thank you received: 1
-
-

12 years 9 months ago [\#138756](#138756) by [andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile")  *[How to make a payment plugin?](/forum/31-development/864803-how-to-make-a-payment-plugin#138756 "Hi,  I have read the doc (  www.hikashop.com/support/support/documen...ntation.html#payment ) and I have some questions:  This sample scrypt ...  What directory I put? I want it visible and configurable on the hikashop/configuration/payment&#95;mode  Thanks.")* was created by *[andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile")*

Hi,

I have read the doc ([ www.hikashop.com/support/support/documen...ntation.html#payment](http://www.hikashop.com/support/support/documentation/62-hikashop-developer-documentation.html#payment)) and I have some questions:

This sample scrypt ...
Code:

class plgHikashopName extends JPlugin { function plgHikashopName(&amp;$subject, $config){ parent::__construct($subject, $config); } // Call a trigger, in this example: onBeforeOrderCreate function onBeforeOrderCreate(&amp;$order,&amp;$send_email) { // Actions to do when my trigger is called } // Another trigger function onAfterOrderCreate(&amp;$order) { // Actions to do when my trigger is called } }

What directory I put? I want it visible and configurable on the hikashop/configuration/payment_mode

Thanks.

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

12 years 9 months ago [\#138758](#138758) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[How to make a payment plugin?](/forum/31-development/864803-how-to-make-a-payment-plugin#138758 "Hi,  I have read the doc (  www.hikashop.com/support/support/documen...ntation.html#payment ) and I have some questions:  This sample scrypt ...  What directory I put? I want it visible and configurable on the hikashop/configuration/payment&#95;mode  Thanks.")*

Hi,

If you want to create a payment plugin, the best is to use the "hikashopPaymentPlugin" interface.
Depending the kind of payment plugin you want to implement, having a look to an existing HikaShop plugin could be interesting.
The smallest one might be "collect on delivery".

The interface will provide you a lot of services, some repetitive tasks are already manage by the interface so you just have to write the minimum of code, only the specific code.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

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

Less More

- Posts: 25
- Thank you received: 1
-
-

12 years 9 months ago [\#138852](#138852) by [andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile")  Replied by *[andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile")* on topic *[How to make a payment plugin?](/forum/31-development/864803-how-to-make-a-payment-plugin#138852 "Hi,  I have read the doc (  www.hikashop.com/support/support/documen...ntation.html#payment ) and I have some questions:  This sample scrypt ...  What directory I put? I want it visible and configurable on the hikashop/configuration/payment&#95;mode  Thanks.")*

Ok,

I have copied and changed the "collect on delevery" to adapt to my new plugin. I have created too a folder on the "plugins/hikashoppayment/pagseguro". But "pagseguro" still not showing at "configuration/payment plugin".

How to do the new plugin visible at configuration/payment plugin listing?

Thanks for the help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NDgwMy1ob3ctdG8tbWFrZS1hLXBheW1lbnQtcGx1Z2luP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

12 years 9 months ago [\#138865](#138865) 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 make a payment plugin?](/forum/31-development/864803-how-to-make-a-payment-plugin#138865 "Hi,  I have read the doc (  www.hikashop.com/support/support/documen...ntation.html#payment ) and I have some questions:  This sample scrypt ...  What directory I put? I want it visible and configurable on the hikashop/configuration/payment&#95;mode  Thanks.")*

You need to zip your plugin files and install them via the joomla installer so that joomla sees it as a plugin of the group "hikashoppayment" only then will you see it as a potential payment method in Hikashop.

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

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

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

Less More

- Posts: 25
- Thank you received: 1
-
-

12 years 9 months ago [\#138951](#138951) by [andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile")  Replied by *[andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile")* on topic *[How to make a payment plugin?](/forum/31-development/864803-how-to-make-a-payment-plugin#138951 "Hi,  I have read the doc (  www.hikashop.com/support/support/documen...ntation.html#payment ) and I have some questions:  This sample scrypt ...  What directory I put? I want it visible and configurable on the hikashop/configuration/payment&#95;mode  Thanks.")*

Thanks for the answers,

Nicolas, i did as you sayed and joomla install without errors.

Now I am adding a configuration file, i copyed the paypal configuration file as sample. I am new on Joomla and i dont know its architecture. I read the code at paypal_configuration.php and where is comming this array: data[payment] ? How I can add one array with my new plugin ?

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NDgwMy1ob3ctdG8tbWFrZS1hLXBheW1lbnQtcGx1Z2luP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

12 years 9 months ago [\#138955](#138955) 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 make a payment plugin?](/forum/31-development/864803-how-to-make-a-payment-plugin#138955 "Hi,  I have read the doc (  www.hikashop.com/support/support/documen...ntation.html#payment ) and I have some questions:  This sample scrypt ...  What directory I put? I want it visible and configurable on the hikashop/configuration/payment&#95;mode  Thanks.")*

It's not an array. It's a piece of input name. You can just keep it in your payment plugin fields.
Basically, you just copy/paste all the code/files and rename paypal to "yourpaymentgateway" in the files and then you have your plugin where you can just replace the different bits like the specific fields you would need, or the IPN handling...

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

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

Less More

- Posts: 25
- Thank you received: 1
-
-

12 years 9 months ago [\#138998](#138998) by [andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile")  Replied by *[andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile")* on topic *[How to make a payment plugin?](/forum/31-development/864803-how-to-make-a-payment-plugin#138998 "Hi,  I have read the doc (  www.hikashop.com/support/support/documen...ntation.html#payment ) and I have some questions:  This sample scrypt ...  What directory I put? I want it visible and configurable on the hikashop/configuration/payment&#95;mode  Thanks.")*

I did exactly as you said, but the plugin configuration page stay the way as on print-screen attached. What is wrong? The font of plugin is also attached, please help!

- [ ![hf77180b.png](/forum/attachment/14577) ](/forum/attachment/14577 "hf77180b.png") [ ](/forum/attachment/14577?download=1 "hf77180b.png")

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

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

Less More

- Posts: 25
- Thank you received: 1
-
-

12 years 9 months ago -  12 years 9 months ago [\#139116](#139116) by [andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile")  Replied by *[andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile")* on topic *[How to make a payment plugin?](/forum/31-development/864803-how-to-make-a-payment-plugin#139116 "Hi,  I have read the doc (  www.hikashop.com/support/support/documen...ntation.html#payment ) and I have some questions:  This sample scrypt ...  What directory I put? I want it visible and configurable on the hikashop/configuration/payment&#95;mode  Thanks.")*

Forget my last message, i have created other plugin based other payment plugin and that error is no more.

But my new plugin get a error 500 on the step2, after finish order (the payment's library create a external link), like printscreen attached. Do you have any idea why this error?

- [ ![h40f631c.png](/forum/attachment/14598) ](/forum/attachment/14598 "h40f631c.png") [ ](/forum/attachment/14598?download=1 "h40f631c.png")

Last edit: 12 years 9 months ago by [andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NDgwMy1ob3ctdG8tbWFrZS1hLXBheW1lbnQtcGx1Z2luP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

12 years 9 months ago [\#139126](#139126) 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 make a payment plugin?](/forum/31-development/864803-how-to-make-a-payment-plugin#139126 "Hi,  I have read the doc (  www.hikashop.com/support/support/documen...ntation.html#payment ) and I have some questions:  This sample scrypt ...  What directory I put? I want it visible and configurable on the hikashop/configuration/payment&#95;mode  Thanks.")*

A 500 error doesn't say anything about the problem. It could be anything.
Look in your server's PHP error log for the Fatal error behind that 500 error and you will know where it's coming from and why.

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

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

Less More

- Posts: 25
- Thank you received: 1
-
-

12 years 9 months ago -  12 years 9 months ago [\#139260](#139260) by [andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile")  Replied by *[andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile")* on topic *[How to make a payment plugin?](/forum/31-development/864803-how-to-make-a-payment-plugin#139260 "Hi,  I have read the doc (  www.hikashop.com/support/support/documen...ntation.html#payment ) and I have some questions:  This sample scrypt ...  What directory I put? I want it visible and configurable on the hikashop/configuration/payment&#95;mode  Thanks.")*

The log is empty, no error:

"POST /fechar-pedido/finalizacao/step-1/task-step HTTP/1.1" 500 1434

Only it.

The error show when i set a variable inside setSender:
Code:

$nome = $order-&gt;customer-&gt;name; $email = $order-&gt;customer-&gt;email; $paymentRequest-&gt;setSender( $nome, $email ); // error

if i set hardcode on the setSender, no problem is showed:

Code:

$paymentRequest-&gt;setSender( "Nome Maldito", "plugin@maldito.com" ); // no error

Why ? I do not understand why, do you have any ideia ?

update: I discovery the error: the payment library has some kind of parse about customer name... i just check if the name is right before send across method...

update 2: i made the plugin, all is working without problem.

Last edit: 12 years 9 months ago by [andersondionizio](/forum/user/30374-andersondionizio "View andersondionizio's Profile").

The following user(s) said Thank You: [Jerome](/forum/user/80-jerome "View Jerome's Profile")

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

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

[](#top)
