Apple Pay
Accepting Apple Pay is faster than accepting traditional credit and debit cards and other payment methods. Customers no longer need to spend time searching for their wallet and finding the right card. Within apps or websites when using Safari, your customers can check out with a single touch.
Apple Pay Checkout Workflow
- A customer adds a credit, debit, or prepaid card into their Apple Wallet app on their iPhone, iPad, Apple Watch or Mac.
- The customer chooses to Buy with Apple Pay on the merchants website or iOS app and only needs to then select their card and shipping address.
- The customer's card details are retrieved securely by Fat Zebra and your systems are not exposed to the PCI Scope for this data.
Pre-requisites
Apple Guidelines
Before starting your Apple Pay integration, please review Apple's documentation on how to prepare your app and/or website to support Apple Pay:
- Planning For Apple Pay
- Apple Pay Acceptable Use Guidelines For Websites
- Human Interface Guidelines
- Apple Sandbox Testing
Setup your Apple Merchant ID
An Apple Merchant ID is an identifier you register with Apple that uniquely identifies your business as a merchant able to accept payments.
Follow the instructions in Setup your Apple Merchant ID for instructions to create this ID.
Implementing Apple Pay in Apps
Apple provide a sample Xcode app that implements Apple Pay that can be used for reference.
Please follow the official documentation from Apple for implementing Apple Pay in Apps.
In summary, you will need to implement the following to support Apple Pay in your app, with some steps requiring configuration specific to Fat Zebra:
- Enable Apple Pay in Xcode
- Determine if the device supports Apple Pay and whether the user has added payment cards using
PKPaymentAuthorizationController
andPKPaymentAuthorizationViewController
- Provide a button that is used either to trigger payments through Apple Pay or to prompt the user to set up a card with
PKPaymentButton
- Display a request for payment, including information about payment processing capabilities, the payment amount, and shipping information using
PKPaymentRequest
- Handling the callback in
PKPaymentAuthorizationControllerDelegate
that is made when the user has authorized the payment, and calling the Fat Zebra API to create a purchase using a wallet
Implementing Apple Pay on the Web
Please follow the official documentation from Apple for implementing Apple Pay on the Web.
Your implementation must meet the following pre-requisites as prescribed by Apple:
- Your website must comply with Apple Pay on the Web: Acceptable Use Guidelines
- All pages that include Apple Pay must be served over HTTPS
- Your Apple Merchant ID must have a Merchant Identity Certificate (which you will request from Fat Zebra) upload to it in the Apple Developer Dashboard, see Setup your Apple Merchant ID for instructions
- Any domains that will be used for Apple Pay transaction must be registered and verified in the Apple Developer Dashboard
Implementing the following to support Apple Pay on you website will require the following steps, with some steps requiring configuration specific to Fat Zebra:
- Choose an API for Implementing Apple Pay on Your Website, as you have the option of using the Apple Pay JS API or the W3C Payment Request API
- Determine if the device supports Apple Pay using
window.ApplePaySession
- Display an Apple Pay Button on your website using CSS templates provided by Apple
- Create an Apple Pay Session & provide it a payment request
- Create an Apple Pay Session for your payment request
- Handle the
onvalidatemerchant
event and call your server passing it the URL from the event’svalidationURL
property. Your server will then need to call the Fat Zebra Get Apple Pay Session endpoint. Your server will then receive an opaque Apple Pay session object from the Fat Zebra endpoint. This object needs to be passed onto your client side to call the Apple Pay Javascript SDK'scompleteMerchantValidation
method. - Once the user authorizes the payment, the
onpaymentauthorized
handler will be called on theApplePaySession
. This handler will contain a payment token encrypted by Apple using Payment Processing Certificate. In this event handler you can then call Fat Zebra API to create a purchase using a wallet, providing the payment token in the request payload
Testing in the Fat Zebra Sandbox Environment
Apple provides a Sandbox environment which allows you to test your implementation of Apple Pay with test credit and debit cards. Documentation on setting up a Apple Sandbox tester account [https://developer.apple.com/apple-pay/sandbox-testing/](can be found here).
The Fat Zebra API Sandbox environment will accept these Apple test credit and debit cards. For more information on the URL's of the Fat Zebra API Sandbox environment, refer to Endpoint Base URLs.
All Apple Pay transactions sent to the Fat Zebra API Sandbox environment will return cent-based responses, whereby the response code returned will be dependent on the amount specified in the request. E.g. for a request of $1.00, the Fat Zebra API will return a response code of "00" based on the cents of the amount. Similarly a request for $1.05 will return a response code of "05" declined. This allows you to test your integration against various response codes.
Limitations
Limited Acquirer Support For Recurring Transactions
Processing recurring transactions via Apple Pay is not supported by all Australian acquirers. If these methods are used where support is not yet available the transactions may be declined or return errors.
Updated over 4 years ago