Skip to main content
With our Tap to Pay on iPhone solution you can accept contactless in-person payments using an iPhone as the payment interface, and process these payments on the Adyen payments platform.

Requirements

Before you begin, take into account the following requirements, limitations, and preparations.

How it works

Tutorial and app
Hit the ground running with our integration tutorial and iOS sample app.
To build a Tap to Pay on iPhone solution:
  1. Get an entitlement from Apple for Tap to Pay on iPhone and configure your Xcode project accordingly.
  2. Add the iOS Mobile SDK to your project, using basic authentication. Note that for compatibility with Objective C, you need to prefix the public symbols with ADY.
  3. Implement a server-to-server API request to establish a secure communication session.
  4. In your POS app, enable the transaction functionality of the SDK.
  5. Make sure that the Apple Terms of Conditions are accepted.
  6. From your POS app, call the warmup function to speed up initiating transactions.
  7. In your POS app, implement handling payments using the SDK. This creates the following flow:
    1. Your iOS POS app creates a Terminal API payment request, or receives a Terminal API payment request from your backend.
    2. The POS app passes the payment request to the iOS Mobile SDK.
    3. The SDK passes the request to the Tap to Pay on iPhone component.
    4. When the customer completes the payment by tapping their card or mobile device on the iPhone, the SDK passes the Terminal API payment response to the POS app.
  8. In your POS app, implement handling refunds and diagnosing the state of the SDK.
  9. If the same device will be used at multiple locations, implement clearing the communication session.

1. Get an entitlement from Apple

To add Tap to Pay functionality to your iOS POS app through the iOS Mobile SDK, you need to apply for a specific entitlement and then configure your Xcode project to use the entitlement. You need to apply separately for a TEST and a LIVE entitlement. The approval process for the LIVE environment can take up to several weeks.
  1. Make sure that you meet the requirements for submitting an entitlement request:
    • An Organization level Apple Developer account.
    • The Account Holder role for that Apple Developer account.
  2. Fill out the form to get the entitlement.
  3. After you receive the entitlement to support Tap to Pay on iPhone, follow Apple’s instructions to configure your Xcode project to use it.

2. Add the SDK to your project

You can add the iOS Mobile SDK to your POS app using a Swift Package Manager remote package. To get access you need to have a basic authentication credential. You can share the basic authentication password with anybody in your team who needs to get the SDK or create multiple passwords for internal use. Do not share this password in any publicly accessible code or area where unauthorized users can find it. To add the iOS Mobile SDK to your project:
  1. In your Customer Area create a basic authentication credential with a password:
    1. Go to Developers > API credentials, and select Create new credential.
    2. Under Payments > Credential type select Web service user and then select Create credential.
    3. Under Server settings > Authentication select the Basic auth tab and then select Generate password.
    4. Select the copy icon **and save your basic authentication password in a secure location.
    5. Go to Permissions > Roles > POS, select Allow SDK download for POS developers, and deselect any other permissions and roles. Contact Support Team if you don’t see the Allow SDK download for POS developers role.
    6. Select Save changes.
  2. Save the basic authentication password in a .netrc file:
    1. Check if you already have a .netrc file in your home directory. If you do not have it, create a plain text file with that name in your home directory (~/.netrc).
    2. Add the following content to your .netrc file, where login is the API credential username, for example ws_12345@Company.[YourCompanyAccount], and password is the basic authentication password.
    .netrc content for TEST integration
    1. Make sure that the .netrc file has the following file system permission: 0600.
  3. Add the POS Mobile SDK as a package dependency to your Xcode project: It is not possible to use TEST and LIVE environments from a single app target. You need to setup your Xcode project to have separate app targets for Test and for Live. Each target needs to link to the respective AdyenPOS SDK version for its environment: AdyenPOSTest and AdyenPOSLive.
    1. In your Xcode project or workspace, go to File > Add Package Dependencies.
    2. Enter the URL https://github.com/Adyen/adyen-pos-mobile-ios-test and select your preferred Dependency Rule.
    3. Select Add Package, and after the SDK is loaded add AdyenPOSTEST to your app target that connects to the Adyen test environment.
    4. Select Add Package.
  4. In your code, add import AdyenPOS, or for Objective-C compatibility add #import "ADYPOS/ADYPOS.h".

Compatibility with Objective-C

If your POS app requires the iOS Mobile SDK to be compatible with Objective-C:
  • Link the ADYPOSTEST package product to your app target instead of AdyenPOSTEST.
  • Link the ADYPOSLIVE package product to your app target instead of AdyenPOSLIVE. It is not possible to use TEST and LIVE environments from a single app target. Each app target must connect to a specific environment.
The integration process is the same. The only difference is that the public symbols are prefixed with ADY. For example, PaymentService is called ADYPaymentService.

3. Establish a session

To ensure the Mobile SDK and the Adyen payments platform can collaborate in a secure way, you need to implement a server-to-server API request for establishing a communication session. Authentication flow To authenticate this API request, you need to have an Adyen API credential in your test Customer Area. This credential must have an API key with the following role:
  • Checkout webservice role. This role is assigned by default when the API key is created.
The credential also needs to have a client key. **

Create a client key

If you want to use an existing API credential that does not have a client key yet, create a client key as follows:
  1. Log in to your Customer Area.
  2. Go to Developers > API credentials, and select the credential username for your integration, for example ws@Company.****[YourCompanyAccount].
  3. Under Client settings > Authentication select the Client key tab.
  4. Select Generate client key.
  5. Select Save changes. The client key is part of the setup but is not used later on. Therefore, you do not need to specify allowed origins, and you do not need to save the client key in your system.

Implement the request

To establish a communication session:
  1. From your backend, make a POST request to the applicable test or regional /auth/certificate endpoint, specifying: The subMerchantData object includes the following parameters:
If you are not a registered payment facilitator, the /auth/certificate request to establish a communication session must include the store parameter, unless your account structure does not have stores and instead uses merchant accounts as stores.If previously you have used /checkout/possdk/v68/session test and live endpoints, we recommend you migrate to new endpoints./auth/certificate request with store to process payments for