Skip to main content

Google Pay

AVAILABILITY Google Pay is currently available with our latest Android and JavaScript SDKs.

Google Pay provides a purchasing experience both in app and on the web for customers with supported Android devices. It allows customers to pay with cards and PayPal accounts stored in their Google account, in addition to those stored in Google Pay.

For more details on compatibility and availability, see our Google Pay support article.

Getting started

If you don't already accept Google Pay, you'll need to follow these steps to add a Google Pay to your existing Braintree integration:

  • Configure Google Pay
  • Integrate on your servers

Configure Google Pay

In order to accept payments via Google Pay in sandbox or production, you will need to enable it in the Control Panel. To do so:

  1. Log into either your sandbox Control Panel or your production Control Panel
  2. Click on the gear icon in the top right corner
  3. Click Processing from the drop-down menu
  4. Scroll to the Payment Methods section
  5. Next to Google Pay, click the toggle to turn it on

If you already have Google Pay activated in your Control Panel, but need to get this payment method enabled for a particular merchant account, contact us.

In production, you'll also need to work with Google to go live.

PayPal via Google Pay

To accept PayPal payments via Google Pay, make sure you have enabled both PayPal and Google Pay in the Control Panel.

Integrate on your servers

Creating transactions

For the purpose of making transactions, an Google Pay card is treated just like other credit cards with a few noted differences.

Using chargePaymentMethod mutation and supply just an amount and paymentMethodId (which is called payment method nonce on the client-side) you can create a Google Pay card transaction.

mutation

mutation ChargePaymentMethod($input: ChargePaymentMethodInput!) {
chargePaymentMethod(input: $input) {
transaction {
id
createdAt
status
amount {
value
currencyCode
}
merchantAccountId
paymentMethodSnapshot {
... on CreditCardDetails {
brand
brandCode
last4
expirationMonth
expirationYear
cardholderName
origin {
type
details {
... on GooglePayOriginDetails {
googleTransactionId
bin
}
}
}
}
}
processorResponse {
legacyCode
message
avsPostalCodeResponse
avsStreetAddressResponse
cvvResponse
}
}
}
}

variables

{
"input": {
"paymentMethodId": "fake-android-pay-mastercard-nonce",
"transaction": {
"amount": "1.00",
"riskData": {
"customerBrowser": "netscap_1.0",
"customerIp": "8.8.8.8",
"deviceData": "android_v15.0_z2"
}
}
}
}

response

{
"data": {
"chargePaymentMethod": {
"transaction": {
"id": "dHJhbnNhY3Rpb25fMm1yazc1cWI",
"createdAt": "2022-09-13T04:44:37.000000Z",
"status": "SUBMITTED_FOR_SETTLEMENT",
"amount": {
"value": "1.00",
"currencyCode": "USD"
},
"merchantAccountId": "sandbox_credit_card",
"paymentMethodSnapshot": {
"brand": "MasterCard",
"brandCode": "MASTERCARD",
"last4": "4444",
"expirationMonth": "12",
"expirationYear": "2023",
"cardholderName": null,
"origin": {
"type": "GOOGLE_PAY",
"details": {
"googleTransactionId": "google_transaction_id",
"bin": "555555"
}
}
},
"processorResponse": {
"legacyCode": "1000",
"message": "Approved",
"avsPostalCodeResponse": "NOT_PROVIDED",
"avsStreetAddressResponse": "NOT_PROVIDED",
"cvvResponse": "NOT_PROVIDED"
}
}
}
},
"extensions": {
"requestId": "40aa12ef-7cd9-4733-8a4e-824966a2cf32"
}
}

Notice the origin bits in the response. The type clearly spells out that it's a Google Pay transaction. You should collect and pass device data under riskData of inputs in order to increase likelihood of a successful authorization.

Vaulting Google Pay

Google Pay cards can only be saved to your Vault for specific use cases; see the support article for details.

Vaulting of PayPal accounts from Google Pay is currently not supported. This means the options passed in vaultPaymentMethodAfterTransacting while using chargePaymentMethod mutation are not supported when creating a transaction.

If your use case is supported, you can store a customer's Google Pay card in your Vault using one of the following mutations: