Accept Apple Pay

Accept Apple Pay payments in your online store.


Apple Pay allows your customers to make payments in your app or website using Touch ID or Face ID to authenticate a credit or debit card added to their Apple Pay account. Use the emerchantpay Apple Pay API to accept Apple Pay as a payment method across all of emerchantpay’s payment integrations.


Integration options

Choose how you want to integrate Apple Pay:

Integration Method Details
emerchantpay Payment Gateway API

Use the Apple Pay API for full control over the integration.

Web Payment Form (WPF)

A simpler solution with minimal development effort.


Prerequisites

Your Apple Pay setup requirements depend on your integration type.

Web Payment Form (WPF)

For WPF integrations, the Apple Pay button is displayed on emerchantpay’s hosted payment page. You don’t need to create an Apple Developer account or generate and upload a .p12 file because emerchantpay manages the Apple Pay configuration.

To enable Apple Pay on WPF, contact your Account Manager or emerchantpay support.

Server-to-server

If you integrate Apple Pay and display the Apple Pay button on your own website or payment page, you are responsible for completing the Apple Pay setup required for your domain.

You need:

  • An Apple Developer account with the Team Agent or Admin role. See Configuring Your Environment.
  • A valid .p12 file uploaded to the Gateway Console as shown below:
  1. Generate a .p12 file for Apple Pay.
  2. Open the Gateway Console.
  3. Select Configuration > Merchants in the navigation menu on the left.
  4. Click the Name of the merchant account or select Actions > View details.
  5. Under Apple Pay Onboarding, click Payment Processing Certificates to show that section.
  6. Click Browse and select the generated .p12 file.
  7. Click Upload certificate.

1. Authorise an Apple Pay payment

After your customer selects Apple Pay at checkout, the Apple Pay API will return an encrypted payment token containing the unique transaction information.

Example of a unique payment token:

{
  “token”: {
    “paymentData”: { … },
    “paymentMethod”: { … },
    “transactionIdentifier”: “32b…4f3”
  },
  “billingContact”: { … },
  “shippingContact”: { … }
}

2. Create an Apple Pay payment request

After the payment token is received, create an Apple Pay payment request to the emerchantpay payment gateway. Specify the encrypted payment token in payment_token and the payment type in payment_subtype.

Accepted Apple Pay payment types:

  • sale
  • authorize
  • init_recurring_sale

Example of passing an Apple Pay transaction request that contains a unique payment token:

  <?xml version=”1.0″ encoding=”UTF-8″?>
  <payment_transaction>
    <transaction_type>apple_pay</transaction_type>
    <transaction_id>119643250547501c79d8295</transaction_id>
    <payment_subtype>authorize</payment_subtype>
    <payment_token>
      {
        “paymentData”: { … },
        “paymentMethod”: { … },
        “transactionIdentifier”: “32B…4F3”
      }
    </payment_token>

3. Receive a response

You will receive a Success or Error response to your payment request.

Example of a Success response:

  <?xml version=”1.0″ encoding=”UTF-8″?>
  <payment_response>
    <transaction_type>apple_pay</transaction_type>
    <status>approved</status>
    <mode>live</mode>
    <transaction_id>119643250547501c79d8295</transaction_id>
    <unique_id>44177a21403427eb96664a6d7e5d5d48</unique_id>
    <consumer_id>123456</consumer_id>
    <avs_response_code>5I</avs_response_code>
    <avs_response_text>Response provided by issuer processor; Address information not verified</avs_response_text>
    <authorization_code>345678</authorization_code>
    <response_code>00</response_code>
    <timestamp>2022-06-29T15:36:44Z</timestamp>
    <descriptor>Acme Co.</descriptor>
    <amount>100</amount>
    <currency>USD</currency>
    <sent_to_acquirer>true</sent_to_acquirer>
    <scheme_transaction_identifier>019091214161031</scheme_transaction_identifier>
  </payment_response>

4. Test your integration

Use the Apple Pay sandbox to test your Apple Pay integration:

  1. Add an item to your cart in your online store.
  2. Proceed to the checkout page and check out using the Apple Pay button.
  3. Pay using one of the Apple test card details.
  4. Log in to the Gateway Console.
  5. In the navigation menu, go to Payment transactions.
  6. Verify that the transaction appears at the top of the list and is successful.

5. Accept live payments

After you have successfully tested your Apple Pay integration, you are ready to move to the production environment and accept live payments. Contact your emerchantpay Account Manager to get your login credentials for the production environment.

You are now ready to accept live payments using Apple Pay.