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.


Prerequisites

Upload your .p12 file

To use Apple Pay in a server-to-server integration or with the emerchantpay Web Payment Form (WPF), you must generate and upload your processing certificate as a .p12 file in the Apple Pay Onboarding section of your Genesis Merchant Console.

Apple Pay upload a p12 file


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 a Apple Pay payment request to the emerchantpay Genesis 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>Descriptor one</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 Genesis.
  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 Genesis production environment.

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