Integrate our Checkout iOS SDK with your own UI.
Our Checkout SDK for iOS gives you the ability to take advantage of the SDK's payment flow, including the communication between the SDK and Adyen, yet still collect and present information using your own UI. There are additional functions that you need to implement to do this, which we explain below.
This guide expects you to have followed the Checkout iOS SDK integration guide. The integration steps are similar, but when you build your own UI integration, you'll need to use the
PaymentController, not the
CheckoutController referred to in the guide.
To start the payment, initiate and start a
Create payment session
The steps for generating a
paymentSession value with the client side
/paymentSession API call are identical to those described in the integration guide. Instead, you'll need to implement them against the
Present payment methods
PaymentControllerDelegate will call the
selectPaymentMethod method to provide a list of available payment methods. You will need to provide your own UI to collect the shopper's chosen payment method and any required details.
paymentMethods object has two properties:
preferred: contains an array of one-click enabled payment methods, that the shopper has used previously.
other: contains an array of all other payment methods.
Display a list of payment methods to the shopper. We recommend presenting the
preferred methods at the top of the list. Then, collect their chosen payment method by passing the corresponding payment method object from
Collect payment details
For most payment methods, you'll need to collect additional details from the shopper. You can find a list of these inside the
details array in the
PaymentMethod. Once you've collected these details from the shopper, provide the values back in the
details object of the
paymentMethod. Then, pass this to the SDK via the
The example below shows how you'd collect the payment method details for a SEPA Direct Debit payment.
For many local payment methods, such as iDEAL or SOFORT, or card payments with 3D Secure, you'll need to redirect the shopper to a webpage or app to verify the payment. In this case, the
redirect method from
PaymentControllerDelegate is invoked.
Load the URL for the shopper with, for example, the
When the shopper has completed verification, handle their return to your app by implementing the following in your
Handle payment result
After the payment has been processed, get the result by implementing the
didFinish method of the
PaymentControllerDelegate protocol. Present this to the shopper in your app. You'll also receive a
payload. Use this to verify the outcome of the payment with your server.
Set up notifications
Receive confirmation when a payment is authorised or fails.
Add payment methods
Learn about payment methods and how to integrate them.
Find out how to cancel, refund, or capture a payment using our API.