On this page, you can find additional configuration for adding Apple Pay to your Components integration.
If you are selling digital goods in your native iOS app, use Apple's in-app purchase instead of Apple Pay.
Before you begin
This page assumes you have already built a Components integration.
Set up Apple Pay
Enable Apple Pay with your own Apple Pay certificate.
You don't need to send additional fields for Apple Pay. To see optional fields that you can send for all payment methods, choose the endpoint you integrated:
- /sessions: This is the default with Components v5.0.0 or later.
- /payments: If you implemented an additional use case.
If you run into an error, refer to Handle Apple Pay errors.
Configure and create an instance of the Apple Pay Component. Include the following when you configure the Component:
|Your Apple Pay PKPaymentRequest object.
|Your Apple Pay merchant identifier.
|The fields required for the billing contact.
|The fields required for the shipping contact.
If your integration uses iOS Components v5.0.0 or later, you can optionally include the following when you configure the Component:
|A prefilled billing address.
|A prefilled shipping address.
|Set to true to let the shopper add cards to their Apple Pay wallet if they haven't already done so. Otherwise, the shopper can't use Apple Pay.
|The type of shipping displayed, for example Pick Up, Ship To, or Deliver To. This is localized.
Default: PKShippingTypeShipping = .shipping.
|Set to false to prevent the shopper from changing the shipping contact field before showing the payment form.
|An array of supported shipping methods.
|Additional information that you provide about the payment request. For example, an order number or cart identifier.
This is signed and included in the resulting
|Only allow payments from cards issued in specific countries. This is a list of ISO 3166 country codes.
|Set to true to let the shopper enter a coupon code which gets validated.
|A coupon code that has already been applied to the payment request.
|Required for recurring payments. Include PKRecurringPaymentRequest to specify that the payment is a recurring payment.
To enable recurring payments, you must include
PKRecurringPaymentRequest when configuring Apple Pay.
Test and go live
Use Apple's test card numbers to test your integration.
For a full list of test cards and instructions how to add these to your test device, see Sandbox testing on Apple's Developer website.
Check the status of an Apple Pay test payment in your Customer Area > Transactions > Payments.
To process live Apple Pay payments, your API credential needs to have the API Clientside Encryption Payments role. You can check this in your live Customer Area or ask your Admin user to verify.
Make sure you follow Apple's guidelines on:
Enable Apple Pay on your Apple Pay Developer account for your live merchant identifier.
Set up your server for secure communication with Apple Pay.