# Click to Pay JavaScript Library
source: https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/js-libraries/click-to-pay/index.md

## Click to Pay SDK overview {#click-to-pay-sdk-overview}

The [click-to-pay.js](https://network.gateway.mastercard.com/api/documentation/integrationGuidelines/supportedFeatures/pickPaymentMethod/ClickToPay.html?locale=en_US) JavaScript library allows you to add support for Click to Pay to your payment page.

Click to Pay is an intelligent, password-free online checkout option that provides a quick and easy checkout experience designed to make 'guest checkout' for a payer faster and easier across all devices.

Click to Pay provides a single checkout button and a standardized checkout flow for all participating card schemes.

For the previous version of the `srci.js`, click [here](https://network.gateway.mastercard.com/api/documentation/apiDocumentation/src/version/100/api.html?locale=en_US).
Note: Supported only in API version 62 and later.

## URL {#url}

`https://{{host}}/static/click-to-pay/click-to-pay.min.js`

## Functions {#functions}

[configure()](https://network.gateway.mastercard.com/api/documentation/apiDocumentation/click-to-pay/version/100/function/configure.html?locale=en_US)
Configuration method for initializing the API.

[isEnrollmentAvailableForCardPrefix()](https://network.gateway.mastercard.com/api/documentation/apiDocumentation/click-to-pay/version/100/function/isEnrollmentAvailableForCardPrefix.html?locale=en_US)
Allows you to determine if you can offer the payer to enroll the card in Click to Pay if they have provided a card number with the provided 10-digit card prefix.

[isEnrollmentAvailableForScheme()](https://network.gateway.mastercard.com/api/documentation/apiDocumentation/click-to-pay/version/100/function/isEnrollmentAvailableForScheme.html?locale=en_US)
Allows you to determine if you can offer the payer to enroll the card in Click to Pay if they have provided a card with this scheme.

[checkoutWithNewCard()](https://network.gateway.mastercard.com/api/documentation/apiDocumentation/click-to-pay/version/100/function/checkoutWithNewCard.html?locale=en_US)
Allows you to trigger the Click to Pay checkout with a card that has not yet been enrolled in SRC.

[checkoutWithExistingCard()](https://network.gateway.mastercard.com/api/documentation/apiDocumentation/click-to-pay/version/100/function/checkoutWithExistingCard.html?locale=en_US)
Allows you to trigger the Click to Pay checkout when the payer has selected a card that is already enrolled in SRC.

[unbindCookies()](https://network.gateway.mastercard.com/api/documentation/apiDocumentation/click-to-pay/version/100/function/unbindCookies.html?locale=en_US)
Use this function when the payer clicks the 'Not you?' link to delete the cookies you are using to recognize the payer.

[initiatePayerInteraction()](https://network.gateway.mastercard.com/api/documentation/apiDocumentation/click-to-pay/version/100/function/initiatePayerInteraction.html?locale=en_US)
Allows you to trigger the Click to Pay interaction with the payer separately from initializing the Click to Pay interaction using the configure() function.

[updateConfiguration()](https://network.gateway.mastercard.com/api/documentation/apiDocumentation/click-to-pay/version/100/function/updateConfiguration.html?locale=en_US)
Allows the merchant to modify configuration after Click To Pay has been configured.

## Callbacks {#callbacks}

[onComplete](https://network.gateway.mastercard.com/api/documentation/apiDocumentation/click-to-pay/version/100/callback/onComplete.html?locale=en_US)
Triggered when the payer has completed the Click to Pay interaction.

[onStateChange](https://network.gateway.mastercard.com/api/documentation/apiDocumentation/click-to-pay/version/100/callback/onStateChange.html?locale=en_US)
Triggered when the payer email changes it changes if the payer's device is recognized

[onError](https://network.gateway.mastercard.com/api/documentation/apiDocumentation/click-to-pay/version/100/callback/onError.html?locale=en_US)
Triggered if an error occurs during checkout.
