Are you looking for test card numbers?

Would you like to contact support?

Payment-method icon

Google Pay Component

Add Google Pay to an existing Components integration.

Google Pay is supported from Android Components version 3.2.0 and later. For more information, see release notes.

Our Google Pay Component renders Google Pay in your payment form. When the shopper selects Google Pay, Drop-in invokes the payment sheet, where shoppers select the card they want to use, and completes the payment.

When building your Google Pay integration, you also need to:

Before you begin

This page explains how to add Google Pay to your existing Android Components integration. The Android Components integration works the same way for all payment methods. If you haven't done this integration yet, refer to our Components integration guide.

Before starting your Google Pay integration:

  1. Make sure that you have set up your back end implementation for making API requests.
  2. Add Google Pay in your test Customer Area.

Show Google Pay in your payment form

To show Google Pay Component in your payment form, you need to:

  1. Specify in your /paymentMethods request:
  2. Deserialize the response from the /paymentMethods call and get the object with type: paywithgoogle.

  3. Add the Google Pay Component:

    a. Import the Google Pay Component and Google Pay SDK to your build.gradle file.

    implementation "com.adyen.checkout:googlepay-base:<latest-version>"
    implementation ""

    Check the latest version on GitHub.

    b. Create a googlePayConfiguration object:

    val googlePayConfiguration =
           GooglePayConfiguration.Builder(YourContext, "YOUR_MERCHANT_ACCOUNT")
           //When you're ready to accept live payments, change the value to WalletConstants.ENVIRONMENT_PRODUCTION.

    c. Check if Google Pay is available on the shopper's device. If available, initialize the Component and present a Google Pay button according to Google Pay specifications.

    var googlePayComponent: GooglePayComponent
    GooglePayComponent.PROVIDER.isAvailable(this.application, paymentMethod, googlePayConfig) {
        isAvailable: Boolean, paymentMethod: PaymentMethod, googlePayConfiguration: GooglePayConfiguration? ->
        if (isAvailable) {
            googlePayButton.visibility = VISIBLE
            googlePayComponent = GooglePayComponent.PROVIDER.get(YourContext, paymentMethod, googlePayConfiguration)

    d. When the shopper selects the Google Pay button, call startGooglePayScreen.

    googlePayComponent.startGooglePayScreen(YourContext, googlePayRequestCode)

    e. Pass the result to the Component, and wait to be notified by the observer.

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if (requestCode == googlePayRequestCode) {
           googlePayComponent.observe(YourContext, Observer {
                it?.let {
                    if (it.isValid) {
                    // Call payments
            googlePayComponent.handleActivityResult(resultCode, data)

Make a payment

When the shopper proceeds to pay, the Component returns the

  1. Pass the to your server.
  2. From your server, make a /payments request, specifying:

    • paymentMethod.type: The from your client app.
    • returnURL: If the shopper chooses to pay with a card that requires 3D Secure 2 authentication, this is the URL to where the shopper should be redirected back to after they complete the payment. Get this URL from the Component in the RedirectComponent.getReturnUrl(context).
    curl \
    -H "x-API-key: YOUR_X-API-KEY" \
    -H "content-type: application/json" \
    -d '{
      "{hint:paymentComponentData.paymentMethod from app}paymentMethod{/hint}":{
        "googlePayToken": "QWIwMmI0YzAhQlFBQkFnQjMv.."
    # Set your X-API-KEY with the API key from the Customer Area.
    adyen =
    adyen.api_key = "YOUR_X-API-KEY"
    response = adyen.checkout.payments({
      :amount => {
        :currency => "EUR",
        :value => 1000
      :reference => "YOUR_ORDER_NUMBER",
      :paymentMethod => {
        :type => "paywithgoogle",
        :googlePayToken => "QWIwMmI0YzAhQlFBQkFnQjMv.."
      :returnUrl => "adyencheckout://",
      :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
    // Set YOUR_X-API-KEY with the API key from the Customer Area.
    // Change to Environment.LIVE and add the Live URL prefix when you're ready to accept live payments.
        Client client = new Client("YOUR_X-API-KEY", Environment.TEST);
        Checkout checkout = new Checkout(client);
        PaymentsRequest paymentsRequest = new PaymentsRequest();
        String merchantAccount = "YOUR_MERCHANT_ACCOUNT";
        Amount amount = new Amount();
        GooglePayDetails googlePayDetails = new GooglePayDetails();
        PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
    // Set your X-API-KEY with the API key from the Customer Area.
    $client = new \Adyen\Client();
    $service = new \Adyen\Service\Checkout($client);
    $params = array(
      "amount" => array(
        "currency" => "EUR",
        "value" => 1000
      "reference" => "YOUR_ORDER_NUMBER",
      "paymentMethod" => array(
        "type" => "paywithgoogle",
        "googlePayToken" => "QWIwMmI0YzAhQlFBQkFnQjMv.."
      "returnUrl" => "adyencheckout://",
      "merchantAccount" => "YOUR_MERCHANT_ACCOUNT"
    $result = $service->payments($params);
    #Set your X-API-KEY with the API key from the Customer Area.
    adyen = Adyen.Adyen()
    adyen.client.xapikey = 'YOUR_X-API-KEY'
    result = adyen.checkout.payments({
       'amount': {
          'value': 1000,
          'currency': 'EUR'
       'reference': 'YOUR_ORDER_NUMBER',
       'paymentMethod': {
          'type': 'paywithgoogle',
          'googlePayToken': 'QWIwMmI0YzAhQlFBQkFnQjMv..'
       'returnUrl': 'adyencheckout://',
       'merchantAccount': 'YOUR_MERCHANT_ACCOUNT'
    // Set your X-API-KEY with the API key from the Customer Area.
    var client = new Client ("YOUR_X-API-KEY", Environment.Test);
    var checkout = new Checkout(client);
    var amount = new Model.Checkout.Amount("EUR", 1000);
    var details = new Model.Checkout.DefaultPaymentMethodDetails{
      Type = "paywithgoogle",
      GooglePayToken = "QWIwMmI0YzAhQlFBQkFnQjMv.."
    var paymentRequest = new Adyen.Model.Checkout.PaymentRequest
      Reference = "YOUR_ORDER_NUMBER",
      Amount = amount,
      ReturnUrl = @"adyencheckout://",
      MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
      PaymentMethod = details
    var paymentResponse = checkout.Payments(paymentsRequest);
    // Set your X-API-KEY with the API key from the Customer Area.
    const {Client, Config, CheckoutAPI} = require('@adyen/api-library');
    const config = new Config();
    // Set your X-API-KEY with the API key from the Customer Area.
    config.apiKey = '[API_KEY]';
    config.merchantAccount = '[YOUR_MERCHANT_ACCOUNT]';
    const client = new Client({ config });
    const checkout = new CheckoutAPI(client);
        amount: { currency: "EUR", value: 1000 },
        paymentMethod: {
            type: 'paywithgoogle',
            googlePayToken: 'QWIwMmI0YzAhQlFBQkFnQjMv..'
        reference: "YOUR_ORDER_NUMBER",
        merchantAccount: config.merchantAccount,
        returnUrl: "adyencheckout://"
    }).then(res => res);

    The response contains the result of the payment.

    /payments response
      "pspReference": "881539337151149C",
      "resultCode": "Authorised"

    If the shopper used a card that requires 3D Secure authentication before the payment can be completed, you receive an action.type redirect in the response.

    /payments response for a card that requires 3D Secure authentication
       "resultCode": "RedirectShopper",
       "action": {
         "data": {
           "MD": "NGNsQ2QzN3hxMGtVN2lueUV5QWo3UT..",
           "PaReq": "eNpVUttygjAQ/RXrB5CES1..",
           "TermUrl": ""
         "method": "POST",
         "paymentData": "Ab02b4c0!BQABAgA2ndtJW6...==",
         "paymentMethodType": "scheme",
         "type": "redirect",
         "url": ""
       "details": [
           "key": "MD",
           "type": "text"
           "key": "PaRes",
           "type": "text"
  3. Pass the action object to your client app. You need this to initialize the Redirect Component.

Cards with 3D Secure: Handle the redirect

If the shopper makes a payment with a card that requires 3D Secure authentication, use the Redirect Component to redirect the shopper to another website to complete the authentication. After the shopper returns to your app, make a POST /payments/details request from your server, providing:

  • paymentData: The value from the /payments response.
  • details: The actionComponentData.details object from the Redirect Component.

/payments/details request
      "{hint:Value from actionComponentData.details}details{/hint}":{

You receive a response containing:

/payments/details response
      "resultCode": "Authorised",
      "pspReference": "88154795347618C"

Present the payment result

Use the resultCode that you received in the /payments or /payments/details response to present the payment result to your shopper.

The resultCode values you can receive for Google Pay are:

resultCode Description Action to take
Authorised The payment was successful. Inform the shopper that the payment has been successful.
Error There was an error when the payment was being processed. Inform the shopper that there was an error processing their payment. The response contains a refusalReason, indicating the cause of the error.
Refused The payment was refused by the shopper's bank. Ask the shopper to try the payment again using a different payment method.

Recurring payments

To make recurring Google Pay payments, you first need to create a shopper token and then make subsequent recurring transactions with the token.

Refer to Tokenization for more information and detailed instructions.

Test and go live

To test Google Pay, you must:

  • Login to a Google account.
  • Create a Google Pay wallet with valid card details. Google Pay does not accept test cards.

You can check the status of a Google Pay test payment in your Customer Area > Transactions > Payments.

For more information, see Google Pay's test environment for Android.

Before you go live

  1. Make sure your API credential has the API Clientside Encryption Payments role. Check this in your live Customer Area or ask your Admin user to verify.
  2. You must complete all of the steps in the Google Pay API deploy to production documentation for Android.

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.

See also