Error Event
To help you identify and fix any errors that you might encounter when using Hosted Fields, subscribe to our error event. To subscribe to our error event, add an event listener to your form, for example:
If you encounter an error, the error event returns the following information:
Example error
config
errors
- “The mode should be either ‘payment’ or ‘tokenization’.”
- “The gateway origin is not defined.”
- “The api origin is not defined.”
- “A valid config is required to use hosted fields.”
- “An authentication token is required to use hosted fields.”
- “Secure token must be a string.”
- “Authentication token must be a string.”
- “You have passed a secure token or are in tokenization mode but the terminal is not setup to allow secure tokens.”
- “The mode must be set to ‘tokenization’ to use secure tokens.”
- “A processing terminal ID is required to use hosted fields.”
- “Processing terminal ID must be a number.”
- “The css value in your config must be supported by the property.”
- “The css key in your config must be an object as per the documentation.”
- “Card, ACH or PAD fields are required for hosted fields.”
- “Only one of Card, ACH or PAD fields should be supplied for hosted fields.”
- “A card number field is required for card forms.”
- “A card holder name field is required for card forms.”
- “A card expiry field is required for card forms.”
- “A card CVV field is required for card forms.”
- “A card issue number field is required for card forms.”
- “A submit button is required for payment forms.”
- “An account holder field is required for PAD and ACH forms.”
- “An account number field is required for PAD forms.”
- “An institution number field is required for PAD forms.”
- “A transit number field is required for PAD forms.”
- “An account number field is required for ACH forms.”
- “A routing number field is required for ACH forms.”
- “An account type field is required for ACH forms.”
- “An SEC code field is required for ACH forms.”
- “The target selector supplied for card number either occurs more than once or does not exist on the page.”
- “The target selector supplied for card issue number either occurs more than once or does not exist on the page.”
- “The target selector supplied for card issue number wrapper either occurs more than once or does not exist on the page.”
- “The target selector supplied for CVV wrapper either occurs more than once or does not exist on the page.”
- “The target selector supplied for card issue number error either occurs more than once or does not exist on the page.”
- “Card issue number wrapper is required for card forms. If you do not have a wrapper, please provide false.”
- “CVV wrapper is required for card forms. If you do not have a wrapper, please provide false.”
- “The target selector supplied for cardholder name either occurs more than once or does not exist on the page.”
- “The target selector supplied for card expiry either occurs more than once or does not exist on the page.”
- “The target selector supplied for card CVV either occurs more than once or does not exist on the page.”
- “The target selector supplied for submit button either occurs more than once or does not exist on the page.”
- “The target selector supplied for account holder either occurs more than once or does not exist on the page.”
- “The target selector supplied for account number either occurs more than once or does not exist on the page.”
- “The target selector supplied for institution number either occurs more than once or does not exist on the page.”
- “The target selector supplied for transit number either occurs more than once or does not exist on the page.”
- “The target selector supplied for account holder either occurs more than once or does not exist on the page.”
- “The target selector supplied for account number either occurs more than once or does not exist on the page.”
- “The target selector supplied for routing number either occurs more than once or does not exist on the page.”
- “The target selector supplied for account type either occurs more than once or does not exist on the page.”
- “The target selector supplied for SEC code either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for card number either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for cardholder name either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for card expiry either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for card CVV either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for submit button either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for account holder either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for account number either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for institution number either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for transit number either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for account holder either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for account number either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for routing number either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for account type either occurs more than once or does not exist on the page.”
- “The error container target selector supplied for SEC code either occurs more than once or does not exist on the page.”
init
errors
- “A session token is required to use hosted fields and was not received.”
- “The request is unauthorised, please check your credentials.”
- “The maximum number of retries to authenticate has been reached, please check your credentials.”
- “Session request response is invalid.”
- “You have passed ACH fields but the terminal is not setup to allow ACH.”
- “You have passed PAD fields but the terminal is not setup to allow PAD.”
- “You have passed PAD or ACH fields but the terminal is not setup to allow banks transfers.”
- “The terminal does not support the capability you are trying to use.”
field
errors
- “field must be provided in URL query parameters”
- “token must be provided in URL query parameters”
- “auth token must be provided in URL query parameters”
- “targetOrigin must be provided in URL query parameters”
- “Could not find input element on page”
- “Could not find radio buttons for ACH account type”
- “Could not find button element on page”
- “The maximum number of retries to embed this field has been reached.”
- “The maximum number of retries to submit this field has been reached.”
submission
errors
- “Invalid response from the payment gateway when submitting details”
- “Max number of retries has been reached”