Mine põhisisu juurde

Apple Pay Integration Guide

Step-by-step instructions for integrating Apple Pay into your e-commerce platform

Värskendatud üle 2 kuu tagasi

Overview

Apple Pay is a secure and convenient mobile wallet that allows users to make payments in person, within iOS apps, and on the web using compatible Apple devices.


Accessibility Requirements

To ensure Apple Pay functions correctly:


Integration Methods

We support Apple Pay integration through two primary methods:

  1. Hosted Payment Page: Utilize our hosted payment page to process transactions.

  2. Web SDK: Integrate Apple Pay directly into your webstore's checkout page using our Web SDK.


Hosted Payment Page Integration

To integrate Apple Pay via our hosted payment page:

  1. Prerequisites:

    • Ensure your e-shop is registered and active in the Merchant Portal.

    • Confirm that card payment methods are enabled.

  2. Payment Initiation:

    • Initiate a payment by calling the /oneoff API endpoint.

    • Redirect the customer to the general payment_link without specifying the method_source parameter.

    • On Apple Pay-compatible devices, the hosted page will display the Apple Pay button and payment sheet automatically.

Note: No additional configurations are required for this integration method. To enable Apple Pay, please contact your acquirer.


Web SDK Integration

Integrating Apple Pay directly into your webstore's checkout page using our Web SDK allows for a seamless customer experience without the need for an Apple Developer account.

Prerequisites

  • All pages incorporating Apple Pay must be served over HTTPS.

  • Your webstore domain must possess a valid SSL certificate.

  • Your server should be configured for secure communication with Apple Pay. Refer to Apple's Apple Pay on the Web guide.

  • Ensure your e-shop is registered and active in the Merchant Portal.

  • Confirm that card payment methods are enabled

Preparations

  1. Download Domain Verification File:

    • Log in to the Merchant Portal.

    • Navigate to E-shop Settings.

    • Select the appropriate e-shop and go to the Apple Pay section.

    • Download the domain verification file.

    • Host the file's content at https://[DOMAIN_NAME]/.well-known/ in your website's root directory.

    • Ensure the file is accessible at https://[DOMAIN_NAME]/.well-known/apple-developer-merchantid-domain-association.

  2. Register Webstore Domain:

    • In the Merchant Portal, go to E-shop Settings.

    • Select the appropriate e-shop and navigate to the Apple Pay section.

    • Click the + icon and enter your webstore domain or sub-domain (e.g., example.com, www.example.com).

    • Click Add Domain.

    • Verify the registration status. A successful registration will display the status as registered alongside the corresponding domain.

  3. Payment Initiation:

    • To initiate a payment using the Web SDK, execute a standard /oneoff request, including the additional parameter mobile_payment=true.

Integration Overview

  1. Validate Apple Pay Compatibility and Set Up the Apple Pay Button:

    • Incorporate code into your checkout page to ensure the Apple Pay button is displayed only on compatible devices.

    • Utilize the ApplePaySession class methods to validate compatibility:

      if (window.ApplePaySession && ApplePaySession.canMakePayments()) { // Display Apple Pay button here 
      }
  2. Customize the Apple Pay Button:

  3. Initialize the Web SDK:

    • Include the apple-pay-client.js script in your checkout page:

      <script src="https://pay.every-pay.eu/apple_pay/apple-pay-client-1.4.js"></script>
    • Initialize the Apple Pay client with the necessary parameters:

      var applePayClient = ApplePayClient.initialize({ 
      access_token: 'mobile_access_token', // Provided in /oneoff response
      api_username: 'api_username', // Provided by us
      merchant_id: 'applepay_merchant_identifier', // Provided by us account_name: 'account_name' // Provided by us
      });
    • Set up the result handler for the Apple Pay button:

      javascriptCopyEditdocument.querySelector('apple-pay-button').addEventListener('click', function () { applePayClient.createApplePayPayment({ 
      payment_reference: 'payment_reference', // Provided by us country_code: 'descriptor_country', // Provided by us
      currency_code: 'currency', // Provided by us
      payment_link: 'payment_link', // General 'payment_link' without 'method_source'
      total: {
      label: 'label',
      amount: 'amount' }
      });
      });


Merchant-Initiated Transactions (MIT) with Apple Pay

Apple Pay supports Merchant-Initiated Transactions (MIT) similarly to regular card payments. If your system is already configured to handle MIT transactions with standard cards, no additional integration steps are necessary for Apple Pay. Key processes, such as saving a card token during an initial one-off transaction and utilizing that token for subsequent MIT charges, remain consistent when the initial payment is made using Apple Pay.

Note: For detailed information on MIT integration, refer to the API documentation.

Kas see vastas teie küsimusele?