{"title":"Upgrade to Adyen iOS v5","category":"default","creationDate":1776961627,"content":"<p>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.<\/p>\n<h2>Checkout API version<\/h2>\n<p>We recommend using <a href=\"\/pt\/online-payments\/release-notes?integration_type=api&amp;version=69\">Checkout API v69<\/a>.<\/p>\n<h2>Step 1: Upgrade methods<\/h2>\n<p>Change the methods in your integration from the ones in the <strong>v4.10.1 or earlier<\/strong> column to the ones in <strong>v5.0.0<\/strong> column:<\/p>\n<table>\n<thead>\n<tr>\n<th>v4.10.1 or earlier<\/th>\n<th>v5.0.0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>didFinalize(with success: Bool)<\/code><\/td>\n<td><code>didFinalize(with success: Bool, completion: (() -&gt; Void)?)<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>finalizeIfNeeded(with success: Bool, completion: (() -&gt; Void)?)<\/code><\/td>\n<td><code>finalizeIfNeeded(with success: Bool, completion: (() -&gt; Void)?)<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>didOpenExternalApplication(_ component:<\/code><\/td>\n<td><code>didOpenExternalApplication(component:<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>requestOrder(_ component: Component, completion: @escaping (Result&lt;PartialPaymentOrder, Error&gt;) -&gt; Void)<\/code><\/td>\n<td><code>requestOrder(for component: Component, completion: @escaping (Result&lt;PartialPaymentOrder, Error&gt;) -&gt; Void)<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>cancelOrder(_ order: PartialPaymentOrder)<\/code><\/td>\n<td><code>cancelOrder(_ order: PartialPaymentOrder, component: Component)<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Step 2: Upgrade initializing Drop-in and Components<\/h2>\n<p>When initializing Drop-in or a Component, you must now pass an instance of <a href=\"https:\/\/adyen.github.io\/adyen-ios\/5.0.0\/documentation\/adyen\/adyencontext\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">AdyenContext<\/a>. For example:<\/p>\n<pre><code class=\"language-swift\">\/\/ Create the APIContext with the client key and environment.\nlet apiContext = APIContext(clientKey: clientKey, environment: Environment.test)\n\n\/\/ Create the AdyenContext with the instance of APIContext and analytics configuration.\nlet adyenContext = AdyenContext(apiContext: apiContext, analyticsConfiguration: analyticsConfiguration)\n\n\/\/ Set the instance of AdyenContext in the Drop-in configuration.\nlet configuration = DropInComponent.Configuration(context: adyenContext)<\/code><\/pre>\n<h2>Step 3: Update Components configuration<\/h2>\n<p>The configuration for a Component is now in a configuration object that corresponds to the <a href=\"https:\/\/github.com\/Adyen\/adyen-ios\/tree\/develop\/AdyenComponents\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Component<\/a> type. For example, to style the Redirect Component:<\/p>\n<pre><code class=\"language-swift\">\/\/ The configuration object for the Redirect Component.\nvar redirectComponentConfiguration = RedirectComponent.Configuration()\n\/\/ Configuration for the Redirect Component.\nredirectComponentConfiguration.style = \/\/Your styling.<\/code><\/pre>\n<h2>Step 4: Update payment methods configuration<\/h2>\n<p>The configuration for a payment method is now in a configuration object that corresponds to the <a href=\"https:\/\/github.com\/Adyen\/adyen-ios\/tree\/develop\/AdyenComponents\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">payment method component<\/a>. For example, to configure the Card Component:<\/p>\n<pre><code class=\"language-swift\">\/\/ The configuration object for the Card Component.\nvar cardComponentConfiguration = CardComponent.Configuration()\n\/\/ Configuration for the Card Component.\ncardComponentConfiguration.showsStorePaymentMethodField = true\ncardComponentConfiguration.localization = \/\/ Your localization configuration.<\/code><\/pre>\n<div class=\"notices green\">\n<p>In <a href=\"\/pt\/online-payments\/release-notes\/?title%5B0%5D=iOS%2BComponents%2FDrop-in&amp;version%5B0%5D=5.9.0\">v5.9.0<\/a>, iDEAL uses <code>InstantPaymentComponent<\/code>.<\/p>\n<\/div>\n<h3>Apple Pay<\/h3>\n<p>For <a href=\"https:\/\/adyen.github.io\/adyen-ios\/5.0.0\/documentation\/adyen\/applepaycomponent\/configuration\/init(payment:merchantidentifier:)\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>ApplePayComponent.Configuration.init()<\/code>\n<\/a>, the only parameters you can pass are <code>merchantIdentifier<\/code> and <code>payment<\/code>. All other Apple Pay configuration properties are now mutable.<\/p>\n<p>Change the value of the <code>payment<\/code> property from the one in the <strong>v4.10.1 or earlier<\/strong> column to the one in <strong>v5.0.0<\/strong> column::<\/p>\n<table>\n<thead>\n<tr>\n<th>v4.10.1 or earlier<\/th>\n<th>v5.0.0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>payment: Payment<\/code><\/td>\n<td><a href=\"https:\/\/adyen.github.io\/adyen-ios\/5.0.0\/documentation\/adyen\/applepaycomponent\/configuration\/applepaypayment\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>payment: ApplePayPayment<\/code>\n<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Cards<\/h3>\n<p>The value for each of the following properties is now a strongly typed array of values from the <a href=\"https:\/\/adyen.github.io\/adyen-ios\/5.0.0\/documentation\/adyen\/cardtype\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\"><code>CardType<\/code> enum<\/a>:<\/p>\n<ul>\n<li><code>CardPaymentMethod.brands<\/code><\/li>\n<li><code>StoredCardPaymentMethod.brands<\/code><\/li>\n<li><code>StoredCardPaymentMethod.brand<\/code><\/li>\n<\/ul>\n<h2>Step 5: (Optional) Update Drop-in configuration<\/h2>\n<p>You must do this if your integration is a Drop-in integration.<\/p>\n<p>The configuration for Drop-in is now in a <a href=\"https:\/\/adyen.github.io\/adyen-ios\/5.0.0\/documentation\/adyen\/dropincomponent\/configuration\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>DropInComponent.Configuration()<\/code>\n<\/a> object. For example:<\/p>\n<pre><code class=\"language-swift\">\/\/ The Drop-in configuration object.\nlet dropInConfiguration = DropInComponent.Configuration(adyenContext: adyenContext)\n\/\/ Optional configuration to disable showing the preselected stored payment method.\ndropInConfiguration.allowsSkippingPaymentList = true<\/code><\/pre>","url":"https:\/\/docs.adyen.com\/pt\/online-payments\/upgrade-your-integration\/upgrade-to-ios-5-0-0","articleFields":{"description":"Find out more about the major changes in this release.","feedback_component":true,"last_edit_on":"07-11-2022 09:40"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/online-payments\/upgrade-your-integration\/upgrade-to-ios-5-0-0","title":"Upgrade to Adyen iOS v5","content":"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.\nCheckout API version\nWe recommend using Checkout API v69.\nStep 1: Upgrade methods\nChange the methods in your integration from the ones in the v4.10.1 or earlier column to the ones in v5.0.0 column:\n\n\n\nv4.10.1 or earlier\nv5.0.0\n\n\n\n\ndidFinalize(with success: Bool)\ndidFinalize(with success: Bool, completion: (() -&gt; Void)?)\n\n\nfinalizeIfNeeded(with success: Bool, completion: (() -&gt; Void)?)\nfinalizeIfNeeded(with success: Bool, completion: (() -&gt; Void)?)\n\n\ndidOpenExternalApplication(_ component:\ndidOpenExternalApplication(component:\n\n\nrequestOrder(_ component: Component, completion: @escaping (Result&lt;PartialPaymentOrder, Error&gt;) -&gt; Void)\nrequestOrder(for component: Component, completion: @escaping (Result&lt;PartialPaymentOrder, Error&gt;) -&gt; Void)\n\n\ncancelOrder(_ order: PartialPaymentOrder)\ncancelOrder(_ order: PartialPaymentOrder, component: Component)\n\n\n\nStep 2: Upgrade initializing Drop-in and Components\nWhen initializing Drop-in or a Component, you must now pass an instance of AdyenContext. For example:\n\/\/ Create the APIContext with the client key and environment.\nlet apiContext = APIContext(clientKey: clientKey, environment: Environment.test)\n\n\/\/ Create the AdyenContext with the instance of APIContext and analytics configuration.\nlet adyenContext = AdyenContext(apiContext: apiContext, analyticsConfiguration: analyticsConfiguration)\n\n\/\/ Set the instance of AdyenContext in the Drop-in configuration.\nlet configuration = DropInComponent.Configuration(context: adyenContext)\nStep 3: Update Components configuration\nThe configuration for a Component is now in a configuration object that corresponds to the Component type. For example, to style the Redirect Component:\n\/\/ The configuration object for the Redirect Component.\nvar redirectComponentConfiguration = RedirectComponent.Configuration()\n\/\/ Configuration for the Redirect Component.\nredirectComponentConfiguration.style = \/\/Your styling.\nStep 4: Update payment methods configuration\nThe 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:\n\/\/ The configuration object for the Card Component.\nvar cardComponentConfiguration = CardComponent.Configuration()\n\/\/ Configuration for the Card Component.\ncardComponentConfiguration.showsStorePaymentMethodField = true\ncardComponentConfiguration.localization = \/\/ Your localization configuration.\n\nIn v5.9.0, iDEAL uses InstantPaymentComponent.\n\nApple Pay\nFor \n  ApplePayComponent.Configuration.init()\n, the only parameters you can pass are merchantIdentifier and payment. All other Apple Pay configuration properties are now mutable.\nChange 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::\n\n\n\nv4.10.1 or earlier\nv5.0.0\n\n\n\n\npayment: Payment\n\n  payment: ApplePayPayment\n\n\n\n\nCards\nThe value for each of the following properties is now a strongly typed array of values from the CardType enum:\n\nCardPaymentMethod.brands\nStoredCardPaymentMethod.brands\nStoredCardPaymentMethod.brand\n\nStep 5: (Optional) Update Drop-in configuration\nYou must do this if your integration is a Drop-in integration.\nThe configuration for Drop-in is now in a \n  DropInComponent.Configuration()\n object. For example:\n\/\/ The Drop-in configuration object.\nlet dropInConfiguration = DropInComponent.Configuration(adyenContext: adyenContext)\n\/\/ Optional configuration to disable showing the preselected stored payment method.\ndropInConfiguration.allowsSkippingPaymentList = true","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Online payments","lvl2":"Upgrade your integration","lvl3":"Upgrade to Adyen iOS v5"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/online-payments","lvl2":"https:\/\/docs.adyen.com\/pt\/online-payments\/upgrade-your-integration","lvl3":"\/pt\/online-payments\/upgrade-your-integration\/upgrade-to-ios-5-0-0"},"levels":4,"category":"Online Payments","category_color":"green","tags":["Upgrade","Adyen"]}}
