Canceling plugin payment so that it is not removed from the order
[v8
]
Currently, it is possible to interrupt a plugin payment by throwing an exception in the
Pay method and
PaySilently.
- Throwing a
PaymentActionCancelledExceptionwill cancel the order payment silently without any windows. - Throwing
PaymentActionFailedException(or any other) will display an error window on the UI.
After that, the plugin payment will be marked with the status FAILED and deleted.
In API V8, the specified exceptions have overloads
(#1,
#2),
allowing you to create an exception with the bool keepInOrder flag set to true, which will leave the payment that threw the exception in the order, if possible (applies only to payments; prepayments and tips will behave as before).