Error handling

If an error is encountered during the payment process, two things will occur:

  • The PaymentContainer will emit an event: error 
  • An error screen will be displayed to the user 

For example, if we receive a different payment status to NEW PAYMENT or APPROVED BY RISK from the Volt API, the PaymentContainer emits event: error with the following payload structure:

Error
{
  code: "INVALID_STATUS",
  status: "COMPLETED", 
  paymentId: "{uuid}",
  message: "Incorrect payment status"
}

Only the code and message elements will be supplied for every error, other fields are conditional and will appear based on the type of error.

Find out more about container events