Developer forum

Forum » Integration » CheckoutDone event is fired when payment is cancelled

CheckoutDone event is fired when payment is cancelled

Espen Strømsnes
Reply

I have custom code that extends NotificationSubscriber and subscribes to the "Dynamicweb.Notifications.eCommerce.cart.CheckoutDone" event. In my custom code I dispatch the order to an external ERP system. My thought was that the event was only fired when the order was complete (i.e. payment was ok).

It turns out that the event is fired when a customer interrupts the payment process (i.e. cancels the payment at the external payment provider).

Is there a property on the Order I should check if the order was actually successful or should I use a different event all together? Should I check the Order.Complete property?

The reason I use the CheckoutDone event is because I must be able to downgrade the order to a cart if the dispatch to external ERP fails.


Replies

 
Dmitriy Benyuk
Reply

Hi Espen,
you can check the Order.Complete property and try to use the CheckOutDoneOrderIsComplete notification.
Regards, Dmitrij

 
Espen Strømsnes
Reply

Thanks for the quick reply Dmitriy.

Due to other circumstances I cannot use the CheckOutDoneOrderIsComplete notification because I must be able to downgrade the order to a cart in specific cases.

As I read your reply I can still use the CheckoutDone notification if I also check the property Order.Complete. Correct me if I'm wrong...

 
Dmitriy Benyuk
Reply

Hi Espen,

yes you can then use the CheckoutDone and check the order.Complete. Also if you would set order.Complete = false in the CheckOutDone notification subscriber
and the CheckoutDoneOrderIsNotComplete notification will be fired after and the order will be downgraded to cart after it.
Regards, Dmitrij

 

You must be logged in to post in the forum