Choose an integration method

You can accept Google Pay with either our Drop-in UI or a custom integration.

Drop-in integration

Our Drop-in UI is the fastest way to set up your client-side integration.

For full details, see Drop-in Setup and Integration.

Custom integration

Get the SDK

Add Google Play Services Wallet

Google Pay is only available with Google Play Services Wallet 16.0.1 or later. If you are not including Google Play Services, add to your build.gradle or visit Google's developer documentation for additional information.

Ensure you have also included the wallet enabled meta-data tag in your AndroidManifest.xml:

<meta-data android:name="" android:value="true"/>

Add Braintree GooglePayment component

To use Google Pay, include Braintree's google-payment component in your dependencies:

dependencies {
  // Braintree dependencies
  implementation 'com.braintreepayments.api:braintree:3.17.4'
  implementation 'com.braintreepayments.api:google-payment:3.5.0'

  // Google dependencies
  implementation ''


First use a tokenization key or get a client token from your server and initialize BraintreeFragment.

Then register a listener to receive a payment method nonce once the Google Pay flow finishes.

Before showing the Google Pay button, use the GooglePayment#isReadyToPay method to check whether the user's current device is compatible. When this method returns true, show the Google Pay button. When it returns false, display other checkout options.

GooglePayment.isReadyToPay(mBraintreeFragment, new BraintreeResponseListener<Boolean>() {
  public void onResponse(Boolean isReadyToPay) {
    if (isReadyToPay) {
      // Show Google Pay button

You will need a button element on your page styled according to Google's brand guidelines.

The CARD payment method type is supplied by the Braintree Android SDK as an allowed payment method when making the IsReadyToPayRequest. It also provides the PAYPAL payment method type if you are using Google Pay v2 and currently accept PayPal payments. If you desire different behavior for the IsReadyToPayRequest, you can follow Google's documentation and make the IsReadyToPayRequest outside of the Braintree Android SDK.

Requesting a payment

To accept Google Pay, you can either use our SDK for the entire integration or integrate with Google directly.

Direct integration with Google Play Services can be useful if you already have an existing integration with the Google Payment API or wish to integrate directly for other reasons; otherwise, we recommend using our SDK.

Braintree SDK integration

Google Pay requires a price to be specified using the TransactionInfo object. Build a TransactionInfo object and provide it at the time of payment, along with your Google-provided googleMerchantId for production transactions.

GooglePaymentRequest googlePaymentRequest = new GooglePaymentRequest()
  // We recommend collecting billing address information, at minimum
  // billing postal code, and passing that billing postal code with all
  // Google Pay card transactions as a best practice.
  // Optional in sandbox; if set in sandbox, this value must be a valid production Google Merchant ID

Call GooglePayment#requestPayment when your Google Pay button is clicked to kick off the Google Pay flow.

GooglePayment.requestPayment(mBraintreeFragment, googlePaymentRequest);

If completed successfully, a GooglePaymentCardNonce or PayPalAccountNonce will be passed to your PaymentMethodNonceCreatedListener. If canceled, your BraintreeCancelListener will be called; if unsuccessful, an error will be passed to your BraintreeErrorListener.

Direct Google Play Services integration

To tokenize with the result of a successful direct Google Play Services integration, call GooglePayment#tokenize on the PaymentData received from PaymentsClient#loadPaymentData:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  if (requestCode == GOOGLE_PAYMENT_REQUEST_CODE && resultCode == RESULT_OK) {
    GooglePayment.tokenize(mBraintreeFragment, PaymentData.getFromIntent(data))

The resulting GooglePaymentCardNonce or PayPalAccountNonce will be returned in your PaymentMethodNonceCreatedListener implementation.

Next Page: Server-side →