Search

Are you looking for test card numbers?

Would you like to contact support?

Payment-method icon

Custom integration (In-app)

Learn how you can submit a payment through Adyen using your existing Apple Pay API implementation.

After initiating the ApplePay payment on your mobile application, you receive a callback that includes a PKPayment. This includes paymentData, a stringified version of the payment token.

Submit this data in your payment request to Adyen.

Adyen supports 3DS only. To specify this in the ApplePay request, pass the merchantCapabilities parameter set to 3DS in the PKPaymentRequest: request.merchantCapabilities = PKMerchantCapability3DS;

Step 1: Stringify the paymentData from the token

When the request is completed, you receive a PKPayment which contains paymentData. ApplePay returns more data than we need for authorisation, for example a shipping address, but only the paymentData is necessary for authorisation.

Convert the paymentData to a String: 

func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) {
  let token = String(data: payment.token.paymentData, encoding: .utf8)
}

Step 2: Submit the API request

Submit to /payments endpoint

If you're using our /payments endpoint, submit the encoded token from step 1 as the value of additionalData.applepay.token in the paymentMethod object:

{
  "amount": {
    "currency": "EUR",
    "value": 2000
  },
  "reference": "YOUR_REFERENCE",
  "paymentMethod": {
    "type": "applepay",
    "applepay.token": "VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU..."
  },
  "returnUrl": "https://your-company.com/...",
  "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
}

Once you completed the steps above and tested your integration, contact Support Team to configure live processing of Apple Pay payments.

Submit to /authorise endpoint

If you're using our /authorise endpoint, submit the encoded token from step 1 as the value of payment.token in the additionalData object:

{
   "amount":{
      "value":2000,
      "currency":"EUR"
   },
   "reference":"YOUR_REFERENCE",
   "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
   "additionalData":{
      "payment.token":"VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU..."
   }
}

Once you completed the steps above and tested your integration, contact Support Team to configure live processing of Apple Pay payments.