Google Pay
Testing and Go Live
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 Google 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.
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:
- Log into your Control Panel
- Click on the gear icon in the top right corner
- Click Processing from the drop-down menu
- Scroll to the Payment Methods section
- 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, contact us.