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

#   Custom payment plugin error with the order confirmation

##

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

Less More

- Posts: 5
- Thank you received: 0
-
-

9 years 1 month ago -  9 years 1 month ago [\#278376](#278376) by [jose94h](/forum/user/43963-jose94h "View jose94h's Profile")  *[Custom payment plugin error with the order confirmation](/forum/29-payment-methods/891935-custom-payment-plugin-error-with-the-order-confirmation#278376 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.7.5 -- PHP version -- : 5.5.38 -- Browser(s) name and version -- : chrome  I made a plugin and the problem that I have is that in the function &quot;onPaymentNotification&quot; to confirm the order status it is not possible to make the funcion &quot;getOrder&quot; get the acrual order. When I check the log the variable &quot;$dbOrder&quot; is always empty and therefore &quot;if(empty($this-&gt;payment&#95;params))&quot; is always true and I cannot continue processing the order status.")* was created by *[jose94h](/forum/user/43963-jose94h "View jose94h's Profile")*

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.7.5
-- PHP version -- : 5.5.38
-- Browser(s) name and version -- : chrome

I made a plugin and the problem that I have is that in the function "onPaymentNotification" to confirm the order status it is not possible to make the funcion "getOrder" get the acrual order. When I check the log the variable "$dbOrder" is always empty and therefore "if(empty($this-&gt;payment_params))" is always true and I cannot continue processing the order status. Code:

function onPaymentNotification(&amp;$statuses) { $vars = array(); $filter = JFilterInput::getInstance(); foreach($_REQUEST as $key =&gt; $value) //Se reciben todas las variables provenientes de un HTTP POST de PayU { $key = $filter-&gt;clean($key); $value = JRequest::getString($key); $vars[$key]=$value; } $this-&gt;writeToLog(print_r($vars,true)."Array Recibido\n\n\n"); //$order_id = (int)@$vars['reference_sale']; $order_id = (string)@$vars['reference_sale']; $this-&gt;writeToLog("\n Orden #: $order_id\n\n"); $this-&gt;writeToLog("\n 2\n\n"); $dbOrder = $this-&gt;getOrder($order_id); $this-&gt;writeToLog("\n dbOrder: $dbOrder\n\n"); $this-&gt;writeToLog("\n 3\n\n"); $this-&gt;loadPaymentParams($dbOrder); $this-&gt;writeToLog("\n 4\n\n"); if(empty($this-&gt;payment_params)) { $this-&gt;writeToLog("\n payment_params vacio\n\n"); return false; }

Last edit: 9 years 1 month ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: removing duplicate content (please do not put your message in the "error message" while it's not your error message). usage of [code] tag which is really, really nice !

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

9 years 1 month ago [\#278383](#278383) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Custom payment plugin error with the order confirmation](/forum/29-payment-methods/891935-custom-payment-plugin-error-with-the-order-confirmation#278383 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.7.5 -- PHP version -- : 5.5.38 -- Browser(s) name and version -- : chrome  I made a plugin and the problem that I have is that in the function &quot;onPaymentNotification&quot; to confirm the order status it is not possible to make the funcion &quot;getOrder&quot; get the acrual order. When I check the log the variable &quot;$dbOrder&quot; is always empty and therefore &quot;if(empty($this-&gt;payment&#95;params))&quot; is always true and I cannot continue processing the order status.")*

Hello,

First please note that the order_id must be a number and it need to contain the ID of an order created with the payment method.
Since your plugin right inherit from the HikaShop payment plugin ; the function getOrder will just get the order from the database.
The function loadPaymentParams will check that the plugin name is right according to the name of the plugin (stored in the $name variable).
And depending if your plugin is a multiple-instance or not, the code which will be processed to load the parameters will be different.
[ github.com/HikaShop/sample-payment-plugi...b/master/example.php](https://github.com/HikaShop/sample-payment-plugin/blob/master/example.php)

Regards,

---

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

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

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

Less More

- Posts: 5
- Thank you received: 0
-
-

9 years 1 month ago [\#278463](#278463) by [jose94h](/forum/user/43963-jose94h "View jose94h's Profile")  Replied by *[jose94h](/forum/user/43963-jose94h "View jose94h's Profile")* on topic *[Custom payment plugin error with the order confirmation](/forum/29-payment-methods/891935-custom-payment-plugin-error-with-the-order-confirmation#278463 "-- HikaShop version -- : 2.6.4 -- Joomla version -- : 3.7.5 -- PHP version -- : 5.5.38 -- Browser(s) name and version -- : chrome  I made a plugin and the problem that I have is that in the function &quot;onPaymentNotification&quot; to confirm the order status it is not possible to make the funcion &quot;getOrder&quot; get the acrual order. When I check the log the variable &quot;$dbOrder&quot; is always empty and therefore &quot;if(empty($this-&gt;payment&#95;params))&quot; is always true and I cannot continue processing the order status.")*

Thank you very much. Now it is solved. The issue was that I was sending a string to the function getOrder and it wasn´t the ID of the order it was the Id number.
Thanks for your support.

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

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

[](#top)
