The error callback is invoked when problems occur during a payment.
The error callback must be defined using the data-error
attribute on the Checkout
script tag. The attribute value may be the name of a global function or a URL string.
When a URL is provided, the browser will be redirected to the new page with a query parameter appended for each argument.
<html> <head> <script src="https://suncorp.gateway.mastercard.com/static/checkout/checkout.min.js" data-error="errorCallback"></script> <script type="text/javascript"> function errorCallback(error) { //handle payment error } </script> </head> ... </html>
<html> <head> <script src="https://suncorp.gateway.mastercard.com/static/checkout/checkout.min.js" data-error="http://[your domain]/errorPage"></script> </head> ... </html>
INVALID_REQUEST
, SERVER_BUSY
, SERVER_FAILED
, CONSTRAINT_VIOLATION
, REQUEST_REJECTED
None