availability

Google Pay in the JavaScript SDK is available across multiple browsers. See Google's documentation for a full list.

In order to test the entire user flow on an Android device, the user must have at least one card or PayPal account stored in either Android Pay or their Google account. The user can also add a payment method to their Google Pay account during the checkout process if none is present.

note

Be sure to test your website on the latest version of a supported web browser.

In the sandbox environment, Google Pay will return valid testing nonces that point to a test virtual account number or a PayPal account. You can simulate server behaviors by using test amounts on your transactions and test nonces. Transactions will show in the Braintree gateway as Google Pay transactions immediately upon completion, however, PayPal via Google Pay transactions will show as PayPal transactions. The payer_email will not match the email of the PayPal account added to Google Pay; in production, the email will match.

Transactions made with PayPal via Google Pay will show a payment_instrument_type of paypal_account and channel as "Google".

Go live

After you've tested your integration, you'll need to enable Google Pay in your production account via the Control Panel. If you haven't done so already, here's how:

  1. Log into your 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

In production, you'll also need to follow Google's documentation to register your domain and receive a merchant ID.

Use this merchant ID when creating the payment data request.

JavaScript
var paymentDataRequest = googlePaymentInstance.createPaymentDataRequest({
  merchantId: 'your-merchant-id-from-google', // Omit this line in sandbox; insert your Google merchant ID in production
  transactionInfo: {
    currencyCode: 'USD',
    totalPriceStatus: 'FINAL',
    totalPrice: '100.00' // Your amount
  }
});
var paymentsClient = new google.payments.api.PaymentsClient({
  environment: 'PRODUCTION'
}));

paymentsClient.loadPaymentData(paymentDataRequest).then(function(paymentData) {
  return googlePaymentInstance.parseResponse(paymentData);
}).then(function (result) {
  // Send result.nonce to your server
}).catch(function (err) {
  // Handle errors
});

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