Error Handling
This topic describes the error handling function available for the Clearpay Button.
Property
The property is ClearpayButton.onError.
This property allows a custom function to be called that handles both client and server-side errors. When an error occurs, the Clearpay window closes and passes the message to the onError callback.
The onError hook returns event information that contains the following:
Clearpay Button Error Codes
An error at this point in the checkout flow means the customer has clicked the Clearpay Button. Unfortunately something then occurs and an order token is not created for this transaction. The Clearpay window closes, and sends details to the onError callback. The error codes are in the table below: