Checkout API version
We recommend using Checkout API v70.Step 1: Upgrade versions of build configuration and dependencies
Build configuration:compileSdkVersion and targetSdkVersion: 34.Dependencies:
| Name | Version |
|---|---|
| Adyen 3DS2 | 2.2.15 |
| Android Gradle plugin | 8.1.1 |
| Appcompat | 1.6.1 |
| AndroidX Browser | 1.6.0 |
| AndroidX Compose Bill of Materials (BOM) | 2023.09.00 |
| AndroidX Compose compiler | 1.5.3 |
| AndroidX Fragment | 1.6.1 |
| AndroidX Lifecycle | 2.5.1 |
| AndroidX Recyclerview | 1.3.1 |
| AndroidX Constraintlayout | 2.1.4 |
| Cash App Pay | 2.3.0 |
| Google Pay | 19.2.1 |
| Kotlin coroutines | 1.6.4 |
| Kotlin Gradle plugin | 1.9.10 |
| Material Design | 1.9.0 |
| WeChat Pay | 6.8.0 |
Step 2: Upgrade the configuration object
In your configuration object, you now must set the following properties:| Property | Required | Description |
|---|---|---|
amount | If you want to show the amount on the Pay button. | The currency and value of the payment amount shown on the Pay button. |
shopperLocale | ![]() | The shopper’s locale. To use the device’s default locale, replace this with your context. |
environment | ![]() | Use Environment.TEST for testing. When going live, use one of our live environments. |
clientKey | ![]() | Your client key. |
- Drop-in
- Components
- Drop-in
- Components
- Drop-in
- Components
In v5.3.0, how you configure Drop-in changes.For example:Configuring Drop-in
// Create the amount object.
val amount = Amount(
currency = "EUR",
value = 1000,
)
// Create a configuration object.
val dropInConfiguration = DropInConfiguration.Builder(
shopperLocale, // Use your context instead to use the device's default locale.
environment,
clientKey
)
// Set the amount on the Drop-in.
.setAmount(amount) // Optional to show the amount on the Pay button.
.build()
In v5.3.0, how you configure Components changes.For example, to configure the card Component:Configuring the card Component
// Create the amount object.
val amount = Amount(
currency = "EUR",
value = 1000,
)
// Create a configuration object.
val cardConfiguration = CardConfiguration.Builder(
shopperLocale, // Use your context instead to use the device's default locale.
environment,
clientKey
)
// Set the amount in the configuration object.
.setAmount(amount) // Optional to show the amount on the Pay button.
.setHolderNameRequired(true) // Optional configuration property to show the cardholder name input field.
.build()
Step 3: Upgrade methods
Remove methods from the v4.13.3 column and replace them with the ones from the v5.0.0 column:
| v4.13.3 or earlier | v5.0.0 |
|---|---|
makePaymentsCall | onSubmit |
makeDetailsCall | onAdditionalDetails |
onActivityResult | Not applicable. |
-
Remove the following methods. They can no longer be used.
observeremoveObserverremoveObservers
-
You must now implement a callback interface that you pass to the provider. Implement methods in
ComponentCallbackto pass data between your frontend app and your backend server.For example, for the card Component:Method Description onSubmitMake a /payments request. onAdditionalDetailsMake a /payments/details request. onErrorHandle an error if the Component encounters it.
// Handler to make a /payments request.
override fun onSubmit(state: CardComponentState) {
val paymentComponentJson = PaymentComponentData.SERIALIZER.serialize(state.data)
// Your server makes /payments request, including paymentComponentJson.
// If additional action is required, handle the action.
val action = Action.SERIALIZER.deserialize(actionJSONObject)
cardComponent.handleAction(action, activity)
}
// Handler to make a /payments/details request to send additional payment details.
override fun onAdditionalDetails(actionComponentData: ActionComponentData) {
val actionComponentJson = ActionComponentData.SERIALIZER.serialize(actionComponentData)
// Your server makes a /payments/details request, including actionComponentJson.
}
// The Component encounters an error.
override fun onError(componentError: ComponentError) {
// Handle the error.
}
Upgrade the view
You must now useAdyenComponentView with all Components. You can no longer use an individual view for each Component. Add AdyenComponentView to your layout .xml file.For example:<com.adyen.checkout.ui.core.AdyenComponentView
android:id="@+id/YOUR_COMPONENT_VIEW_ID"
.../>
Step 4: Upgrade launching
In v5.3.0, how you launch Drop-in changes.When you launch Drop-in calling
You can no longer launch Drop-in with a result intent.For example:Launch Drop-in in v5.0.0
DropIn.startPayment, you must now pass:| Parameter | Description |
|---|---|
context | Your context. |
dropInLauncher | The Drop-in launcher you declared in your Activity or Fragment. |
paymentMethodsApiResponse | The /paymentMethods response that you deserialized. |
dropInConfiguration | The Drop-in configuration that you created. |
YourDropInService::class.java (Example) | The DropInService that you created. |
DropIn.startPayment(
context,
dropInLauncher,
paymentMethodsApiResponse,
dropInConfiguration,
YourDropInService::class.java
)
In v5.3.0, how you launch Components changes.When you launch the Component calling
For example:Launch the Component in v5.0.0
If you believe the error you received is incorrect, report it by opening an issue on our GitHub repo.
PROVIDER.get, you must now pass:| Parameter | Description |
|---|---|
activity or fragment (Example) | Your Activity or Fragment. |
paymentMethod | The payment method from your /paymentMethods response. |
cardConfiguration | The card configuration that you created. |
componentCallback | The callback for the functions you implemented. |
// Create the payment method object from the /paymentMethods response.
val paymentMethod = paymentMethodsApiResponse?.paymentMethods.orEmpty().firstOrNull {
it.type == PaymentMethodTypes.SCHEME
}
val cardComponent = CardComponent.PROVIDER.get(
activity, // Your activity or fragment.
paymentMethod,
cardConfiguration,
componentCallback,
)
Step 5: Fix broken imports
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 release notes, you must update import statements.Public 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.If you believe the error you received is incorrect, report it by opening an issue on our GitHub repo.
Step 6 (optional): Upgrade your action handling implementation
For Components integrations:In 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 theRedirectComponent or the Adyen3DS2Component to handle redirects or 3D Secure authentication for cards.If you want to handle actions on a different page than the checkout one, you can use the GenericActionComponent instead.