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

ClickToPay.isEnrollmentAvailableForScheme(scheme, callback);


Example


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

Arguments

scheme String REQUIRED

The scheme of the card entered by the payer.

callback Function REQUIRED

Callback function to return the response.

canEnroll 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

None