Search docs

Are you looking for test card numbers?

Would you like to contact support?

Start searching Adyen's documentation...


Custom integration (In-App)

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

Submit this data in an /authorise 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

The following example demonstrates how to submit an /authorise request. The value of the payment.token in the additionalData object is the encoded token from step 1.

   "reference":"Your Reference Here",

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