{"title":"Upgrade to Adyen Android v5","category":"default","creationDate":1682951100,"content":"<p>If your integration uses Android v4.13.3 and earlier, 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=70\">Checkout API v70<\/a>.<\/p>\n<h2 id=\"upgrade-dependencies\">Step 1: Upgrade versions of build configuration and dependencies<\/h2>\n<p>Build configuration: <a href=\"https:\/\/developer.android.com\/about\/versions\/11\/setup-sdk#update-build\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\"><code>compileSdkVersion<\/code> and <code>targetSdkVersion<\/code><\/a>: <strong>34<\/strong>.<br \/>\nDependencies:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Name<\/th>\n<th style=\"text-align: right;\">Version<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/github.com\/Adyen\/adyen-3ds2-android\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Adyen 3DS2<\/a><\/td>\n<td style=\"text-align: right;\"><strong>2.2.15<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.android.com\/build\/releases\/gradle-plugin\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Android Gradle plugin<\/a><\/td>\n<td style=\"text-align: right;\"><strong>8.1.1<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.android.com\/jetpack\/androidx\/releases\/appcompat\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Appcompat<\/a><\/td>\n<td style=\"text-align: right;\"><strong>1.6.1<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.android.com\/jetpack\/androidx\/releases\/browser\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">AndroidX Browser<\/a><\/td>\n<td style=\"text-align: right;\"><strong>1.6.0<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.android.com\/jetpack\/compose\/bom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">AndroidX Compose Bill of Materials (BOM)<\/a><\/td>\n<td style=\"text-align: right;\"><strong>2023.09.00<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.android.com\/jetpack\/androidx\/releases\/compose-compiler\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">AndroidX Compose compiler<\/a><\/td>\n<td style=\"text-align: right;\"><strong>1.5.3<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.android.com\/jetpack\/androidx\/releases\/fragment\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">AndroidX Fragment<\/a><\/td>\n<td style=\"text-align: right;\"><strong>1.6.1<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.android.com\/jetpack\/androidx\/releases\/lifecycle\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">AndroidX Lifecycle<\/a><\/td>\n<td style=\"text-align: right;\"><strong>2.5.1<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.android.com\/jetpack\/androidx\/releases\/recyclerview\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">AndroidX Recyclerview<\/a><\/td>\n<td style=\"text-align: right;\"><strong>1.3.1<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.android.com\/jetpack\/androidx\/releases\/constraintlayout\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">AndroidX Constraintlayout<\/a><\/td>\n<td style=\"text-align: right;\"><strong>2.1.4<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/github.com\/cashapp\/cash-app-pay-android-sdk\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Cash App Pay<\/a><\/td>\n<td style=\"text-align: right;\"><strong>2.3.0<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developers.google.com\/pay\/api\/android\/support\/release-notes\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Google Pay<\/a><\/td>\n<td style=\"text-align: right;\"><strong>19.2.1<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/kotlinlang.org\/docs\/coroutines-overview.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Kotlin coroutines<\/a><\/td>\n<td style=\"text-align: right;\"><strong>1.6.4<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/plugins.gradle.org\/plugin\/org.jetbrains.kotlin.android\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Kotlin Gradle plugin<\/a><\/td>\n<td style=\"text-align: right;\"><strong>1.9.10<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/m2.material.io\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Material Design<\/a><\/td>\n<td style=\"text-align: right;\"><strong>1.9.0<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/pay.weixin.qq.com\/wechatpay_guide\/help_docs.shtml\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">WeChat Pay<\/a><\/td>\n<td style=\"text-align: right;\"><strong>6.8.0<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Step 2: Upgrade the configuration object<\/h2>\n<p>In your configuration object, you now must set the following properties:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Property<\/th>\n<th style=\"text-align: left;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>amount<\/code><\/td>\n<td style=\"text-align: left;\">If you want to show the amount on the <strong>Pay<\/strong> button.<\/td>\n<td style=\"text-align: left;\">The currency and value of the payment amount shown on the <strong>Pay<\/strong> button.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>shopperLocale<\/code><\/td>\n<td style=\"text-align: left;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The shopper's locale. To use the device's default locale, replace this with your context.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>environment<\/code><\/td>\n<td style=\"text-align: left;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Use <code>Environment.TEST<\/code> for testing. When going live, use one of our live environments.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>clientKey<\/code><\/td>\n<td style=\"text-align: left;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Your client key.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n<div id=\"tabLFZA1\">\n    <div data-component-wrapper=\"tabs\">\n        <tabs\n                        :items=\"[{&quot;title&quot;:&quot;Drop-in&quot;,&quot;content&quot;:&quot;\\n&lt;div class=\\&quot;notices green\\&quot;&gt;\\n&lt;p&gt;In v5.3.0, how you &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/advanced-flow\\\/?platform=Android&amp;amp;integration=Drop-in&amp;amp;version=5.3.0#configure\\&quot;&gt;configure Drop-in&lt;\\\/a&gt; changes.&lt;\\\/p&gt;\\n&lt;\\\/div&gt;\\n&lt;p&gt;For example:&lt;\\\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Configuring Drop-in&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=\\&quot;[{&amp;quot;language&amp;quot;:&amp;quot;java&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;\\\\\\\/\\\\\\\/ Create the amount object.\\\\nval amount = Amount(\\\\n  currency = \\\\&amp;quot;EUR\\\\&amp;quot;,\\\\n  value = 1000,\\\\n)\\\\n\\\\n\\\\\\\/\\\\\\\/ Create a configuration object.\\\\nval dropInConfiguration = DropInConfiguration.Builder(\\\\n  shopperLocale, \\\\\\\/\\\\\\\/ Use your context instead to use the device&#039;s default locale.\\\\n  environment,\\\\n  clientKey\\\\n)\\\\n\\\\n\\\\\\\/\\\\\\\/ Set the amount on the Drop-in.\\\\n  .setAmount(amount) \\\\\\\/\\\\\\\/ Optional to show the amount on the Pay button.\\\\n  .build()&amp;quot;}]\\&quot; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&quot;,&quot;altTitle&quot;:&quot;drop-in&quot;,&quot;oldTabId&quot;:&quot;configuring-drop-in_1&quot;,&quot;relation&quot;:&quot;drop-in&quot;},{&quot;title&quot;:&quot;Components&quot;,&quot;content&quot;:&quot;\\n&lt;div class=\\&quot;notices green\\&quot;&gt;\\n&lt;p&gt;In v5.3.0, how you &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/advanced-flow\\\/?platform=Android&amp;amp;integration=Components&amp;amp;version=5.3.0#configure\\&quot;&gt;configure Components&lt;\\\/a&gt; changes.&lt;\\\/p&gt;\\n&lt;\\\/div&gt;\\n&lt;p&gt;For example, to configure the card Component:&lt;\\\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Configuring the card Component&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=\\&quot;[{&amp;quot;language&amp;quot;:&amp;quot;java&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;\\\\\\\/\\\\\\\/ Create the amount object.\\\\nval amount = Amount(\\\\n  currency = \\\\&amp;quot;EUR\\\\&amp;quot;,\\\\n  value = 1000,\\\\n)\\\\n\\\\n\\\\\\\/\\\\\\\/ Create a configuration object.\\\\nval cardConfiguration = CardConfiguration.Builder(\\\\n  shopperLocale, \\\\\\\/\\\\\\\/ Use your context instead to use the device&#039;s default locale.\\\\n  environment,\\\\n  clientKey\\\\n)\\\\n\\\\\\\/\\\\\\\/ Set the amount in the configuration object.\\\\n  .setAmount(amount) \\\\\\\/\\\\\\\/ Optional to show the amount on the Pay button.\\\\n  .setHolderNameRequired(true) \\\\\\\/\\\\\\\/ Optional configuration property to show the cardholder name input field.\\\\n  .build()&amp;quot;}]\\&quot; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&quot;,&quot;altTitle&quot;:&quot;components&quot;,&quot;oldTabId&quot;:&quot;configuring-components_2&quot;,&quot;relation&quot;:&quot;components&quot;}]\"\n            :should-update-when-url-changes='true'>\n        <\/tabs>\n    <\/div>\n<\/div>\n\n<h2>Step 3: Upgrade methods<\/h2>\n\n<div id=\"tablRhmt\">\n    <div data-component-wrapper=\"tabs\">\n        <tabs\n                        :items=\"[{&quot;title&quot;:&quot;Drop-in&quot;,&quot;content&quot;:&quot;\\n&lt;p&gt;Remove methods from the &lt;strong&gt;v4.13.3&lt;\\\/strong&gt; column and replace them with the ones from the &lt;strong&gt;v5.0.0&lt;\\\/strong&gt; column:&lt;\\\/p&gt;\\n&lt;table&gt;\\n&lt;thead&gt;\\n&lt;tr&gt;\\n&lt;th style=\\&quot;text-align: left;\\&quot;&gt;v4.13.3 or earlier&lt;\\\/th&gt;\\n&lt;th style=\\&quot;text-align: left;\\&quot;&gt;v5.0.0&lt;\\\/th&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/thead&gt;\\n&lt;tbody&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;makePaymentsCall&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;onSubmit&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;makeDetailsCall&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;onAdditionalDetails&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;onActivityResult&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;Not applicable.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/tbody&gt;\\n&lt;\\\/table&gt;\\n&quot;,&quot;altTitle&quot;:&quot;drop-in&quot;,&quot;oldTabId&quot;:&quot;methods-drop-in_1&quot;,&quot;relation&quot;:&quot;drop-in&quot;},{&quot;title&quot;:&quot;Components&quot;,&quot;content&quot;:&quot;\\n&lt;ol&gt;\\n&lt;li&gt;\\n&lt;p&gt;Remove the following methods. They can no longer be used.&lt;\\\/p&gt;\\n&lt;ul&gt;\\n&lt;li&gt;&lt;code&gt;observe&lt;\\\/code&gt;&lt;\\\/li&gt;\\n&lt;li&gt;&lt;code&gt;removeObserver&lt;\\\/code&gt;&lt;\\\/li&gt;\\n&lt;li&gt;&lt;code&gt;removeObservers&lt;\\\/code&gt;&lt;\\\/li&gt;\\n&lt;\\\/ul&gt;\\n&lt;\\\/li&gt;\\n&lt;li&gt;\\n&lt;p&gt;You must now implement a callback interface that you pass to the provider. Implement methods in &lt;code&gt;ComponentCallback&lt;\\\/code&gt; to pass data between your frontend app and your backend server.&lt;\\\/p&gt;\\n&lt;table&gt;\\n&lt;thead&gt;\\n&lt;tr&gt;\\n&lt;th style=\\&quot;text-align: left;\\&quot;&gt;Method&lt;\\\/th&gt;\\n&lt;th style=\\&quot;text-align: left;\\&quot;&gt;Description&lt;\\\/th&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/thead&gt;\\n&lt;tbody&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;onSubmit&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;Make a  &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;\\\/payments&lt;\\\/a&gt; request.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;onAdditionalDetails&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;Make a  &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments\\\/details\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;\\\/payments\\\/details&lt;\\\/a&gt; request.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;onError&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;Handle an error if the Component encounters it.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/tbody&gt;\\n&lt;\\\/table&gt;\\n&lt;p&gt;For example, for the card Component:&lt;\\\/p&gt;\\n&lt;\\\/li&gt;\\n&lt;\\\/ol&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Implement methods for the card Component&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;java\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;\\\\\\\/\\\\\\\/ Handler to make a \\\\\\\/payments request.\\\\noverride fun onSubmit(state: CardComponentState) {\\\\n  val paymentComponentJson = PaymentComponentData.SERIALIZER.serialize(state.data)\\\\n  \\\\\\\/\\\\\\\/ Your server makes \\\\\\\/payments request, including paymentComponentJson.\\\\n\\\\n  \\\\\\\/\\\\\\\/ If additional action is required, handle the action.\\\\n  val action = Action.SERIALIZER.deserialize(actionJSONObject)\\\\n  cardComponent.handleAction(action, activity)\\\\n}\\\\n\\\\n\\\\\\\/\\\\\\\/ Handler to make a \\\\\\\/payments\\\\\\\/details request to send additional payment details.\\\\noverride fun onAdditionalDetails(actionComponentData: ActionComponentData) {\\\\n  val actionComponentJson = ActionComponentData.SERIALIZER.serialize(actionComponentData)\\\\n  \\\\\\\/\\\\\\\/ Your server makes a \\\\\\\/payments\\\\\\\/details request, including actionComponentJson.\\\\n}\\\\n\\\\n\\\\\\\/\\\\\\\/ The Component encounters an error.\\\\noverride fun onError(componentError: ComponentError) {\\\\n \\\\t\\\\\\\/\\\\\\\/ Handle the error.\\\\n}\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&lt;h3&gt;Upgrade the view&lt;\\\/h3&gt;\\n&lt;p&gt;You must now use &lt;code&gt;AdyenComponentView&lt;\\\/code&gt; with all Components. You can no longer use an individual view for each Component. Add &lt;code&gt;AdyenComponentView&lt;\\\/code&gt; to your layout &lt;code&gt;.xml&lt;\\\/code&gt; file.&lt;\\\/p&gt;\\n&lt;p&gt;For example:&lt;\\\/p&gt;\\n&lt;pre&gt;&lt;code class=\\&quot;language-xml\\&quot;&gt;&amp;lt;com.adyen.checkout.ui.core.AdyenComponentView\\n   android:id=\\&quot;@+id\\\/YOUR_COMPONENT_VIEW_ID\\&quot;\\n   ...\\\/&amp;gt;&lt;\\\/code&gt;&lt;\\\/pre&gt;\\n&quot;,&quot;altTitle&quot;:&quot;components&quot;,&quot;oldTabId&quot;:&quot;methods-components_2&quot;,&quot;relation&quot;:&quot;components&quot;}]\"\n            :should-update-when-url-changes='true'>\n        <\/tabs>\n    <\/div>\n<\/div>\n\n<h2>Step 4: Upgrade launching<\/h2>\n\n<div id=\"tabZvRfo\">\n    <div data-component-wrapper=\"tabs\">\n        <tabs\n                        :items=\"[{&quot;title&quot;:&quot;Drop-in&quot;,&quot;content&quot;:&quot;\\n&lt;div class=\\&quot;notices green\\&quot;&gt;\\n&lt;p&gt;In v5.3.0, how you &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/advanced-flow\\\/?platform=Android&amp;amp;integration=Drop-in&amp;amp;version=5.3.0#launch-and-show\\&quot;&gt;launch Drop-in&lt;\\\/a&gt; changes.&lt;\\\/p&gt;\\n&lt;\\\/div&gt;\\n&lt;p&gt;When you launch Drop-in calling &lt;code&gt;DropIn.startPayment&lt;\\\/code&gt;, you must now pass:&lt;\\\/p&gt;\\n&lt;table&gt;\\n&lt;thead&gt;\\n&lt;tr&gt;\\n&lt;th style=\\&quot;text-align: left;\\&quot;&gt;Parameter&lt;\\\/th&gt;\\n&lt;th style=\\&quot;text-align: left;\\&quot;&gt;Description&lt;\\\/th&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/thead&gt;\\n&lt;tbody&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;context&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;Your context.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;dropInLauncher&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;The Drop-in launcher you declared in your &lt;code&gt;Activity&lt;\\\/code&gt; or &lt;code&gt;Fragment&lt;\\\/code&gt;.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;paymentMethodsApiResponse&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;The  &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/paymentMethods\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;\\\/paymentMethods&lt;\\\/a&gt; response that you deserialized.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;dropInConfiguration&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;The Drop-in configuration that you created.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;YourDropInService::class.java&lt;\\\/code&gt; (Example)&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;The &lt;code&gt;DropInService&lt;\\\/code&gt; that you created.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/tbody&gt;\\n&lt;\\\/table&gt;\\n&lt;p&gt;You can no longer launch Drop-in with a result intent.&lt;\\\/p&gt;\\n&lt;p&gt;For example:&lt;\\\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Launch Drop-in in v5.0.0&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;java\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;DropIn.startPayment(\\\\n    context,\\\\n    dropInLauncher,\\\\n    paymentMethodsApiResponse,\\\\n    dropInConfiguration,\\\\n    YourDropInService::class.java\\\\n)\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&quot;,&quot;altTitle&quot;:&quot;drop-in&quot;,&quot;oldTabId&quot;:&quot;drop-in-launch_1&quot;,&quot;relation&quot;:&quot;drop-in&quot;},{&quot;title&quot;:&quot;Components&quot;,&quot;content&quot;:&quot;\\n&lt;div class=\\&quot;notices green\\&quot;&gt;\\n&lt;p&gt;In v5.3.0, how you &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/advanced-flow\\\/?platform=Android&amp;amp;integration=Components-in&amp;amp;version=5.3.0#launch-and-show\\&quot;&gt;launch Components&lt;\\\/a&gt; changes.&lt;\\\/p&gt;\\n&lt;\\\/div&gt;\\n&lt;p&gt;When you launch the Component calling &lt;code&gt;PROVIDER.get&lt;\\\/code&gt;, you must now pass:&lt;\\\/p&gt;\\n&lt;table&gt;\\n&lt;thead&gt;\\n&lt;tr&gt;\\n&lt;th style=\\&quot;text-align: left;\\&quot;&gt;Parameter&lt;\\\/th&gt;\\n&lt;th style=\\&quot;text-align: left;\\&quot;&gt;Description&lt;\\\/th&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/thead&gt;\\n&lt;tbody&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;activity&lt;\\\/code&gt; or &lt;code&gt;fragment&lt;\\\/code&gt; (Example)&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;Your &lt;code&gt;Activity&lt;\\\/code&gt; or &lt;code&gt;Fragment&lt;\\\/code&gt;.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;paymentMethod&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;The payment method from your  &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/paymentMethods\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;\\\/paymentMethods&lt;\\\/a&gt; response.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;cardConfiguration&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;The card configuration that you created.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;code&gt;componentCallback&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;The callback for the functions you implemented.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/tbody&gt;\\n&lt;\\\/table&gt;\\n&lt;p&gt;For example:&lt;\\\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Launch the Component in v5.0.0&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;java\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;\\\\\\\/\\\\\\\/ Create the payment method object from the \\\\\\\/paymentMethods response.\\\\nval paymentMethod = paymentMethodsApiResponse?.paymentMethods.orEmpty().firstOrNull {\\\\n    it.type == PaymentMethodTypes.SCHEME\\\\n}\\\\n\\\\nval cardComponent = CardComponent.PROVIDER.get(\\\\n    activity, \\\\\\\/\\\\\\\/ Your activity or fragment.\\\\n    paymentMethod,\\\\n    cardConfiguration,\\\\n    componentCallback,\\\\n)\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&quot;,&quot;altTitle&quot;:&quot;components&quot;,&quot;oldTabId&quot;:&quot;components-launch_2&quot;,&quot;relation&quot;:&quot;components&quot;}]\"\n            :should-update-when-url-changes='true'>\n        <\/tabs>\n    <\/div>\n<\/div>\n\n<h2>Step 5: Fix broken imports<\/h2>\n<p>Some classes are moved in this version. For most classes, the names haven't changed and you only have to re-import them. When importing the classes marked with a name change in the <a href=\"\/pt\/online-payments\/release-notes\">release notes<\/a>, you must update import statements.<\/p>\n<p>Public classes and functions that should not be directly used are marked as internal in this version. If you get a <a href=\"https:\/\/googlesamples.github.io\/android-custom-lint-rules\/checks\/RestrictedApi.md.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Restricted API<\/a> lint error on a class or function, this means it is internal and must not be used.<br \/>\nIf you believe the error you received is incorrect, report it by <a href=\"https:\/\/github.com\/Adyen\/adyen-android\/issues\/new\/choose\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">opening an issue on our GitHub repo<\/a>.<\/p>\n<h2>Step 6 (optional): Upgrade your action handling implementation<\/h2>\n<p>For Components integrations:<\/p>\n<p>In this version, the payment method Components can handle the required actions. For example the card Component can handle the <strong>redirect<\/strong> and <strong>threeDS2<\/strong> actions. You do not need to implement the <code>RedirectComponent<\/code> or the <code>Adyen3DS2Component<\/code> to handle redirects or 3D Secure authentication for cards.<\/p>\n<p>If you want to handle actions on a different page than the checkout one, you can use the <code>GenericActionComponent<\/code> instead.<\/p>","url":"https:\/\/docs.adyen.com\/pt\/online-payments\/upgrade-your-integration\/upgrade-to-android-5-0-0","articleFields":{"description":"Find out more about the breaking changes in this release.","feedback_component":true,"filters_component":false,"last_edit_on":"30-11-2023 12:37","page_id":"af92a2d3-0b36-45f1-b5c5-89186714a2ba"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/online-payments\/upgrade-your-integration\/upgrade-to-android-5-0-0","title":"Upgrade to Adyen Android v5","content":"If your integration uses Android v4.13.3 and earlier, 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 v70.\nStep 1: Upgrade versions of build configuration and dependencies\nBuild configuration: compileSdkVersion and targetSdkVersion: 34.\nDependencies:\n\n\n\nName\nVersion\n\n\n\n\nAdyen 3DS2\n2.2.15\n\n\nAndroid Gradle plugin\n8.1.1\n\n\nAppcompat\n1.6.1\n\n\nAndroidX Browser\n1.6.0\n\n\nAndroidX Compose Bill of Materials (BOM)\n2023.09.00\n\n\nAndroidX Compose compiler\n1.5.3\n\n\nAndroidX Fragment\n1.6.1\n\n\nAndroidX Lifecycle\n2.5.1\n\n\nAndroidX Recyclerview\n1.3.1\n\n\nAndroidX Constraintlayout\n2.1.4\n\n\nCash App Pay\n2.3.0\n\n\nGoogle Pay\n19.2.1\n\n\nKotlin coroutines\n1.6.4\n\n\nKotlin Gradle plugin\n1.9.10\n\n\nMaterial Design\n1.9.0\n\n\nWeChat Pay\n6.8.0\n\n\n\nStep 2: Upgrade the configuration object\nIn your configuration object, you now must set the following properties:\n\n\n\nProperty\nRequired\nDescription\n\n\n\n\namount\nIf you want to show the amount on the Pay button.\nThe currency and value of the payment amount shown on the Pay button.\n\n\nshopperLocale\n\nThe shopper's locale. To use the device's default locale, replace this with your context.\n\n\nenvironment\n\nUse Environment.TEST for testing. When going live, use one of our live environments.\n\n\nclientKey\n\nYour client key.\n\n\n\n\n\n    \n        \n        \n    \n\n\nStep 3: Upgrade methods\n\n\n    \n        \n        \n    \n\n\nStep 4: Upgrade launching\n\n\n    \n        \n        \n    \n\n\nStep 5: Fix broken imports\nSome classes are moved in this version. For most classes, the names haven't changed and you only have to re-import them. When importing the classes marked with a name change in the release notes, you must update import statements.\nPublic classes and functions that should not be directly used are marked as internal in this version. If you get a Restricted API lint error on a class or function, this means it is internal and must not be used.\nIf you believe the error you received is incorrect, report it by opening an issue on our GitHub repo.\nStep 6 (optional): Upgrade your action handling implementation\nFor Components integrations:\nIn this version, the payment method Components can handle the required actions. For example the card Component can handle the redirect and threeDS2 actions. You do not need to implement the RedirectComponent or the Adyen3DS2Component to handle redirects or 3D Secure authentication for cards.\nIf you want to handle actions on a different page than the checkout one, you can use the GenericActionComponent instead.","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Online payments","lvl2":"Upgrade your integration","lvl3":"Upgrade to Adyen Android 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-android-5-0-0"},"levels":4,"category":"Online Payments","category_color":"green","tags":["Upgrade","Adyen","Android"]}}
