Click to Pay onError

onError Callback

Triggered if an error occurs during checkout.

Provides an error code and message.


Usage Copied to clipboard

Returned if an error occurs.

Provides details about the error that you can use to determine the action you want to take.


Example Copied to clipboard

onError(error) {
  console.log('error code %s, error message %s', error.errorCode , error.errorMessage)
}

Arguments Copied to clipboard

error Copied to clipboard Object
errorCode Copied to clipboard String

Contains an error code that identifies the specific error.

errorMessage Copied to clipboard String

Contains an error message with details about the specific error.

List of error codes and associated error messages.

Integration Error Codes Copied to clipboard

Error Code Error Message Your action
CALLBACKS_ONCOMPLETE_ERROR Missing Argument: onComplete callback is required Include the onComplete callback method in the configure method.
CALLBACKS_ONERROR_ERROR Missing Argument: onError callback is required Include the onError callback method in the configure method.
MERCHANT_ID_ERROR Missing Argument: Merchant ID is required Include the merchant.id field in the configure method.
MERCHANT_NAME_ERROR Missing Argument: Merchant Name is required Include the merchant.name field in the configure method.
MERCHANT_URL_ERROR Missing Argument: Merchant URL is required Include the merchant.url field in the configure method.
SESSION_ID_ERROR Missing Argument: Session Id is required Include the session.id field in the configure method.
MISSING_API_VERSION_ERROR Missing Argument: API Version is required Include wsVersion field in the configure method.
ORDER_AMOUNT_ERROR Missing Argument: Order Amount is required Include order.amount field in the configure method.
ORDER_CURRENCY_ERROR Missing Argument: Order currency is required Include order.currency field in the configure method.
MIN_API_VERSION_ERROR API version should be greater than or equal to Change the wsVersion field value to at least 62, all operations must be made using 62 or higher.
CARD_LIST_ERROR Missing Argument: Elements.cardList is required Include the elements.cardList field that links to the card list component div
DCF_ERROR Missing Argument: Elements.dcf is required Include the elements.dcf field that links to the card list component div
MISSING_EMAIL_ERROR Missing Argument: email is required Include customer.email field in the configure method.
CUSTOMER_EMAIL_ERROR Customer email format error Ensure only valid payer email addresses are accepted by your site.
INTERACTION_LOCALE_ERROR Interaction locale format error Provide a valid locale using format eg en_US.
INTERACTION_COUNTRY_ERROR Interaction country format error Provide a valid ISO 3166 alpha-3 Country value in field interaction.country.

Checkout Error Codes Copied to clipboard

Error Code Error Message Your action
CARD_MISSING The digital card ID or encrypted card object was required but is missing Click to Pay is unavailable, revert to guess checkout flow.
CARD_ADD_FAILED Unable to add card when combined flow executed Click to Pay is unavailable, revert to guess checkout flow.
CARD_SECURITY_CODE_MISSING Card security must be supplied when combined flow executed Ensure the cardSecurityCode field in method C2P.enroll() is contains a 3 digit value or 4 digit for Amex.
CARD_INVALID Invalid card number when combined flow executed Ensure the primaryAccountNumber field in method C2P.enroll() is a valid card
CARD_NOT_RECOGNIZED The specified card was not recognized ensure the primaryAccountNumber field in method C2P.enroll() is a valid card
CARD_EXP_INVALID Invalid card expiry date Ensure the panExpirationYear and panExpirationMonth field in method C2P.enroll() is a valid
MERCHANT_DATA_INVALID Merchant data is invalid Click to Pay is unavailable, revert to guess checkout flow.
UNABLE_TO_CONNECT Unable to connect to / Launch DCF Click to Pay is unavailable, revert to guess checkout flow.
AUTH_INVALID Invalid federated ID token Click to Pay is unavailable, revert to guess checkout flow.

Standard C2P Error Codes Copied to clipboard

Error Code Error Message Your action
REQUEST_TIMEOUT The request took longer than the permitted time to complete. This could mean the service is experiencing a high volume of calls. You should try again later. It may also be because the SDK is unable to communicate with its iFrame Click to Pay is unavailable, revert to guess checkout flow.
SERVER_ERROR This indicates that the server encountered an unexpected condition that prevented it from fulfilling the request Click to Pay is unavailable, revert to guess checkout flow.
INVALID_PARAMETER The value provided for one or more request parameters is considered invalid. This error is also generated when a required field is missing. Note: Whenever possible you should provide client side validation to avoid an unnecessary round trip to the server. Simple validation constraints are documented as part of the API specification Click to Pay is unavailable, revert to guess checkout flow.
INVALID_REQUEST The server could not understand the request. Usually this means a data field must be in a particular format, but is not. For example, base64 decoding may have failed. The message field may provide additional clarification of what part/field of the request is considered incorrect Click to Pay is unavailable, revert to guess checkout flow.
AUTH_ERROR The server does understand the request, but cannot authenticate Click to Pay is unavailable, revert to guess checkout flow.
NOT_FOUND The requested resource/business entity does not exist. The resource might also be hidden for security reasons Click to Pay is unavailable, revert to guess checkout flow.
TERMS_AND_CONDITIONS Terms and Conditions not accepted Revert to guess checkout flow
TERMS_AND_CONDITIONS_NOT_ACCEPTED Terms and Conditions not accepted Revert to guess checkout flow
IS_CONFIGURED_ERROR configure() did not complete. Configuration should be initialized first Ensure your integration called configure method().
Ensure you allow sufficient time for the configure method to complete before making the Click to Pay components visible.
SRCI_ID_MISSING The identifier for the SRC Initiator is missing Click to Pay is unavailable, revert to guess checkout flow.
DPA_ID_MISSING The identifier for the DPA is missing Click to Pay is unavailable, revert to guess checkout flow.
SRCI_TXID_MISSING The SRC Initiator transaction identifier is missing Click to Pay is unavailable, revert to guess checkout flow.
DPA_TXOPT_MISSING The DPA Transaction Options structure is missing Click to Pay is unavailable, revert to guess checkout flow.
INVALID_STATE The account exists but is not in an "active" status for this program Revert to guess checkout flow
CONSUMER_ID_MISSING The consumer identity was required but not supplied Revert to guess checkout flow
FRAUD The user account was locked or disabled Revert to guess checkout flow
ID_FORMAT_UNSUPPORTED Invalid session ID Click to Pay is unavailable, revert to guess checkout flow.

Return Value Copied to clipboard

None