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

#   Curl &amp; onPaymentNotification()

##

- **[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: 86556
- Thank you received: 14305
-
-

15 years 3 months ago [\#22544](#22544) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Curl &amp; onPaymentNotification()](/forum/4-how-to/22347-curl-onpaymentnotification?start=20#22544 "Hello nicolas.  I must know a thing before i can continue programming with Hikashop, I am trying to get onPaymentNotification() to run when i call cURL like this:  $ch = curl&#95;init('  www.4u2.co.il/index.php '); curl&#95;setopt($ch, CURLOPT&#95;POST, 1); curl&#95;setopt($ch, CURLOPT&#95;POSTFIELDS ,$params); curl&#95;setopt($ch, CURLOPT&#95;FOLLOWLOCATION, 1); curl&#95;setopt($ch, CURLOPT&#95;HEADER, 0); // DO NOT RETURN HTTP HEADERS curl&#95;setopt($ch, CURLOPT&#95;RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL curl&#95;setopt($ch, CURLOPT&#95;USERAGENT, &quot;Mozilla/4.0 (compatible; MSIE 6.0;Windows NT 5.1)&quot;); $result=curl&#95;exec($ch);  note that $params are the paramters &quot;notif&#95;payment=banktransfer&amp;option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;tmpl=component&amp;lang=he&quot; and some more parameter from the creditcard company.  Can the function work this way? I have tried few things and i can seem to run the function with this script..  Thanks in advance.")*

In order to empty the cart, you need to have the line below in the onAfterOrderConfirm function:
$this-&gt;removeCart = true;

And HikaShop will handle that for you.

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

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

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 3 months ago -  15 years 3 months ago [\#22545](#22545) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  Replied by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")* on topic *[Re: Curl &amp; onPaymentNotification()](/forum/4-how-to/22347-curl-onpaymentnotification?start=20#22545 "Hello nicolas.  I must know a thing before i can continue programming with Hikashop, I am trying to get onPaymentNotification() to run when i call cURL like this:  $ch = curl&#95;init('  www.4u2.co.il/index.php '); curl&#95;setopt($ch, CURLOPT&#95;POST, 1); curl&#95;setopt($ch, CURLOPT&#95;POSTFIELDS ,$params); curl&#95;setopt($ch, CURLOPT&#95;FOLLOWLOCATION, 1); curl&#95;setopt($ch, CURLOPT&#95;HEADER, 0); // DO NOT RETURN HTTP HEADERS curl&#95;setopt($ch, CURLOPT&#95;RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL curl&#95;setopt($ch, CURLOPT&#95;USERAGENT, &quot;Mozilla/4.0 (compatible; MSIE 6.0;Windows NT 5.1)&quot;); $result=curl&#95;exec($ch);  note that $params are the paramters &quot;notif&#95;payment=banktransfer&amp;option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;tmpl=component&amp;lang=he&quot; and some more parameter from the creditcard company.  Can the function work this way? I have tried few things and i can seem to run the function with this script..  Thanks in advance.")*

ok thats good, but the problem is that i sometimes dont want to empty it, but somewhere it does that anyway so after the end.php i cant do anything because the cart has already emptied.

How can i disable empty cart at that step, since there is no "$this-&gt;removeCart = true;" at my onAfterOrderConfirm() but it is still emptied?

Last edit: 15 years 3 months ago by [bars92](/forum/user/3048-bars92 "View bars92's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIyMzQ3LWN1cmwtb25wYXltZW50bm90aWZpY2F0aW9uP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) 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: 86556
- Thank you received: 14305
-
-

15 years 3 months ago [\#22562](#22562) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Curl &amp; onPaymentNotification()](/forum/4-how-to/22347-curl-onpaymentnotification?start=20#22562 "Hello nicolas.  I must know a thing before i can continue programming with Hikashop, I am trying to get onPaymentNotification() to run when i call cURL like this:  $ch = curl&#95;init('  www.4u2.co.il/index.php '); curl&#95;setopt($ch, CURLOPT&#95;POST, 1); curl&#95;setopt($ch, CURLOPT&#95;POSTFIELDS ,$params); curl&#95;setopt($ch, CURLOPT&#95;FOLLOWLOCATION, 1); curl&#95;setopt($ch, CURLOPT&#95;HEADER, 0); // DO NOT RETURN HTTP HEADERS curl&#95;setopt($ch, CURLOPT&#95;RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL curl&#95;setopt($ch, CURLOPT&#95;USERAGENT, &quot;Mozilla/4.0 (compatible; MSIE 6.0;Windows NT 5.1)&quot;); $result=curl&#95;exec($ch);  note that $params are the paramters &quot;notif&#95;payment=banktransfer&amp;option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;tmpl=component&amp;lang=he&quot; and some more parameter from the creditcard company.  Can the function work this way? I have tried few things and i can seem to run the function with this script..  Thanks in advance.")*

If it still empties the cart even though you don't have that code in the onAfterOrderConfirm function, I suppose that it's because you don't have the latest version of HikaShop.
Prior to that, the cart was always emptied when the order was created. We now moved the decision on whether to remove the cart or not to the payment plugins so that you can do just that.

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

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

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 3 months ago [\#22564](#22564) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  Replied by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")* on topic *[Re: Curl &amp; onPaymentNotification()](/forum/4-how-to/22347-curl-onpaymentnotification?start=20#22564 "Hello nicolas.  I must know a thing before i can continue programming with Hikashop, I am trying to get onPaymentNotification() to run when i call cURL like this:  $ch = curl&#95;init('  www.4u2.co.il/index.php '); curl&#95;setopt($ch, CURLOPT&#95;POST, 1); curl&#95;setopt($ch, CURLOPT&#95;POSTFIELDS ,$params); curl&#95;setopt($ch, CURLOPT&#95;FOLLOWLOCATION, 1); curl&#95;setopt($ch, CURLOPT&#95;HEADER, 0); // DO NOT RETURN HTTP HEADERS curl&#95;setopt($ch, CURLOPT&#95;RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL curl&#95;setopt($ch, CURLOPT&#95;USERAGENT, &quot;Mozilla/4.0 (compatible; MSIE 6.0;Windows NT 5.1)&quot;); $result=curl&#95;exec($ch);  note that $params are the paramters &quot;notif&#95;payment=banktransfer&amp;option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;tmpl=component&amp;lang=he&quot; and some more parameter from the creditcard company.  Can the function work this way? I have tried few things and i can seem to run the function with this script..  Thanks in advance.")*

Ok so i found that in the checkout configuration.. and i check i got the lastest stable version :S
Last question hopefully:
Can i run the function onAfterOrderConfrim() again from herself? (i need to have a form and then after submitting it going back to run the function).

thanks in advance.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIyMzQ3LWN1cmwtb25wYXltZW50bm90aWZpY2F0aW9uP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) 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: 86556
- Thank you received: 14305
-
-

15 years 3 months ago [\#22589](#22589) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Curl &amp; onPaymentNotification()](/forum/4-how-to/22347-curl-onpaymentnotification?start=20#22589 "Hello nicolas.  I must know a thing before i can continue programming with Hikashop, I am trying to get onPaymentNotification() to run when i call cURL like this:  $ch = curl&#95;init('  www.4u2.co.il/index.php '); curl&#95;setopt($ch, CURLOPT&#95;POST, 1); curl&#95;setopt($ch, CURLOPT&#95;POSTFIELDS ,$params); curl&#95;setopt($ch, CURLOPT&#95;FOLLOWLOCATION, 1); curl&#95;setopt($ch, CURLOPT&#95;HEADER, 0); // DO NOT RETURN HTTP HEADERS curl&#95;setopt($ch, CURLOPT&#95;RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL curl&#95;setopt($ch, CURLOPT&#95;USERAGENT, &quot;Mozilla/4.0 (compatible; MSIE 6.0;Windows NT 5.1)&quot;); $result=curl&#95;exec($ch);  note that $params are the paramters &quot;notif&#95;payment=banktransfer&amp;option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;tmpl=component&amp;lang=he&quot; and some more parameter from the creditcard company.  Can the function work this way? I have tried few things and i can seem to run the function with this script..  Thanks in advance.")*

Mmm. When you submit a form, the browser goes to the URL defined in the action attribute of the form tag. So it depends where that goes. However, you should be able to trigger again onAfterOrderConfrim once a checkout has been finished by just redirecting to the URL:
index.php?option=com_hikashop&amp;ctrl=order&amp;task=pay&amp;order_id=XXX
where XXX is the order id.

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

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

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 3 months ago [\#22617](#22617) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  Replied by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")* on topic *[Re: Curl &amp; onPaymentNotification()](/forum/4-how-to/22347-curl-onpaymentnotification?start=20#22617 "Hello nicolas.  I must know a thing before i can continue programming with Hikashop, I am trying to get onPaymentNotification() to run when i call cURL like this:  $ch = curl&#95;init('  www.4u2.co.il/index.php '); curl&#95;setopt($ch, CURLOPT&#95;POST, 1); curl&#95;setopt($ch, CURLOPT&#95;POSTFIELDS ,$params); curl&#95;setopt($ch, CURLOPT&#95;FOLLOWLOCATION, 1); curl&#95;setopt($ch, CURLOPT&#95;HEADER, 0); // DO NOT RETURN HTTP HEADERS curl&#95;setopt($ch, CURLOPT&#95;RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL curl&#95;setopt($ch, CURLOPT&#95;USERAGENT, &quot;Mozilla/4.0 (compatible; MSIE 6.0;Windows NT 5.1)&quot;); $result=curl&#95;exec($ch);  note that $params are the paramters &quot;notif&#95;payment=banktransfer&amp;option=com&#95;hikashop&amp;ctrl=checkout&amp;task=notify&amp;tmpl=component&amp;lang=he&quot; and some more parameter from the creditcard company.  Can the function work this way? I have tried few things and i can seem to run the function with this script..  Thanks in advance.")*

Working perfectly. thanks ![:)](/media/kunena/emoticons/3.png ":)")

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

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