This page explains how to add Apple Pay to your existing Drop-in integration.
Requirements
Select which endpoint you are using:
API reference
In case of errors, set your server up to handle Apple Pay errors.
Drop-in configuration
Property | Description |
---|---|
merchantID |
Your Apple Pay merchant identifier. |
merchantName |
Your merchant name. This is used to generate
PKPaymentSummaryItem
. |
Optional configuration
You can include the following parameters in the configuration object:
Parameter | Description |
---|---|
allowOnboarding |
Set to true to let the shopper add new cards to their Apple Pay wallet if there are none or if their cards are not supported for the payment. By default this is set to false, and Apple Pay isn't shown as an available payment method if there are no cards in their Apple Pay wallet. |
applePaySummaryItems
|
An array of the items included in the purchase that summarize the payment amount. The last item must have the same value as the amount you send in your /payments request. |
requiredBillingContactFields
|
Billing information fields that you require from the shopper to process the transaction. Refer to Apple Pay documentation for sample values. |
billingContact
|
A prefilled billing address. |
requiredShippingContactFields
|
Shipping information fields that you require from the shopper to fulfill the order. Refer to Apple Pay documentation for sample values. |
applePayShippingType
|
The type of shipping displayed, for example Pick Up, Ship To, or Deliver To. This is localized. Default: PKShippingTypeShipping = .shipping. |
allowShippingContactEditing
|
Indicates if the shopper can edit fields of the shipping address. |
shippingMethods
|
List of available methods for shipping physical goods. Refer to Apple Pay documentation for sample values. |
applicationData
|
A Base64-encoded string for application-specific data. |
supportedCountries
|
Specify the ISO 3166 country codes if you only support payments from cards issued in specific countries. |
merchantCapability
|
The payment capabilities the merchant supports. |
You can refer to the ApplePayConfiguration
class in Github.
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.
Going live
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.
Set up Apple Pay on your Apple Pay Developer account for your live merchant identifier.