Check Apple Pay Eligibility

Always invoke this method whenever there is a change in the order amount.

To fetch the complete list of SDK-based wallet instruments (such as Apple Pay or Google Pay), call the following process function with the action set to 'sdkWalletEligibility'.

Note

Depending on the isEligible parameter in the response, the merchant needs to decide to show or hide the corresponding instrument.

Verify whether the device supports Apple Pay

The applePayCapabilities method asynchronously contacts Apple Pay servers as part of the verification process and returns the paymentCredentialStatus of the device.

This verifies on Safari and third-party browsers that the device is capable of making Apple Pay payments. It also verifies on Safari browsers that the device has at least one payment credential provisioned in Wallet. Depending on the response, you can determine if the device supports Apple Pay and whether to display an Apple Pay button.

The following are possible return values:

  1. paymentCredentialsAvailable

    Confirms that the device supports Apple Pay and there’s at least one active payment credential in Wallet that qualifies for payments on the web. Show an Apple Pay button and offer Apple Pay as the primary, but not necessarily sole, payment option.

  2. paymentCredentialStatusUnknown

    Confirms that the device supports Apple Pay, but the Wallet information is unknown. Show an Apple Pay button and offer Apple Pay as a possible payment option.

  3. paymentCredentialsUnavailable

    Confirms that the device supports Apple Pay and that the device doesn’t have any active payment credentials in Wallet. Offer Apple Pay as a payment option, but don’t make it the sole or default payment option. This gives people the option to set up Apple Pay as part of their purchase.

  4. applePayUnsupported

    Indicates that the device doesn’t support Apple Pay. Don’t display an Apple Pay button or offer Apple Pay as a payment option.

The following code shows how to check that a payment method is available before displaying an Apple Pay button.

Request Parameters

requestId
String
Mandatory

Unique identifier for the request.

service
String
Mandatory

Always in.juspay.ec

payload
String
Mandatory

Contains the main request payload.

payload Object Parameters

action
String
Mandatory

Type of action. Always set to sdkWalletEligibility.

customerId
String
Mandatory

Unique customer identifier.

gatewayReferenceId
String
Optional

Use gatewayReferenceId to target a particular gateway setup using its specific reference ID.

clientAuthToken
String
Mandatory

Authentication token generated by the merchant backend.

countryCode
String
Mandatory

Country code

Example:- SG

currency
String
Mandatory

Transaction currency

Example:- SGD

amount
String
Mandatory

Transaction amount to check eligibility for.

paymentMethods
String
Mandatory

List of payment methods to check eligibility.

Last updated 4 days ago