Google Pay

The Google Pay offers a quick and easy path to enable secure, one touch payments in your app.
This guide explains how to process payments with our SDK.


  • A Mobile SDK integration (Ready-to-Use UI or SDK & Your Own UI)
  • A Google account, when you’re ready to deploy your Google Pay integration, sign-up to get access and test with production credentials.


Open the build.gradle file in the app module and add the following to the dependencies block:

implementation ""

Adding the Google Pay to your app must be done in one of two ways, depending on whether you are using the Ready-to-Use UI or the SDK & Your Own UI. These two ways are covered in the sections below. Please follow the instructions relevant to the approach you have chosen.

Ready-to-Use UI

Add GOOGLEPAY payment brand

Create the CheckoutSettings, and add the GOOGLEPAY to the payment brands list:

If you integrate the Google Pay using our drop-in buttons, set the GOOGLEPAY payment brand in the PaymentButtonFragment.

Configure PaymentDataRequest

Create PaymentDataRequest to configure Google Pay widget with the transaction info, allowed payment methods and card networks.
Use GooglePayHelper method to easily create base PaymentDataRequest.Builder with all required parameters.

Then you can add some optional configurations, e.g. enable requesting shipping info in the widget. Please refer to the Google Pay Payments API Documentation for more options.

Call build() method to get a final configuration object and pass it to the CheckoutSettings.

Collecting shopper information

You can collect additional information with the Google Pay widget before submitting the transaction, e.g. shipping information.

Configure payment data request

In addition to the previous steps complete configuration of the PaymentDataRequest.Builder object to request additional information from the shopper. Refer to the Payments API to see the full list of options.

Configure receiving callbacks from the checkout

The CheckoutActivity may send the callback CheckoutActivity.ACTION_ON_BEFORE_SUBMIT when shopper submits the payment.
To receive it you should complete the following steps:

1. Create your broadcast receiver to listen the intents from CheckoutActivity.
See below how to receive PaymentData object with the requested data from the Google Pay widget. Refer to the Payments API for the class definition.

2. Declare your broadcast receiver in AndroidManifest.xml.

    android:exported="false" />

NOTE: It is important to set android:exported="false" to your broadcast receiver. In this case the only messages the broadcast receiver can receive are those sent by components of the same application or applications with the same user ID.

3. To provide the best security our SDK uses directed broadcasts. This way our broadcast is received only by the specified BroadcastReceiver. For this reason you should add ComponentName of your receiver to CheckoutActivity intent.

Confirmation page

A final price must be displayed to the shopper before processing the transaction. If the amount to be charged has varied based on data received from the Google Pay widget you are expected to show a confirmation page with a final price. You can configure it in CheckoutActivity.ACTION_ON_BEFORE_SUBMIT callback. 1. Initialize OrderSummary object with order details, total amount and Google Pay PaymentData response object.

Google Pay Confirmation Page

2. Add OrderSummary extra to the CheckoutActivity intent.

3. Start checkout activity to return control back to the sdk and show confirmation page.

SDK & Your Own UI

Follow this tutorial to integrate the Google Pay into your UI.
Use the following parameters:

gateway = "aciworldwide"
gatewayMerchantId = "YOUR_ENTITY_ID"
To make a transaction create the GooglePayPaymentParams with a received token:

And submit the transaction: