Click here to search the entire website

Apple Pay

Everything you need to take Apple Pay payments via web or app:

How it works

  1. You request the encrypted payload from your app or website

  2. Apple Pay returns the encrypted payload following shopper authentication

  3. You send the encrypted payload to your server

  4. You send an XML Direct request to Worldpay containing the encrypted Apple Pay data

  5. We send you the payment response

  6. You inform the shopper of the outcome

Setup

Prerequisites

You need:

  • A Direct integration to Worldpay

  • An Apple iOS Developer account

  • Worldpay to enable Apple Pay on your account

Set up the Apple Merchant ID

Create an Apple Merchant ID through Apple’s developer portal.

In-app

For in-app payments Apple only need you to configure one item:

  • Payment Processing Certificate: This is where you upload the CSR generated by Worldpay. Contact Corporate Support with your Worldpay Merchant Code and your Apple Merchant ID, and we'll enable Apple Pay on your account. You can generate your own CSR using the Worldpay MAI.

    Note:  We give you separate CSRs for test and production environments. This means you must upload a new CSR when you migrate transaction processing between environments.

Detailed instructions to configure your Apple Merchant ID for in-app payments are at: https://developer.apple.com/library/content/ApplePay_Guide/Configuration.html

On web

For web payments, Apple need three items configured:

  • Payment Processing Certificate: This is where you upload the CSR generated by Worldpay. Contact Corporate Support with your Worldpay Merchant Code and your Apple Merchant ID, and we'll also enable Apple Pay on your account. .

    Note:  We give you separate CSRs for test and production environments. This means you must upload a new CSR when you migrate transaction processing between environments.

  • Merchant Domain: Apple will provide a file for you to host on your own server so that they can verify the domain used for the Apple Pay service.

  • Merchant Identity Certificate: This CSR is generated by you in order to facilitate a two way Transport Layer Security (TLS) 1.2 connection between your server and Apple’s servers when creating an Apple Pay session.

More instructions to configure your Apple Merchant ID for your website are at: https://developer.apple.com/reference/applepayjs/

Integrate with Apple Pay

Integrate to Apple Pay to obtain the encrypted payment credentials. While doing this, be aware of the below properties which relate to the Worldpay integration.

Set the merchantCapabilities property

Worldpay only supports the 3DS merchantCapabilities option, so configure your Apple Pay integration as follows:

In-app

In Xcode, configure the merchantCapabilities property of the request object to only accept the PKMerchantCapability3DS option:

request.merchantCapabilities = PKMerchantCapability3DS;

Note:  See Apple’s developer guides for more details: https://developer.apple.com/library/content/ApplePay_Guide/CreateRequest.html

On web

In your JavaScript, configure the merchantCapabilities property of the request object to only accept the supports3DS option:

var request = {

  countryCode: 'US',

  currencyCode: 'USD',

  supportedNetworks: ['visa', 'masterCard', 'amex', 'discover'],

  merchantCapabilities: ['supports3DS'], // Only use 'supports3DS' here

  total: { label: 'Your Label', amount: '10.00' },

}

Note:  See Apple’s developer guides for more details: https://developer.apple.com/reference/applepayjs/applepaysession

Set the supportedNetworks property

Worldpay only supports Apple Pay payments with Visa, Mastercard, American Express (Amex) and Discover cards.

In-app

In Xcode, configure the supportedNetworks property of the request object to only accept the card networks Worldpay support:

request.supportedNetworks =

@[PKPaymentNetworkAmex,PKPaymentNetworkVisa,PKPaymentNetworkMasterCard,PKPaymentNetworkDiscover];

Note:  See Apple’s developer guides for more details: https://developer.apple.com/library/content/ApplePay_Guide/CreateRequest.html

On web

In JavaScript, configure the supportedNetworks property of the request object to only accept the card networks Worldpay support:

var request = {

  countryCode: 'US',

  currencyCode: 'USD',

  supportedNetworks: ['visa', 'masterCard', 'amex', 'discover'], // Only use the cards listed here

  merchantCapabilities: ['supports3DS'],

  total: { label: 'Your Label', amount: '10.00' },

}

Note:  See Apple’s developer guides for more details: https://developer.apple.com/reference/applepayjs/applepaysession

Integrate with Worldpay

Prerequisite:  You've successfully integrated Apple Pay to your website or app, and can generate an encrypted payload.

When you've generated an encrypted payload, and have passed this to your server, send the payload to us within <APPLEPAY-SSL>.

Example XML request

Select

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE paymentService PUBLIC "-//WorldPay/DTD WorldPay PaymentService v1//EN"

"http://dtd.worldpay.com/paymentService_v1.dtd">

<paymentService version="1.4" merchantCode="MYMERCHANT">

  <submit>

  <order orderCode="applepayorder123" shopperLanguageCode="en">

    <description>ApplePay test order</description>

    <amount value="100" currencyCode="EUR" exponent="2"/>

    <orderContent>

      <![CDATA[]]>

    </orderContent>

    <paymentDetails>

      <APPLEPAY-SSL>

        <header>

          <ephemeralPublicKey>AAAA...</ephemeralPublicKey>

          <publicKeyHash>AAAA...</publicKeyHash>

          <transactionId>AAAA...</transactionId>

        </header>

        <signature>AAAA...</signature>

        <version>EC_v1</version>

        <data>AAAA...</data>

      </APPLEPAY-SSL>

    </paymentDetails>

    <shopper>

      <shopperEmailAddress>sp@worldpay.com</shopperEmailAddress>

    </shopper>

  </order>

  </submit>

</paymentService>

Response

The response message is the same as our standard XML responses.

Test

Worldpay’s test environment supports the use of Apple’s Sandbox Tester accounts and the Sandbox test cards (Mastercard, Maestro, Visa, Amex and Discover) provided by Apple.

More details are at: https://developer.apple.com/support/apple-pay-sandbox/

All Apple Pay transactions processed against the Worldpay test environment receive an AUTHORISED response status.

When you are ready to go live you must upload the production CSR we gave you.

Useful links

Some links to Apple Pay websites.

General links

Apple Pay: Your Wallet. Without the wallet

Worldpay/Apple Pay

Software development links

Developer: Apple Pay Resources

Developer: Apple Pay Developer Forums

Create a payment with a decrypted payload

Problems? Try Troubleshoot