cancel
Showing results for 
Search instead for 
Did you mean: 

Cancel events on order, invoice and payment

Cancel events on order, invoice and payment

Hi everyone,

 

I am trying to find out which event is triggered when a refund is created in admin using the credit memo system.

 

There is a great page here describing the events available in M2:

https://cyrillschumacher.com/magento-2.3-list-of-all-dispatched-events/

 

I found a few events, which is a bit confusing:

 

sales_order_invoice_cancel

sales_order_payment_cancel_invoice

sales_order_payment_cancel_creditmemo

sales_order_payment_cancel

order_cancel_after

sales_order_creditmemo_cancel

 

My purpose is to update a payment API when a a customer is refunded in Magento 2, so that the payment provider an perform the corresponding refund operations.

 

Which of these events to use, and what do the others do? Is there any M2 doc explaining precisely what are these events?

 

Thanks a lot for your answers.

 

 

1 REPLY 1

Re: Cancel events on order, invoice and payment

For your case when you will refund a specific order or item from order,

Your best suitable event is,sales_order_creditmemo_cancel

An above event is used for Cancel an existing creditmemo.

 

for more events description refer blog, Different types of Cancel Event

 

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial