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

#   How to handle cancel event when order is cancelled

##

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

Less More

- Posts: 21
- Thank you received: 0
-
-

6 years 3 months ago -  6 years 3 months ago [\#322651](#322651) by [ajdev33](/forum/user/59738-ajdev33 "View ajdev33's Profile")  *[How to handle cancel event when order is cancelled](/forum/35-orders-management/900530-how-to-handle-cancel-event-when-order-is-cancelled#322651 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.3  Hello,  I am working on custom payment plugin and I manage to make payment via third party payment. Now I want to execute some code when order is cancelled and returned back to hikashop.  Right now I am getting below URL when order is cancelled :  Now want to update transaction id in order table which I am getting in above url. Also I want to show a message like &quot;Order is cancelled&quot;.  So please let me know how to handle this particular cancel&#95;order task in my custom payment plugin.  Thanks")* was created by *[ajdev33](/forum/user/59738-ajdev33 "View ajdev33's Profile")*

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.19
-- PHP version -- : 7.3

Hello,

I am working on custom payment plugin and I manage to make payment via third party payment. Now I want to execute some code when order is cancelled and returned back to hikashop.

Right now I am getting below URL when order is cancelled :
Code:

http://localhost/joomladev/index.php?option=com_hikashop&amp;ctrl=order&amp;task=cancel_order&amp;order_id=165&amp;Itemid=114&amp;cancel_cg_payment=1&amp;cg_iframe=true&amp;txId=840ec39a-8b6d-45c2-b73e-f3f43245a56a&amp;uniqueID=1596520852171&amp;lang=EN

Now want to update transaction id in order table which I am getting in above url.
Also I want to show a message like "Order is cancelled".

So please let me know how to handle this particular cancel_order task in my custom payment plugin.

Thanks

Last edit: 6 years 3 months ago by [ajdev33](/forum/user/59738-ajdev33 "View ajdev33's Profile").

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

6 years 3 months ago -  6 years 3 months ago [\#322654](#322654) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[How to handle cancel event when order is cancelled](/forum/35-orders-management/900530-how-to-handle-cancel-event-when-order-is-cancelled#322654 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.3  Hello,  I am working on custom payment plugin and I manage to make payment via third party payment. Now I want to execute some code when order is cancelled and returned back to hikashop.  Right now I am getting below URL when order is cancelled :  Now want to update transaction id in order table which I am getting in above url. Also I want to show a message like &quot;Order is cancelled&quot;.  So please let me know how to handle this particular cancel&#95;order task in my custom payment plugin.  Thanks")*

Hello,

Well, what you can do is tell the payment gateway to redirect to the payment notification URL with some extra parameter, and in the onPaymentNotification function of your plugin you can do whatever you want and then redirect your customers to the cancel URL yourself.

Alternatively, you can keep it the way you have it, and implement the onAfterOrderUpdate trigger in your plugin so that you'll be able do your code when the cancel URL cancels the order, but in that case, you need to do some checks as that trigger will be called whenever the order is changed (in the backend, by another plugin, for other payment plugins, etc), and you might not want to do any processing in your plugin in most cases the trigger is called.

Kind regards,
Mohamed.

Last edit: 6 years 3 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

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

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