Sample project to try out iOS Drop-in and Components integrations.
The demo app uses .xcconfig files for secret management and environment configuration.
To set up your local environment:
-
Create environment-specific configuration files in the
Demofolder (these files are git-ignored) by copyingDemo/Secrets.template.xcconfig:Secrets.test.xcconfig– For the test environmentSecrets.beta.xcconfig– For the beta environmentSecrets.live.xcconfig– For the live environment
⚠️ IMPORTANT: Copy these files using Finder or terminal commands likecp. Do not copy them using Xcode's "Add Files" or drag-and-drop, as this will add project references to files that do not exist in CI environments. -
Fill in the configuration values in each file:
Variable Name Description MERCHANT_CLIENT_KEYYour Adyen client key. How to obtain it → MERCHANT_SERVER_HOSTYour backend server address (e.g., your-server.comorcheckout-test.adyen.com/{VERSION}), without thehttps://scheme.MERCHANT_ACCOUNTYour Adyen merchant account identifier. ADYEN_SERVER_API_KEYAPI key used only when connecting directly to Adyen for testing. Leave empty when using your own backend. APPLE_TEAM_IDENTIFIERYour Apple Developer Team Identifier. APPLE_PAY_MERCHANT_IDENTIFIERYour Apple Pay merchant identifier. -
Update the
Secrets.xcconfigfile to import your chosen environment:
#include? "Secrets.test.xcconfig" // or .beta.xcconfig / .live.xcconfig
For security reasons, your backend server should act as a proxy between the demo app and the Adyen Checkout API. Your server should expose the required endpoints:
Sessions flow:
/sessions
Advanced flow:
/paymentMethods/payments/payments/details
🔒 Security Note: Your API key must be handled only on your backend. Never embed it in your client app.
If you do not have your own server, you may configure the demo app to call the Adyen Checkout API directly for testing purposes only. This is not allowed for production because it exposes your API key.
To enable direct API usage, set the following in your Secrets.test.xcconfig:
MERCHANT_SERVER_HOST = checkout-test.adyen.com/{VERSION}
ADYEN_SERVER_API_KEY = <YOUR_API_KEY>
You can find the latest API version here: https://docs.adyen.com/api-explorer/Checkout/latest/overview
Note:
MERCHANT_CLIENT_KEYandMERCHANT_ACCOUNTare still required. You should always switch to your own backend before integrating in a real app.
The Common/ folder contains all basic code necessary to handle UI, Adyen checkout's state, and network calls.
Common/IntegrationExamples/Session/DropIn/DropInExample.swift
Example setup for Drop-in integration with UI customization and component configurations.
Located in Common/IntegrationExamples/Session/Components/:
CardComponentExample.swift– Card paymentsApplePayComponentExample.swift– Apple Pay integrationInstantPaymentComponentExample.swift– Instant payment methodsIssuerListComponentExample.swift– Issuer list payments
Common/IntegrationExamples/AdvancedFlow/DropIn/DropInAdvancedFlowExample.swift
Example setup for:
- Advanced Drop-in integration
- Partial payment integration (gift card flow)
Located in Common/IntegrationExamples/AdvancedFlow/Components/:
CardComponentAdvancedFlowExample.swiftApplePayComponentAdvancedFlowExample.swiftInstantPaymentComponentAdvancedFlowExample.swiftIssuerListComponentAdvancedFlowExample.swift
Basic UI for UIKit integration.
Run the demo: Select AdyenUIHost as the target in Xcode.
Basic UI for SwiftUI integration.
Run the demo: Select AdyenSwiftUIHost as the target in Xcode.
