Apple Pay is Apple’s mobile wallet that allows users easily and securely to make payments in person, via iOS apps and on the WEB.

Accessibility

EveryPay available integration methods

EveryPay integration supports Mastercard and Visa networks and offers the following options:

  • Hosted page solution
  • Web SDK

Hosted page solution

Apple Pay is available via EveryPay hosted payment page. This integration method requires an active registered e-shop and an enabled card payment method.

Initiate payment calling /oneoff API and redirect to the general “payment_link” without payment method specific “method_source” parameter. Payment will be processed in EveryPay page, displaying Apple Pay button and payment sheet when using an Apple Pay compatible device. No additional configurations are required to use Apple Pay in EveryPay hosted page. For enabling Apple Pay, please contact Your Acquirer.

* Please note that payment tokenisation (“request_token=true”, “token_agreement=recurring/unscheduled”) and checkup payments (zero amount) are not currently supported for Apple Pay. In case of such payments, the Apple Pay button will not be shown.

Web SDK

It is possible to use Apple Pay in webstore’s checkout page using EveryPay Web SDK. It allows you to accept Apple Pay payments without the need for an Apple Developer account.

The handling Apple Pay payments in webstore requires:

  • All pages that include Apple Pay must be served over HTTPS
  • Webstore domain must have a valid SSL certificate
  • Your server is set up for secure communication with Apple Pay. Follow the Apple Pay Guide
  • Active registered e-shop in EveryPay portal
  • Enabled card payment method

* Please note that payment tokenisation (“request_token=true”, “token_agreement=recurring/unscheduled”) and checkup payments (zero amount) are not currently supported for Apple Pay. To tokenize payments, card payment method should be used.

Preparations

  1. Download domain verification file:
  • From your Merchant portal, go to E-shop Settings
  • Choose the right e-shop and go to Apple Pay section
  • Download domain verification file
  • Host file’s content to https://[DOMAIN_NAME]/.well-known/ folder in your website’s root directory
  • Corresponding file should be reachable from https://[DOMAIN_NAME]/.well-known/apple-developer-merchantid-domain-association
  1. Register webstore domain:
  • From your Merchant portal, go to E-shop Settings
  • Choose the right e-shop and go to Apple Pay section
  • Click + icon and enter your webstore domain or sub-domain where the Apple Pay payment will take place (e.g. example.com, www.example.com etc.)
  • Click Add domain 
  • Check registration status. If the result is correct, the status registered and the corresponding domain should be displayed

  1. Payment initiation:
  • To initiate a payment using Web SDK, execute a regular /oneoff request adding one additional parameter “mobile_payment=true”

Integration overview

  1. Validate Apple Pay compatibility and set up your Apple Pay button:
  • Add code to checkout page to prevent the Apple Pay button from being presented on devices that do not support Apple Pay or Apple devices, or that do not have a card in the vault. For details, see the ApplePaySession class documentation on the Apple Pay JavaScript API site: Apple Developer Documentation. Apple provides ApplePaySession methods to validate Apple Pay compatibility on the site before the page loads

Examples of relevant ApplePaySession methods:

    • supportsVersion – Detects whether a web browser supports a particular Apple Pay version
    • canMakePayments – Indicates whether the device supports Apple Pay
    • canMakePaymentsWithActiveCard – Indicates whether the device supports Apple Pay and whether the user has an active card in their Wallet

Example:
if (window.ApplePaySession && ApplePaySession.canMakePayments()) {
// Display Apple Pay Buttons here
}

  1. Customize Apple Pay button using Apple Pay Guide
  2. Initialize the Web SDK

//Initialize the WEB SDK
<script>
var applePayClient = ApplePayClient.initialize({
access_token: 'mobile_access_token', //provided by EveryPay in /oneoff response
api_username: 'api_username', //provided by EveryPay, API username
merchant_id: 'applepay_merchant_identifier', //provided by EveryPay in /processing_accounts/:account_name and /oneoff response
account_name: 'account_name', //provided by EveryPay, processing account
});

  1. Create a Result Handler

document.querySelector('apple-pay-button').addEventListener('click', function() {
applePayClient.createApplePayPayment({
payment_reference: payment_reference, //provided by EveryPay in /oneoff response
country_code: 'descriptor_country', //provided by EveryPay in /oneoff response
currency_code: 'currency', //provided by EveryPay in /oneoff response
payment_link: 'payment_link', //provided by EveryPay in /oneoff response (general 'payment_link' without 'method_source')
total: {
label: 'label',
amount: 'amount'
}
})
});
</script>

  1. After the button is in place load apple-pay-client.js. This is a light JavaScript wrapper over the Apple API provided by EveryPay. The script looks for the button and attaches a function to the event handler

<script src="https://pay.every-pay.eu/apple_pay/apple-pay-client-1.4.js"></script>

in Integration
Did this article answer your question?