---
title: "Android Component"
description: "Add Google Pay to your Components integration."
url: "https://docs.adyen.com/payment-methods/google-pay/android-component"
source_url: "https://docs.adyen.com/payment-methods/google-pay/android-component.md"
canonical: "https://docs.adyen.com/payment-methods/google-pay/android-component"
last_modified: "2026-06-01T15:33:15+02:00"
language: "en"
---

# Android Component

Add Google Pay to your Components integration.

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

Go [here](/payment-methods/google-pay/android-component/migrate/) for instructions on how to migrate to 5.9.x.

How you add Google Pay depends on your integration.

Choose the [server-side flow](/online-payments/build-your-integration) that your integration uses:

## Sessions flow Component

### Before-You-Begin

## Requirements

| Requirement          | Description                                                                                                                                                 |   |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| **Integration type** | Make sure that you have an existing Sessions flow [Android Components integration](/online-payments/build-your-integration/sessions-flow?platform=Android). |   |
| **Checkout API**     | Make sure that you use Checkout API v69 or later.                                                                                                           |   |
| **Setup steps**      | Before you begin, [add Google Pay in your Customer Area](/payment-methods/add-payment-methods).                                                             |   |

### Add-Parameters-Sessions-Request

## Add additional parameters to your /sessions request

You do not need to add any parameters when you [create a payment session](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#create-a-payment-session).

### Import-Component

## Import the Component for Google Pay

To [import the library](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#import) and include the module for Google Pay.

### Tab: With Jetpack Compose

**Import the module with Compose**

```java
implementation "com.adyen.checkout:googlepay:YOUR_VERSION"
implementation "com.adyen.checkout:components-compose:YOUR_VERSION"
```

### Tab: Without Jetpack Compose

**Import the module without Compose**

```java
implementation "com.adyen.checkout:googlepay:YOUR_VERSION"
```

### Add-Configuration

## Add additional configuration for Google Pay

[Add a configuration object](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#3-optional-add-a-configuration-object) with the following parameters:

| Parameter                          | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `setAllowCreditCards`              |          | Set if you support credit cards. Default is true for the specified card networks. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details.                                                                                                                                                                                                             |
| `setAllowedAuthMethods`            |          | Sets the supported authentication methods. Check `AllowedAuthMethods` for all the possible values. Default is **PAN\_ONLY**, **CRYPTOGRAM\_3DS**. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details.                                                                                                                                             |
| `setAllowedCardNetworks`           |          | Sets the allowed card networks. The allowed networks are automatically configured based on your account settings, but you can override them here. Check `AllowedCardNetworks` for all the possible values. Default is **AMEX**, **DISCOVER**, **INTERAC**, **JCB**, **MASTERCARD**, **VISA**. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details. |
| `setAllowPrepaidCards`             |          | Set if you support prepaid cards. Default is false. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details.                                                                                                                                                                                                                                           |
| `setAssuranceDetailsRequired`      |          | Set to true to request assurance details. Default is false. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details.                                                                                                                                                                                                                                   |
| `setBillingAddressParameters`      |          | Sets the required billing address details. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details.                                                                                                                                                                                                                                                    |
| `setBillingAddressRequired`        |          | Set to true if you require a billing address. Default is false. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details.                                                                                                                                                                                                                               |
| `setCountryCode`                   |          | Sets the ISO 3166-1 alpha-2 country code where the transaction is processed. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#TransactionInfo) for more details.                                                                                                                                                                                                                 |
| `setEmailRequired`                 |          | Set to true if you require an email address. Default is false. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#PaymentDataRequest) for more details.                                                                                                                                                                                                                            |
| `setExistingPaymentMethodRequired` |          | Default is false. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#IsReadyToPayRequest) for more details.                                                                                                                                                                                                                                                                        |
| `setGooglePayButtonStyling`        |          | Set a `GooglePayButtonStyling` object for customization of the Google Pay button.                                                                                                                                                                                                                                                                                                                                                   |
| `setGooglePayEnvironment`          |          | Sets the environment to be used by GooglePay. Should be either `WalletConstants.ENVIRONMENT_TEST` or `WalletConstants.ENVIRONMENT_PRODUCTION`. Default follows the value of the Adyen `environment`.                                                                                                                                                                                                                                |
| `setMerchantAccount`               |          | Sets the information about the merchant requesting the payment. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#PaymentDataRequest) for more details.                                                                                                                                                                                                                           |
| `setMerchantInfo`                  |          | Sets the information about the merchant requesting the payment.                                                                                                                                                                                                                                                                                                                                                                     |
| `setShippingAddressParameters`     |          | Sets the required shipping address details. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#PaymentDataRequest) for more details.                                                                                                                                                                                                                                               |
| `setShippingAddressRequired`       |          | Set to true if you require a shipping address. Default is false. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#PaymentDataRequest) for more details.                                                                                                                                                                                                                          |
| `setSubmitButtonVisible`           |          | Sets if submit button will be visible or not. Default is false.                                                                                                                                                                                                                                                                                                                                                                     |
| `setTotalPriceStatus`              |          | Sets the status of the total price used. Default is "FINAL". Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#TransactionInfo) for more details.                                                                                                                                                                                                                                 |

**Add a configuration object**

```kotlin
 {
    .setAllowCreditCards(value)
    .setAllowedAuthMethods(value)
    .setAllowedCardNetworks(value)
    .setAllowPrepaidCards(value)
    .setAssuranceDetailsRequired(value)
    .setBillingAddressParameters(value)
    .setBillingAddressRequired(value)
    .setCountryCode(value)
    .setEmailRequired(value)
    .setExistingPaymentMethodRequired(value)
    .setGooglePayButtonStyling(value)
    .setGooglePayEnvironment(value)
    .setMerchantAccount(value)
    .setMerchantInfo(value)
    .setShippingAddressParameters(value)
    .setShippingAddressRequired(value)
    .setSubmitButtonVisible(value)
    .setTotalPriceStatus(value)

}
```

### Launch-And-Show

## Launch and show the Component for Google Pay

To [create the Component](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#launch-and-show) for Google Pay, use the `GooglePayComponent` class.

### Tab: With Jetpack Compose

**Launch and show the Component**

```kotlin
import com.adyen.checkout.components.compose.get

// Get the payment method.
val paymentMethod = checkoutSession.getPaymentMethod(PaymentMethodTypes.SCHEME)

@Composable
private fun ComposableGooglePayComponent() {
  // Keep a reference to this Component in case you need to access it later.
  val googlepayComponent = GooglePayComponent.PROVIDER.get(
      checkoutSession = checkoutSession,
      paymentMethod = paymentMethod,
      configuration = checkoutConfiguration, 
      componentCallback = callback,
      // This key is required to ensure a new Component gets created for each different screen or payment session.
      // Generate a new value for this key every time you need to reset the Component.
      key = "YOUR_UNIQUE_KEY_FOR_THIS_COMPONENT",
  )

  // This is your composable, a wrapper around our xml view.
  AdyenComponent(
     component = googlepayComponent,
     modifier = YOUR_MODIFIER,
  )
}
```

### Tab: Without Jetpack Compose

```kotlin
// Get the payment method.
val paymentMethod = checkoutSession.getPaymentMethod(PaymentMethodTypes.SCHEME)

val googlepayComponent = GooglePayComponent.PROVIDER.get(
    activity, // Your activity or fragment.
    checkoutSession,
    paymentMethod,
    checkoutConfiguration, 
    componentCallback
)

// Attach the Component to your view.
binding.googlepayView.attach(googlepayComponent, activity) // Your activity or fragment.
```

## Test and go live

To start testing Google Pay, log in to a Google account and create a Google Pay wallet.

There are two approaches to using this wallet for testing:

* **Enroll in test card suite**

  Enroll your wallet in Google's [test card suite](https://developers.google.com/pay/api/android/guides/resources/test-card-suite). Test card suite pre-populates your wallet with a group of cards to use in the TEST environment. These are related to Adyen's collection of test cards, and cover scenarios including:

  * Cards stored as FPAN
  * Cards stored as DPAN (only when testing through native Android and Chrome on Android)
  * Cards enabled for 3DS2

  When you start the payment flow and open the list of test cards, each card is marked with the applicable scenario.

* **Without test card suite**

  You upload real credit cards to your wallet, which are mapped to one of Adyen's [test cards](/development-resources/test-cards-and-credentials/test-card-numbers) of the same brand. Your card is not charged.

  To test 3D Secure 2, you must use American Express or Discover cards, which trigger 3D Secure 2 challenge flows in the test environment. You cannot use any other card brands.

You can check the status of a Google Pay test payment in your [Customer Area](https://ca-test.adyen.com/) > **Transactions** > **Payments**, whether you used a card from the test card suite or or not. Remember that cards outside the test card suite are mapped to an Adyen test card of the same brand.

For more information, see [Google Pay's test environment for Android](https://developers.google.com/pay/api/android/guides/test-and-deploy/integration-checklist#about-the-test-environment).

### Before you go live

We recommend that you test the scenarios described in [Google Pay’s API reference for Android](https://developers.google.com/pay/api/android/reference/client) in your live environment.

1. Make sure that your API credential has the **API Clientside Encryption Payments role**. Check this in your [live Customer Area](https://ca-live.adyen.com/) or ask your Admin user to verify.
2. Go to your [live Customer Area](https://ca-live.adyen.com/) to configure your [Google Merchant ID](https://developers.google.com/pay/api/android/reference/request-objects#MerchantInfo).
3. Complete all the steps in the Google Pay API [deploy to production documentation for Android](https://developers.google.com/pay/api/android/guides/test-and-deploy/deploy-your-application).

In the live environment, note that Google Pay will only be available if:

* The shopper is logged in to their Google account.
* The shopper has at least one valid payment method on their Google Pay account.

## Advanced flow Component

## Requirements

| Requirement          | Description                                                                                                                                                 |   |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| **Integration type** | Make sure that you have an existing Advanced flow [Android Components integration](/online-payments/build-your-integration/advanced-flow?platform=Android). |   |
| **Setup steps**      | Before you begin, [add Google Pay in your Customer Area](/payment-methods/add-payment-methods).                                                             |   |

### Import

## Import the Component for Google Pay

To [import the library](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#import) and include the module for Google Pay.

### Tab: With Jetpack Compose

**Import the module with Compose**

```java
implementation "com.adyen.checkout:googlepay:YOUR_VERSION"
implementation "com.adyen.checkout:components-compose:YOUR_VERSION"
```

### Tab: Without Jetpack Compose

**Import the module without Compose**

```java
implementation "com.adyen.checkout:googlepay:YOUR_VERSION"
```

### Add Configuration

## Add additional configuration for Google Pay

[Add a configuration object](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#3-optional-add-a-configuration-object) with the following parameters:

| Parameter                          | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `setAllowCreditCards`              |          | Set if you support credit cards. Default is true for the specified card networks. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details.                                                                                                                                                                                                             |
| `setAllowedAuthMethods`            |          | Sets the supported authentication methods. Check `AllowedAuthMethods` for all the possible values. Default is **PAN\_ONLY**, **CRYPTOGRAM\_3DS**. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details.                                                                                                                                             |
| `setAllowedCardNetworks`           |          | Sets the allowed card networks. The allowed networks are automatically configured based on your account settings, but you can override them here. Check `AllowedCardNetworks` for all the possible values. Default is **AMEX**, **DISCOVER**, **INTERAC**, **JCB**, **MASTERCARD**, **VISA**. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details. |
| `setAllowPrepaidCards`             |          | Set if you support prepaid cards. Default is false. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details.                                                                                                                                                                                                                                           |
| `setAssuranceDetailsRequired`      |          | Set to true to request assurance details. Default is false. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details.                                                                                                                                                                                                                                   |
| `setBillingAddressParameters`      |          | Sets the required billing address details. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details.                                                                                                                                                                                                                                                    |
| `setBillingAddressRequired`        |          | Set to true if you require a billing address. Default is false. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#CardParameters) for more details.                                                                                                                                                                                                                               |
| `setCountryCode`                   |          | Sets the ISO 3166-1 alpha-2 country code where the transaction is processed. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#TransactionInfo) for more details.                                                                                                                                                                                                                 |
| `setEmailRequired`                 |          | Set to true if you require an email address. Default is false. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#PaymentDataRequest) for more details.                                                                                                                                                                                                                            |
| `setExistingPaymentMethodRequired` |          | Default is false. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#IsReadyToPayRequest) for more details.                                                                                                                                                                                                                                                                        |
| `setGooglePayButtonStyling`        |          | Set a `GooglePayButtonStyling` object for customization of the Google Pay button.                                                                                                                                                                                                                                                                                                                                                   |
| `setGooglePayEnvironment`          |          | Sets the environment to be used by GooglePay. Should be either `WalletConstants.ENVIRONMENT_TEST` or `WalletConstants.ENVIRONMENT_PRODUCTION`. Default follows the value of the Adyen `environment`.                                                                                                                                                                                                                                |
| `setMerchantAccount`               |          | Sets the information about the merchant requesting the payment. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#PaymentDataRequest) for more details.                                                                                                                                                                                                                           |
| `setMerchantInfo`                  |          | Sets the information about the merchant requesting the payment.                                                                                                                                                                                                                                                                                                                                                                     |
| `setShippingAddressParameters`     |          | Sets the required shipping address details. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#PaymentDataRequest) for more details.                                                                                                                                                                                                                                               |
| `setShippingAddressRequired`       |          | Set to true if you require a shipping address. Default is false. Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#PaymentDataRequest) for more details.                                                                                                                                                                                                                          |
| `setSubmitButtonVisible`           |          | Sets if submit button will be visible or not. Default is false.                                                                                                                                                                                                                                                                                                                                                                     |
| `setTotalPriceStatus`              |          | Sets the status of the total price used. Default is "FINAL". Check the [Google Pay docs](https://developers.google.com/pay/api/android/reference/request-objects#TransactionInfo) for more details.                                                                                                                                                                                                                                 |

**Add a configuration object**

```kotlin
 {
    .setAllowCreditCards(value)
    .setAllowedAuthMethods(value)
    .setAllowedCardNetworks(value)
    .setAllowPrepaidCards(value)
    .setAssuranceDetailsRequired(value)
    .setBillingAddressParameters(value)
    .setBillingAddressRequired(value)
    .setCountryCode(value)
    .setEmailRequired(value)
    .setExistingPaymentMethodRequired(value)
    .setGooglePayButtonStyling(value)
    .setGooglePayEnvironment(value)
    .setMerchantAccount(value)
    .setMerchantInfo(value)
    .setShippingAddressParameters(value)
    .setShippingAddressRequired(value)
    .setSubmitButtonVisible(value)
    .setTotalPriceStatus(value)

}
```

### Launch And Show

## Launch and show the Component for Google Pay

To [create the Component](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#launch-and-show) for Google Pay, use the `GooglePayComponent` class.

### Tab: With Jetpack Compose

**Launch and show the Component**

```kotlin
import com.adyen.checkout.components.compose.get

// Create the payment method object from the /paymentMethods response.
val paymentMethod = paymentMethodsApiResponse?.paymentMethods.orEmpty().firstOrNull {
  it.type == PaymentMethodTypes.SCHEME
}

@Composable
private fun ComposableGooglePayComponent() {
    // Keep a reference to this Component in case you need to access it later.
    val googlepayComponent = GooglePayComponent.PROVIDER.get(
        paymentMethod = paymentMethod,
        configuration = checkoutConfiguration,
        componentCallback = callback,
        // This key is required to ensure a new Component gets created for each different screen or payment session.
        // Generate a new value for this key every time you need to reset the Component.
        key = "UNIQUE_KEY_PER_COMPONENT",
    )

    // This is your composable, a wrapper around our xml view.
    AdyenComponent(
        component = googlepayComponent,
        modifier = YOUR_MODIFIER,
    )
}
```

### Tab: Without Jetpack Compose

```kotlin
// Create the payment method object from the /paymentMethods response.
val paymentMethod = paymentMethodsApiResponse?.paymentMethods.orEmpty().firstOrNull {
    it.type == PaymentMethodTypes.SCHEME
}

val googlepayComponent = GooglePayComponent.PROVIDER.get(
    activity, // Your activity or fragment.
    paymentMethod,
    checkoutConfiguration,
    componentCallback,
)

//Attach the Component to your view.
binding.googlepayView.attach(googlepayComponent, activity) // Your activity or fragment.
```

### Add Parameters Payments Request

## Add additional parameters to your /payments request

You do not need to add any parameters to the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request when you [make a payment](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#make-a-payment).

## Test and go live

To start testing Google Pay, log in to a Google account and create a Google Pay wallet.

There are two approaches to using this wallet for testing:

* **Enroll in test card suite**

  Enroll your wallet in Google's [test card suite](https://developers.google.com/pay/api/android/guides/resources/test-card-suite). Test card suite pre-populates your wallet with a group of cards to use in the TEST environment. These are related to Adyen's collection of test cards, and cover scenarios including:

  * Cards stored as FPAN
  * Cards stored as DPAN (only when testing through native Android and Chrome on Android)
  * Cards enabled for 3DS2

  When you start the payment flow and open the list of test cards, each card is marked with the applicable scenario.

* **Without test card suite**

  You upload real credit cards to your wallet, which are mapped to one of Adyen's [test cards](/development-resources/test-cards-and-credentials/test-card-numbers) of the same brand. Your card is not charged.

  To test 3D Secure 2, you must use American Express or Discover cards, which trigger 3D Secure 2 challenge flows in the test environment. You cannot use any other card brands.

You can check the status of a Google Pay test payment in your [Customer Area](https://ca-test.adyen.com/) > **Transactions** > **Payments**, whether you used a card from the test card suite or or not. Remember that cards outside the test card suite are mapped to an Adyen test card of the same brand.

For more information, see [Google Pay's test environment for Android](https://developers.google.com/pay/api/android/guides/test-and-deploy/integration-checklist#about-the-test-environment).

### Before you go live

We recommend that you test the scenarios described in [Google Pay’s API reference for Android](https://developers.google.com/pay/api/android/reference/client) in your live environment.

1. Make sure that your API credential has the **API Clientside Encryption Payments role**. Check this in your [live Customer Area](https://ca-live.adyen.com/) or ask your Admin user to verify.
2. Go to your [live Customer Area](https://ca-live.adyen.com/) to configure your [Google Merchant ID](https://developers.google.com/pay/api/android/reference/request-objects#MerchantInfo).
3. Complete all the steps in the Google Pay API [deploy to production documentation for Android](https://developers.google.com/pay/api/android/guides/test-and-deploy/deploy-your-application).

In the live environment, note that Google Pay will only be available if:

* The shopper is logged in to their Google account.
* The shopper has at least one valid payment method on their Google Pay account.
