No momento, esta página não está disponível em português
Payment-method icon

Google Pay Component integration

Add Google Pay to an existing Components integration.

When the shopper selects Google Pay, the Android Component shows the Google Pay payment form where the shopper selects the card they want to use.

This page is for v5.0.0, released in October 2023. If you're using an earlier version, use the guide for earlier versions instead.

Before you begin

Choose which server-side flow your integration uses.

API reference

No additional fields are required for GooglePay when you make the /sessions request. You can check if there are optional additional fields for GooglePay.

Set up the Component

Google Pay has additional steps when you set up the Component:

1: Check if Google Pay is available

After configuring the Component, check that Google Pay is available:

  1. Implement ComponentAvailableCallback:

  2. Call isAvailable:

If Google Pay isn't available, don't launch the Component or show the Google Pay button.

2: Show the Google Pay button

If Google Pay is available, show the Google Pay button.

  1. Add the Google Pay button dependency:

  2. Configure the button:

Launch Google Pay

When the shopper selects the Google Pay button, launch Google Pay and start the payment flow.

Pass your activity and the request code. The request code is a constant integer value that you need to handle the activity result in the next step.

Handle the activity result

Implement onActivityResult in your activity:

The Component completes the payment flow.

Test and go live

To test Google Pay in the test environment:

  1. Log in to a Google account and create a Google Pay wallet.
  2. Enrol your wallet in the Google Pay test card suite
  3. Add the details for a real card to the wallet.

After you make a test payment, you can check the status of a Google Pay test payment in your Customer Area > Transactions > Payments.

When you test with a real card, it will be masked to one of our test cards, and your card will not be charged. In your Customer Area, your test transactions show test card details of the same brand.

Limitations apply when testing Google Pay:

  • When testing with a wallet enrolled in the Google test card suite, you cannot test changes to your configuration in the PaymentDataRequest object, because the Google Pay API always returns the same output.
  • When using Google's test cards, only full PAN tokens (FPANs) are returned for test payments, instead of device authenticated tokens, known as Cryptograms.
  • To test 3D Secure 2, you can only use American Express or Discover cards, which trigger 3D Secure 2 challenge flows in the test environment. You cannot use any other card brands or any of Google Pay's test cards.

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

Before you go live

We recommend that you test the scenarios described in Google Pay’s API reference for Android in your live environment.

  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. Go to your live Customer Area to configure your Google Merchant ID.
  3. Complete all 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