Click to Pay isEnrollmentAvailableForScheme()

isEnrollmentAvailableForScheme()

Use this function if you are using Hosted Session to collect the card details from the payer.

Once the payer has entered the card number, use the information provided in the onCardTypeChange callback in field result.scheme and pass it to this function to determine if you can offer the payer to enroll the card in Click to Pay.

If the function returns true you must display the Click to Pay logo and terms and conditions.


Usage Copied to clipboard

ClickToPay.isEnrollmentAvailableForScheme(scheme, callback);


Example Copied to clipboard

ClickToPay.isEnrollmentAvailableForScheme('MASTERCARD', function (canEnroll) {
  console.log('Card can be enrolled', canEnroll)
});
  

Arguments Copied to clipboard

scheme Copied to clipboard String REQUIRED

The scheme of the card entered by the payer.

callback Copied to clipboard Function REQUIRED

Callback function to return the response.

canEnroll Copied to clipboard Boolean REQUIRED

Indicates if you can offer the payer to enroll the card in Click to Pay. If the value true is returned you can offer Click to Pay as a checkout option to the payer, otherwise you cannot.


Return Value Copied to clipboard

None