Enable Click to Pay for use with Secure Fields
SecureFields
is loaded without a valid sessionId
it will error. We recommend only loading
the component if the session ID is set.onCardVaultSuccess
property
on the SecureFields
component to create a transaction.CODE_INVALID
- The user entered an incorrect OTP. An error message is also displayed
on the OTP component.INVALID_CARD
- The user entered incorrect card details, or the details of a card that
is not one of the supported schemes.ACCT_INACCESSIBLE
- The user’s account is temporarily not accessible.USER_NOT_RECOGNIZED
- The user is not recognized by Click to Pay (typically when a user
hasn’t signed in yet).UNKNOWN
- An unknown error occurred. These are usually unrecoverable. For example, the
Click to Pay library was not initialized due to an invalid parameter.RETRIES_EXCEEDED
- The user has exceeded the maximum number of retries filling in
their one-time password (OTP) and their profile is locked. An error message is also
displayed in the OTP component. It is recommended to hide the Click to Pay component
for the user at this point.SIGN_OUT_FAILED
- When attempting to sign out via the “Not you?” link, it is possible
that Click to Pay is not able to sign out the user. It is recommended to hide
the Click to Pay component for the user at this point.SecureFields
component to listen to specific Click to Pay events.Name | Event | Description |
---|---|---|
onMethodChange | METHOD_CHANGE | Triggered when a user switches between the card and the Click to Pay payment methods. |
onClickToPayInitialized | CLICK_TO_PAY_INITIALIZED | Triggered when Click to Pay is loaded and its init method called successfully. |
onClickToPayReady | CLICK_TO_PAY_READY | Triggered when a Click to Pay user is identified correctly and can start using Click to Pay. |
onClickToPaySignOut | CLICK_TO_PAY_SIGN_OUT | Triggered when a Click to Pay user signs out using the “Not me” / “Not my cards” functionality. |
onClickToPayError | CLICK_TO_PAY_ERROR | See Error Handling |
onClickToPayCancel | CLICK_TO_PAY_CANCEL | Triggered when a Click to Pay user cancels the checkout process from within the UI. |
onClickToPayCheckoutWithNewCard | CLICK_TO_PAY_CHECKOUT_WITH_NEW_CARD | Triggered when a Click to Pay user starts the process of checking out with a new (not enrolled) card. |
onClickToPayUnableToLoadDpa | CLICK_TO_PAY_UNABLE_TO_LOAD_DPA | Triggered when the provided Click to Pay DPA cannot be loaded. |
onVisibilityChange
to the ClickToPay
, ClickToPaySignIn
and CardForm
components to listen to visibility change events (CLICK_TO_PAY_VISIBILITY_CHANGE
, CLICK_TO_PAY_CARD_FORM_VISIBILITY_CHANGE
, CLICK_TO_PAY_SIGN_IN_VISIBILITY_CHANGE
).