Enable Click to Pay for use with Secure Fields
private_key.pem
that is kept in the same folder next to the code. You could
store this key in an environment variable or a secure vault.
onCardVaultSuccess
property
on the SecureFields
component to create a transaction.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 on the OTP component. It is recommended to hide the Click to Pay component
for the user at this point.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.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.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.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
).