{"title":"Upgrade to iOS Components 4.0.0","category":"default","creationDate":1795889610,"content":"<p>To be able to use iOS Components 4.0.0, make sure your integration supports the changes described on this page.<\/p>\n<h2>Checkout API version<\/h2>\n<p>iOS Components 4.0.0 is intended to be backwards compatible with all Checkout API versions, but we recommend you use Checkout API v67 or later.<\/p>\n<h2 id=\"new-module-structure\">New module structure<\/h2>\n<p>iOS Components 4.0.0 have a more granular module structure, which allows you to selectively import the functionality you need.<\/p>\n<table>\n<thead>\n<tr>\n<th>Module<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>AdyenDropIn<\/code><\/td>\n<td>The <code>DropInComponent<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><code>AdyenCard<\/code><\/td>\n<td>Components related to card payments, for example <code>CardComponent<\/code>, <code>StoredCardComponent<\/code>, or <code>BCMCComponent<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><code>AdyenComponents<\/code><\/td>\n<td>All other payment method components, for example <code>QiwiWalletComponent<\/code>, <code>MBWayComponent<\/code>, <code>ApplePayComponent<\/code>, <code>BLIKComponent<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><code>AdyenWeChatPay<\/code><\/td>\n<td>The WeChat Pay component which you must import separately.<\/td>\n<\/tr>\n<tr>\n<td><code>AdyenActions<\/code><\/td>\n<td>All action components, for example <code>AwaitComponent<\/code>, <code>VoucherComponent<\/code>, <code>RedirectComponent<\/code>, or <code>AdyenActionComponent<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><code>AdyenEncryption<\/code><\/td>\n<td>The encryption helpers.<\/td>\n<\/tr>\n<tr>\n<td><code>AdyenSwiftUI<\/code><\/td>\n<td>Integration helpers for SwiftUI, for example <code>ViewControllerPresenter<\/code> or <code>ViewModifier<\/code>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The README file on Github has more details about <a href=\"https:\/\/github.com\/Adyen\/adyen-ios#installation\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">importing the modules<\/a> using CocoaPods, Carthage, and Swift Package Manager.<\/p>\n<h2 id=\"remove-deprecated\">Removed deprecated elements<\/h2>\n<table>\n<thead>\n<tr>\n<th>Removed<\/th>\n<th>Use instead<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>FormHeaderItem<\/code><\/td>\n<td><code>FormTextItem<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>showLargeTitle<\/code> property on all components<\/td>\n<td>Custom wrapping <code>ViewController<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>FormFooterItem<\/code><\/td>\n<td><code>FormTextItem<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>CardTypeDetector<\/code><\/td>\n<td><code>Array&lt;CardType&gt;.type(forCardNumber cardNumber: String)<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>cornerRadius<\/code> property from styles<\/td>\n<td><code>cornerRounding<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>publicKey<\/code> parameter from <code>CardComponent<\/code> constructor<\/td>\n<td>Constructor with the <code>clientKey<\/code> parameter.<\/td>\n<\/tr>\n<tr>\n<td><code>barBackgroundColor<\/code> properties from <code>NavigationStyle<\/code><\/td>\n<td><code>backgroundColor<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>barTintColor<\/code> properties from <code>NavigationStyle<\/code><\/td>\n<td><code>tintColor<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>mainButton<\/code> properties from <code>FormComponentStyle<\/code><\/td>\n<td><code>mainButtonItem<\/code><\/td>\n<\/tr>\n<tr>\n<td>and <code>secondaryButton<\/code> properties from <code>FormComponentStyle<\/code><\/td>\n<td><code>secondaryButtonItem<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>dictionaryRepresentation<\/code> method from <code>Details<\/code><\/td>\n<td><code>Encodable<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"component-initialization\">Component initialization<\/h2>\n<p>When initializing a component, you must create an instance of <a href=\"https:\/\/adyen.github.io\/adyen-ios\/5.0.0\/documentation\/adyen\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>APIContext<\/code>\n<\/a>:<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter name<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>clientKey<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>Your <a href=\"\/development-resources\/client-side-authentication\">client key<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><code>environment<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>Use <span translate=\"no\"><strong>test<\/strong><\/span>. When you are ready to accept live payments, change the value to one of our <a href=\"https:\/\/adyen.github.io\/adyen-ios\/5.0.0\/documentation\/adyen\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">live environments<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-swift\">  \/\/ When you are ready to go live, change environment to Environment.live\n  \/\/ or to other environment values described in https:\/\/adyen.github.io\/adyen-ios\/5.0.0\/documentation\/adyen\/\n  let apiContext = APIContext(environment: Environment.test, clientKey: clientKey)<\/code><\/pre>\n<p>Starting iOS Components 4.0.0, the client key is the only way to do client-side authentication. If you haven't already, <a href=\"\/development-resources\/client-side-authentication\/migrate-from-origin-key-to-client-key?tab=i_os_2\">switch to using the client key<\/a> for your integration.<\/p>\n<h2 id=\"payment-method-configuration\">Payment method configuration<\/h2>\n<p>Renamed the payment method configuration objects:<\/p>\n<table>\n<thead>\n<tr>\n<th>Old name<\/th>\n<th>New name<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>PaymentMethodsConfiguration<\/code><\/td>\n<td><code>DropInComponent.Configuration<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>CardConfiguration<\/code><\/td>\n<td><code>CardComponent.Configuration<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>ApplePayConfiguration<\/code><\/td>\n<td><code>ApplePayComponent.Configuration<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"end-of-component-flow\">Handling the end of a component flow<\/h2>\n<p>In previous versions, <code>stopLoading(success:completion:)<\/code> used to be called at the end of any component flow. Starting 4.0.0, <code>stopLoading(success:completion:)<\/code> is removed and replaced with two functions to handle different situations:<\/p>\n<table>\n<thead>\n<tr>\n<th>Function<\/th>\n<th>Situation<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>finalizeIfNeeded(success:)<\/code><\/td>\n<td><li> The shopper completes the component flow successfully.<\/li> <li> There is an error during the component flow. <\/li><\/td>\n<\/tr>\n<tr>\n<td><code>cancelIfNeeded()<\/code><\/td>\n<td><li> The shopper cancels before the component flow is completed. <\/li><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"apple-pay-supported-card-networks\">Apple Pay supported card networks<\/h2>\n<p>We removed <code>excludedCardNetworks<\/code>.<\/p>\n<p>To get the list of card networks for Apple Pay, iOS Components now uses the <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#responses-200-paymentMethods-brands\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\n  <code>brands<\/code>\n<\/a> array in the <code>\/paymentMethods<\/code> response.<\/p>\n<p>Make sure that you have <a href=\"\/payment-methods\/add-payment-methods\">added the card type in your Customer Area<\/a> to have it appear in the <code>\/paymentMethods<\/code> response.<\/p>","url":"https:\/\/docs.adyen.com\/online-payments\/upgrade-your-integration\/upgrade-to-ios-4-0-0","articleFields":{"description":"Find out more about the major changes in this release."},"algolia":{"url":"https:\/\/docs.adyen.com\/online-payments\/upgrade-your-integration\/upgrade-to-ios-4-0-0","title":"Upgrade to iOS Components 4.0.0","content":"To be able to use iOS Components 4.0.0, make sure your integration supports the changes described on this page.\nCheckout API version\niOS Components 4.0.0 is intended to be backwards compatible with all Checkout API versions, but we recommend you use Checkout API v67 or later.\nNew module structure\niOS Components 4.0.0 have a more granular module structure, which allows you to selectively import the functionality you need.\n\n\n\nModule\nDescription\n\n\n\n\nAdyenDropIn\nThe DropInComponent.\n\n\nAdyenCard\nComponents related to card payments, for example CardComponent, StoredCardComponent, or BCMCComponent.\n\n\nAdyenComponents\nAll other payment method components, for example QiwiWalletComponent, MBWayComponent, ApplePayComponent, BLIKComponent.\n\n\nAdyenWeChatPay\nThe WeChat Pay component which you must import separately.\n\n\nAdyenActions\nAll action components, for example AwaitComponent, VoucherComponent, RedirectComponent, or AdyenActionComponent.\n\n\nAdyenEncryption\nThe encryption helpers.\n\n\nAdyenSwiftUI\nIntegration helpers for SwiftUI, for example ViewControllerPresenter or ViewModifier.\n\n\n\nThe README file on Github has more details about importing the modules using CocoaPods, Carthage, and Swift Package Manager.\nRemoved deprecated elements\n\n\n\nRemoved\nUse instead\n\n\n\n\nFormHeaderItem\nFormTextItem\n\n\nshowLargeTitle property on all components\nCustom wrapping ViewController\n\n\nFormFooterItem\nFormTextItem\n\n\nCardTypeDetector\nArray&lt;CardType&gt;.type(forCardNumber cardNumber: String)\n\n\ncornerRadius property from styles\ncornerRounding\n\n\npublicKey parameter from CardComponent constructor\nConstructor with the clientKey parameter.\n\n\nbarBackgroundColor properties from NavigationStyle\nbackgroundColor\n\n\nbarTintColor properties from NavigationStyle\ntintColor\n\n\nmainButton properties from FormComponentStyle\nmainButtonItem\n\n\nand secondaryButton properties from FormComponentStyle\nsecondaryButtonItem\n\n\ndictionaryRepresentation method from Details\nEncodable\n\n\n\nComponent initialization\nWhen initializing a component, you must create an instance of \n  APIContext\n:\n\n\n\nParameter name\nRequired\nDescription\n\n\n\n\nclientKey\n\nYour client key.\n\n\nenvironment\n\nUse test. When you are ready to accept live payments, change the value to one of our live environments.\n\n\n\n  \/\/ When you are ready to go live, change environment to Environment.live\n  \/\/ or to other environment values described in https:\/\/adyen.github.io\/adyen-ios\/5.0.0\/documentation\/adyen\/\n  let apiContext = APIContext(environment: Environment.test, clientKey: clientKey)\nStarting iOS Components 4.0.0, the client key is the only way to do client-side authentication. If you haven't already, switch to using the client key for your integration.\nPayment method configuration\nRenamed the payment method configuration objects:\n\n\n\nOld name\nNew name\n\n\n\n\nPaymentMethodsConfiguration\nDropInComponent.Configuration\n\n\nCardConfiguration\nCardComponent.Configuration\n\n\nApplePayConfiguration\nApplePayComponent.Configuration\n\n\n\nHandling the end of a component flow\nIn previous versions, stopLoading(success:completion:) used to be called at the end of any component flow. Starting 4.0.0, stopLoading(success:completion:) is removed and replaced with two functions to handle different situations:\n\n\n\nFunction\nSituation\n\n\n\n\nfinalizeIfNeeded(success:)\n The shopper completes the component flow successfully.  There is an error during the component flow. \n\n\ncancelIfNeeded()\n The shopper cancels before the component flow is completed. \n\n\n\nApple Pay supported card networks\nWe removed excludedCardNetworks.\nTo get the list of card networks for Apple Pay, iOS Components now uses the \n  brands\n array in the \/paymentMethods response.\nMake sure that you have added the card type in your Customer Area to have it appear in the \/paymentMethods response.","type":"page","locale":"en","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Online payments","lvl2":"Upgrade your integration","lvl3":"Upgrade to iOS Components 4.0.0"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/online-payments","lvl2":"https:\/\/docs.adyen.com\/online-payments\/upgrade-your-integration","lvl3":"\/online-payments\/upgrade-your-integration\/upgrade-to-ios-4-0-0"},"levels":4,"category":"Online Payments","category_color":"green","tags":["Upgrade","Components","4.0.0"]}}
