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

#   Payment notification does not work with CBuilder

##

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

Less More

- Posts: 22
- Thank you received: 3
-
-
- [](http://www.fusion.gg)
-

14 years 2 months ago -  14 years 2 months ago [\#61902](#61902) by [philgsy](/forum/user/8182-philgsy "View philgsy's Profile")  *[Payment notification does not work with CBuilder](/forum/3-bug-report/61902-payment-notification-does-not-work-with-cbuilder#61902 "I'm not sure why and I'm hoping that someone can help me.  With our site, we've been working with our payment provider to create a plugin for HikaSHop which is now complete.  For some reason though, the return nnotifications from the provider are not working on the site.  I've tested this on a &quot;clean&quot; site and it seemed to work ok, which I cant explain...")* was created by *[philgsy](/forum/user/8182-philgsy "View philgsy's Profile")*

I'm not sure why and I'm hoping that someone can help me.

With our site, we've been working with our payment provider to create a plugin for HikaSHop which is now complete.

For some reason though, the return nnotifications from the provider are not working on the site.

I've tested this on a "clean" site and it seemed to work ok, which I cant explain...
Code:

$pluginsClass = hikashop_get('class.plugins'); $ppages = new HikashopPPages(); $elements = $pluginsClass-&gt;getMethods('payment','securetradingppages'); if(empty($elements) &#124;&#124; !isset($elements[1])) { $ppages-&gt;createException(new Exception('The payment module class could not be retrieved correctly.'), __FILE__, __CLASS__, __LINE__); } $filter = &amp;JFilterInput::getInstance(); $paymentMethod = $elements[1]; $postVars = array(); foreach($_POST as $key =&gt; $value){ $key = $filter-&gt;clean($key); $value = JRequest::getString($key); $postVars[$key]=$value; } if (!isset($postVars['errorcode'])) { $ppages-&gt;createException(new Exception('The errorcode has not been set.'), __FILE__, __CLASS__, __LINE__); } if (!isset($postVars['orderreference'])) { $ppages-&gt;createException(new Exception('The orderreference has not been set.'), __FILE__, __CLASS__, __LINE__); } if ($paymentMethod-&gt;payment_params-&gt;usenotificationhash &amp;&amp; !isset($postVars['responsesitesecurity'])) { $ppages-&gt;createException(new Exception('The notification hash is enabled but the reponsesitesecurity was not posted to the notification script.'), __FILE__, __CLASS__, __LINE__); } if (isset($postVars['responsesitesecurity']) &amp;&amp; $postVars['responsesitesecurity'] !== hash('sha256', $postVars['errorcode'] . $postVars['orderreference'] . $paymentMethod-&gt;payment_params-&gt;notificationhash)) { $ppages-&gt;createException(new Exception('The notification hash is enabled but the responsesitesecurity field did not match the regenerated hash.'), __FILE__, __CLASS__, __LINE__); } $orderClass = hikashop_get('class.order'); $dbOrder = $orderClass-&gt;get($postVars['orderreference']); if(empty($dbOrder)){ $ppages-&gt;createException(new Exception('Could not load order using orderreference: ' . $postVars['orderreference']), __FILE__, __CLASS__, __LINE__); } $order = NULL; $order-&gt;order_id = $dbOrder-&gt;order_id; $order-&gt;old_status-&gt;order_status=$dbOrder-&gt;order_status; if ($postVars['errorcode'] == 0) { $order-&gt;order_status = $paymentMethod-&gt;payment_params-&gt;verified_status; } else { $order-&gt;order_status = $paymentMethod-&gt;payment_params-&gt;invalid_status; } $order-&gt;history-&gt;history_notified = 1; $orderClass-&gt;save($order); exit('Notification Complete.');

Last edit: 14 years 2 months ago by [philgsy](/forum/user/8182-philgsy "View philgsy's Profile").

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

14 years 2 months ago [\#62006](#62006) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: Payment notification does not work with CBuilder](/forum/3-bug-report/61902-payment-notification-does-not-work-with-cbuilder#62006 "I'm not sure why and I'm hoping that someone can help me.  With our site, we've been working with our payment provider to create a plugin for HikaSHop which is now complete.  For some reason though, the return nnotifications from the provider are not working on the site.  I've tested this on a &quot;clean&quot; site and it seemed to work ok, which I cant explain...")*

Hi,

In which function does your code source came from ?
Does the notification url is right ?
Are you sure that the notification is called ?
What's "HikashopPPages" ? Does it right included and defined ?
Do you check your PHP log file ?

Regards,

---

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

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

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