Interrupting Plugin Payment Processing So That It Is Not Removed from the Order
Tags:
v8
Currently, it is possible to interrupt the payment of an order with a plugin type by throwing an exception in the method
Pay and
PaySilently.
- Throwing
PaymentActionCancelledExceptionwill cancel the order payment quietly without windows. - Throwing
PaymentActionFailedException(or any other) will show an error window on the UI.
After this, the plugin payment will be marked with the status FAILED and will be removed.
In API V8, the specified exceptions have overloads
(#1,
#2),
allowing the creation of an exception with the bool keepInOrder flag set to true, which will result in keeping the payment, during which the exception was thrown, in the order, if possible (this only applies to payments; prepayments and tips will behave as before).