Checkout icon

Migrate to Adyen iOS v5

Find out more about the major changes in this release.

If your integration uses iOS v4.10.1 or before and you are upgrading it to use v5.0.0, make the following changes to your integration.

Checkout API version

We recommend using Checkout API v69.

Step 1: Update methods

Change the methods in your integration from the ones in the v4.10.1 or earlier column to the ones in v5.0.0 column:

v4.10.1 or earlier v5.0.0
didFinalize(with success: Bool) didFinalize(with success: Bool, completion: (() -> Void)?)
finalizeIfNeeded(with success: Bool, completion: (() -> Void)?) finalizeIfNeeded(with success: Bool, completion: (() -> Void)?)
didOpenExternalApplication(_ component: didOpenExternalApplication(component:
requestOrder(_ component: Component, completion: @escaping (Result<PartialPaymentOrder, Error>) -> Void) requestOrder(for component: Component, completion: @escaping (Result<PartialPaymentOrder, Error>) -> Void)
cancelOrder(_ order: PartialPaymentOrder) cancelOrder(_ order: PartialPaymentOrder, component: Component)

Step 2: Update initializing Drop-in and Components

When initializing Drop-in or a Component, you must now pass an instance of AdyenContext. For example:

// Create the APIContext with the client key and environment.
let apiContext = APIContext(clientKey: clientKey, environment: Environment.test)

// Create the AdyenContext with the instance of APIContext and analytics configuration.
let adyenContext = AdyenContext(apiContext: apiContext, analyticsConfiguration: analyticsConfiguration)

// Set the instance of AdyenContext in the Drop-in configuration.
let configuration = DropInComponent.Configuration(context: adyenContext)

Step 3: Update Components configuration

The configuration for a Component is now in a configuration object that corresponds to the Component type. For example, to style the Redirect Component:

// The configuration object for the Redirect Component.
var redirectComponentConfiguration = RedirectComponent.Configuration()
// Configuration for the Redirect Component.
redirectComponentConfiguration.style = //Your styling.

Step 4: Update payment methods configuration

The configuration for a payment method is now in a configuration object that corresponds to the payment method component. For example, to configure the Card Component:

// The configuration object for the Card Component.
var cardComponentConfiguration = CardComponent.Configuration()
// Configuration for the Card Component.
cardComponentConfiguration.showsStorePaymentMethodField = true
cardComponentConfiguration.localization = // Your localization configuration.

In v5.9.0, iDEAL uses InstantPaymentComponent.

Apple Pay

For ApplePayComponent.Configuration.init() , the only parameters you can pass are merchantIdentifier and payment. All other Apple Pay configuration properties are now mutable.

Change the value of the payment property from the one in the v4.10.1 or earlier column to the one in v5.0.0 column::

v4.10.1 or earlier v5.0.0
payment: Payment payment: ApplePayPayment

Cards

The value for each of the following properties is now a strongly typed array of values from the CardType enum:

  • CardPaymentMethod.brands
  • StoredCardPaymentMethod.brands
  • StoredCardPaymentMethod.brand

Step 5: (Optional) Update Drop-in configuration

You must do this if your integration is a Drop-in integration.

The configuration for Drop-in is now in a DropInComponent.Configuration() object. For example:

// The Drop-in configuration object.
let dropInConfiguration = DropInComponent.Configuration(adyenContext: adyenContext)
// Optional configuration to disable showing the preselected stored payment method.
dropInConfiguration.allowsSkippingPaymentList = true