---
title: "Migrate to 5.9.x"
description: "Migrate Google Pay to version 5.9.x."
url: "https://docs.adyen.com/payment-methods/google-pay/android-component/migrate"
source_url: "https://docs.adyen.com/payment-methods/google-pay/android-component/migrate.md"
canonical: "https://docs.adyen.com/payment-methods/google-pay/android-component/migrate"
last_modified: "2026-06-01T15:33:15+02:00"
language: "en"
---

# Migrate to 5.9.x

Migrate Google Pay to version 5.9.x.

[View source](/payment-methods/google-pay/android-component/migrate.md)

You are not required to migrate, but if you do, then 5.9.0 introduced a simplified integration for Google Pay to make migration easier. This new integration excludes the use of the deprecated `onActivityResult` and includes the Google Pay button. Follow the steps below to migrate from previous 5.x.x versions to 5.9.x:

## Overview

1. Remove deprecated Activity Result code
2. Display Google Pay button
3. Google Pay availability check

## Remove deprecated Activity Result code

Add `AdyenComponentView` to your layout and attach the component to it.

**Add AdyenComponentView**

```bash
<com.adyen.checkout.ui.core.AdyenComponentView
android:id="@+id/componentView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
```

**Attach the component to the view**

```bash
// Attach the component to the view
binding.componentView.attach(googlePayComponent, lifecycleOwner)

// Or if you use Jetpack Compose
AdyenComponent(googlePayComponent)
```

Now you no longer need activity result related code, so you can clean it up. For example you can remove:

**Remove**

```bash
// This function can be deleted
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
googlePayComponent.handleActivityResult(resultCode, data)
}
```

## Display Google Pay button

If you want to keep displaying a button yourself, then you have to replace the call to `googlePayComponent.startGooglePayScreen(…)` with `googlePayComponent.submit()`.

To let the component display the Google Pay button inside the `AdyenComponentView` remove your own button and adjust your configuration:

**Add a configuration object**

```bash
CheckoutConfiguration(
environment = environment,
clientKey = clientKey,
…
) {
   googlePay {
   setSubmitButtonVisible(true)
   setGooglePayButtonStyling(…) // Optionally style the button
  }
}
```

The `com.google.pay.button:compose-pay-button` dependency can now also be removed from your `build.gradle`.

## Google Pay availability check

You no longer need to call `GooglePayComponent.PROVIDER.isAvailable(…)`.

The `GooglePayComponent` now checks if Google Pay is available when you initialize it. If Google Pay is not available, you get a `GooglePayUnavailableException` in `onError`.
