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

#   Custom Payment Plugin Notification Not Received

##

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

Less More

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

10 years 11 months ago [\#222197](#222197) by [BigDutch](/forum/user/2792-bigdutch "View BigDutch's Profile")  *[Custom Payment Plugin Notification Not Received](/forum/29-payment-methods/880745-custom-payment-plugin-notification-not-received#222197 "-- HikaShop version -- : HikaShop Starter: 2.6.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.4.45  Customising the 'Example' payment plugin to work with the JCC providor here in Cyprus, the Debug for the plugin is turned on.  The plugin posts to the payment gateway ok, i can use their dummy card and receive a success, the gateway then posts the response data to the notify URL i have set (/index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;notif&#95;payment=jcc&amp;tmpl=component) but i get a blank screen and no entry in the plugin log.  Using Chrome i can see the post data send by the gateway are as expected, and looking at my Raw Access Logs from cPanel i get status 200. At a guess the function 'onPaymentNotification' is not being processed, as i would expect to see onscreen debug and entry to logfile ?  What to do ?")* was created by *[BigDutch](/forum/user/2792-bigdutch "View BigDutch's Profile")*

-- HikaShop version -- : HikaShop Starter: 2.6.0
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.4.45

Customising the 'Example' payment plugin to work with the JCC providor here in Cyprus, the Debug for the plugin is turned on.

The plugin posts to the payment gateway ok, i can use their dummy card and receive a success, the gateway then posts the response data to the notify URL i have set (/index.php?option=com_hikashop&amp;ctrl=checkout&amp;task=notify&amp;notif_payment=jcc&amp;tmpl=component) but i get a blank screen and no entry in the plugin log.

Using Chrome i can see the post data send by the gateway are as expected, and looking at my Raw Access Logs from cPanel i get status 200. At a guess the function 'onPaymentNotification' is not being processed, as i would expect to see onscreen debug and entry to logfile ?

What to do ?

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

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

Less More

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

10 years 11 months ago [\#222266](#222266) by [BigDutch](/forum/user/2792-bigdutch "View BigDutch's Profile")  Replied by *[BigDutch](/forum/user/2792-bigdutch "View BigDutch's Profile")* on topic *[Custom Payment Plugin Notification Not Received](/forum/29-payment-methods/880745-custom-payment-plugin-notification-not-received#222266 "-- HikaShop version -- : HikaShop Starter: 2.6.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.4.45  Customising the 'Example' payment plugin to work with the JCC providor here in Cyprus, the Debug for the plugin is turned on.  The plugin posts to the payment gateway ok, i can use their dummy card and receive a success, the gateway then posts the response data to the notify URL i have set (/index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;notif&#95;payment=jcc&amp;tmpl=component) but i get a blank screen and no entry in the plugin log.  Using Chrome i can see the post data send by the gateway are as expected, and looking at my Raw Access Logs from cPanel i get status 200. At a guess the function 'onPaymentNotification' is not being processed, as i would expect to see onscreen debug and entry to logfile ?  What to do ?")*

After much messing about, i realise that the onPaymentNotification function was 'ready' to be fired, i just had to modify it to actually do something!

So, now, i still get a blank page in the front end, but, on checking the backend, the order status is being amended as expected and the debug log file is being populated.

Next step, display something in the front end other than a blank page ... where am i going wrong ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy84ODA3NDUtY3VzdG9tLXBheW1lbnQtcGx1Z2luLW5vdGlmaWNhdGlvbi1ub3QtcmVjZWl2ZWQ/dG1wbD1tYXJrZG93bg==) 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: 4077
-
- [](http://obsi.dev)
-

10 years 11 months ago [\#222271](#222271) 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 Notification Not Received](/forum/29-payment-methods/880745-custom-payment-plugin-notification-not-received#222271 "-- HikaShop version -- : HikaShop Starter: 2.6.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.4.45  Customising the 'Example' payment plugin to work with the JCC providor here in Cyprus, the Debug for the plugin is turned on.  The plugin posts to the payment gateway ok, i can use their dummy card and receive a success, the gateway then posts the response data to the notify URL i have set (/index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;notif&#95;payment=jcc&amp;tmpl=component) but i get a blank screen and no entry in the plugin log.  Using Chrome i can see the post data send by the gateway are as expected, and looking at my Raw Access Logs from cPanel i get status 200. At a guess the function 'onPaymentNotification' is not being processed, as i would expect to see onscreen debug and entry to logfile ?  What to do ?")*

Hi,

The notification is a function used for "server to server" ; is goal is not to display something.
You have to modify your order status and then perform a redirect ; specially if you're not using the function in the "server to server" but if it's the customer who use the page.

Please do not hesitate to take a look at the HikaShop payment plugins.. You have more than 50 examples in HikaShop.

Regards,

---

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

The following user(s) said Thank You: [BigDutch](/forum/user/2792-bigdutch "View BigDutch's Profile")

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

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

Less More

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

10 years 11 months ago -  10 years 11 months ago [\#222461](#222461) by [BigDutch](/forum/user/2792-bigdutch "View BigDutch's Profile")  Replied by *[BigDutch](/forum/user/2792-bigdutch "View BigDutch's Profile")* on topic *[Custom Payment Plugin Notification Not Received](/forum/29-payment-methods/880745-custom-payment-plugin-notification-not-received#222461 "-- HikaShop version -- : HikaShop Starter: 2.6.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.4.45  Customising the 'Example' payment plugin to work with the JCC providor here in Cyprus, the Debug for the plugin is turned on.  The plugin posts to the payment gateway ok, i can use their dummy card and receive a success, the gateway then posts the response data to the notify URL i have set (/index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;notif&#95;payment=jcc&amp;tmpl=component) but i get a blank screen and no entry in the plugin log.  Using Chrome i can see the post data send by the gateway are as expected, and looking at my Raw Access Logs from cPanel i get status 200. At a guess the function 'onPaymentNotification' is not being processed, as i would expect to see onscreen debug and entry to logfile ?  What to do ?")*

Thanks for helpful explanation, i understand now what is happening. In my payment plugin now, if the payment is success or fail, the order status is changed and the user is redirected to one of the two options :

**success** : HIKASHOP_LIVE.'index.php?option=com_hikashop&amp;ctrl=checkout&amp;task=after_end&amp;order_id='.$order_id.$this-&gt;url_itemid;

This option displays "Thank you for your purchase." within the &lt;div id="system-message-container"&gt;, the URL shows the order id, what about a menu item id in the URL to add module(s) ? where/how do i 'alter' the message given on this page, to extend it with additional text and variables ?

**fail** : HIKASHOP_LIVE.'index.php?option=com_hikashop&amp;ctrl=order&amp;task=cancel_order&amp;order_id='.$order_id.$this-&gt;url_itemid;

This option displays "The cart is empty" within the &lt;div id="system-message-container"&gt;, but the URL is not showing the order ID but showing the Hikashop category listing menu item. As with the above 'status' i&#96;d like to change message provided, and, not return to Hikashop category listing menu item.

I have seen in some payment plugins that a 'thankyou' page is called, but if possible i&#96;d rather use as much of the built in HIKASHOP function as possible before and after the payment process.

Last edit: 10 years 11 months ago by [BigDutch](/forum/user/2792-bigdutch "View BigDutch's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy84ODA3NDUtY3VzdG9tLXBheW1lbnQtcGx1Z2luLW5vdGlmaWNhdGlvbi1ub3QtcmVjZWl2ZWQ/dG1wbD1tYXJrZG93bg==) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14290
-
-

10 years 11 months ago [\#222470](#222470) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom Payment Plugin Notification Not Received](/forum/29-payment-methods/880745-custom-payment-plugin-notification-not-received#222470 "-- HikaShop version -- : HikaShop Starter: 2.6.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.4.45  Customising the 'Example' payment plugin to work with the JCC providor here in Cyprus, the Debug for the plugin is turned on.  The plugin posts to the payment gateway ok, i can use their dummy card and receive a success, the gateway then posts the response data to the notify URL i have set (/index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;notif&#95;payment=jcc&amp;tmpl=component) but i get a blank screen and no entry in the plugin log.  Using Chrome i can see the post data send by the gateway are as expected, and looking at my Raw Access Logs from cPanel i get status 200. At a guess the function 'onPaymentNotification' is not being processed, as i would expect to see onscreen debug and entry to logfile ?  What to do ?")*

Hi,

1. Normally, payment plugins have a "return_url" setting. When filled by the merchant, the after_end controller will automatically redirect to that URL. That way, the merchant can display whatever he wants on his thank you page.
But if you want to handle it at the plugin level, that's also possible. Simply change the success URL to go to another page where you would display whatever you want.
There is no mechanism to just change the thank you message from the payment plugin.

2.
That's because you have the setting "Clean cart when order is" set to "created" in the HikaShop configuration. Change it and you'll be back to your checkout so that you can continue the purchase with another payment method.
All, the messages can be modified with a translation override:
[ hikashop.com/download/languages.html#modify](https://hikashop.com/download/languages.html#modify)

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

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

Less More

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

10 years 11 months ago -  10 years 11 months ago [\#222714](#222714) by [BigDutch](/forum/user/2792-bigdutch "View BigDutch's Profile")  Replied by *[BigDutch](/forum/user/2792-bigdutch "View BigDutch's Profile")* on topic *[Custom Payment Plugin Notification Not Received](/forum/29-payment-methods/880745-custom-payment-plugin-notification-not-received#222714 "-- HikaShop version -- : HikaShop Starter: 2.6.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.4.45  Customising the 'Example' payment plugin to work with the JCC providor here in Cyprus, the Debug for the plugin is turned on.  The plugin posts to the payment gateway ok, i can use their dummy card and receive a success, the gateway then posts the response data to the notify URL i have set (/index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;notif&#95;payment=jcc&amp;tmpl=component) but i get a blank screen and no entry in the plugin log.  Using Chrome i can see the post data send by the gateway are as expected, and looking at my Raw Access Logs from cPanel i get status 200. At a guess the function 'onPaymentNotification' is not being processed, as i would expect to see onscreen debug and entry to logfile ?  What to do ?")*

As function stands below, the user is redirected as required, and order status changes, however no debug log

But, if part (6b) and (6c) return are not commented, then the debug log is written, but the redirect doesn't work.

How to achieve redirect AND debug log ?
Code:

function onPaymentNotification(&amp;$statuses) { // (1) Create array from the received gateway response parameters $vars = array(); $filter = JFilterInput::getInstance(); foreach($_REQUEST as $key =&gt; $value) { $key = $filter-&gt;clean($key); $value = JRequest::getString($key); $vars[$key]=$value; } // (2) We load the parameters of the plugin in $this-&gt;payment_params and the order data based on the order_id coming from the payment platform $order_id = (int)@$vars['OrderID']; $dbOrder = $this-&gt;getOrder($order_id); $this-&gt;loadPaymentParams($dbOrder); if(empty($this-&gt;payment_params)) return false; $this-&gt;loadOrderData($dbOrder); // (3) Configure the "success/fail URLs" to re-direct in (6) $return_url = $this-&gt;pluginConfig['return_url'][2].'&amp;order_id='.$order_id; //.$this-&gt;url_itemid ; $cancel_url = $this-&gt;pluginConfig['cancel_url'][2].'&amp;order_id='.$order_id; //.$this-&gt;url_itemid ; // (4) Recalculate the hash to check for (6) $hash = $this-&gt;jcc_signature($this-&gt;payment_params-&gt;password,$vars,false,false); // (5) Debug mode activated or not if($this-&gt;payment_params-&gt;debug) { //Display debug information in the payment log file echo print_r($vars,true)."\n\n\n"; echo print_r($dbOrder,true)."\n\n\n"; echo print_r($hash,true)."\n\n\n"; } // (6) Confirm (or not) the order if (strcasecmp($hash,$vars['ResponseSignature'])!=0) //Different hash between what we calculate and the hash ent by the payment platform so we do not do anything as we consider that the notification doesn't come from the payment platform. { // (6a) we display debug information in the payment log file available in the configuration's Files section. if($this-&gt;payment_params-&gt;debug) echo 'Hash error '.$vars['ResponseSignature'].' - '.$hash."\n\n\n"; return false; } // (6b) If gateway response is not success elseif($vars['ResponseCode']!='2') { $this-&gt;modifyOrder($order_id, $this-&gt;payment_params-&gt;invalid_status, true, true); $JCCResponse = "Report by JCC&lt;/br&gt;Error : " . $vars['ReasonCodeDesc']; $JCCResponseURL = $cancel_url; //return false; } // (6c) If gateway response is not success else { $this-&gt;modifyOrder($order_id, $this-&gt;payment_params-&gt;verified_status, true, true); $JCCResponse = "Report by JCC&lt;/br&gt;Success : " . $vars['ReasonCodeDesc']; $JCCResponseURL = $return_url; //return true; } $this-&gt;app-&gt;redirect($JCCResponseURL, $JCCResponse); }

Last edit: 10 years 11 months ago by [BigDutch](/forum/user/2792-bigdutch "View BigDutch's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy84ODA3NDUtY3VzdG9tLXBheW1lbnQtcGx1Z2luLW5vdGlmaWNhdGlvbi1ub3QtcmVjZWl2ZWQ/dG1wbD1tYXJrZG93bg==) 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: 4077
-
- [](http://obsi.dev)
-

10 years 11 months ago [\#222729](#222729) 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 Notification Not Received](/forum/29-payment-methods/880745-custom-payment-plugin-notification-not-received#222729 "-- HikaShop version -- : HikaShop Starter: 2.6.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.4.45  Customising the 'Example' payment plugin to work with the JCC providor here in Cyprus, the Debug for the plugin is turned on.  The plugin posts to the payment gateway ok, i can use their dummy card and receive a success, the gateway then posts the response data to the notify URL i have set (/index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;notif&#95;payment=jcc&amp;tmpl=component) but i get a blank screen and no entry in the plugin log.  Using Chrome i can see the post data send by the gateway are as expected, and looking at my Raw Access Logs from cPanel i get status 200. At a guess the function 'onPaymentNotification' is not being processed, as i would expect to see onscreen debug and entry to logfile ?  What to do ?")*

Hi,

Instead of performing "echo", you have to use Code:

$this-&gt;writeToLog( $content );

Regards,

---

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

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

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