Google Pay
You can start accepting Google Pay payments on the Web using Hosted Payment Page or Payment Request Component. No additional configuration is required.
Our Payment Request Component gives you a single integration for Apple Pay and Google Pay. Customers see a Google Pay or an Apple Pay button, depending on what their device and browser combination supports.
If you prefer to integrate directly against the Google Pay API, follow our Google Pay direct API integration guide.
Before you begin
This page explains how to add Google Pay to your payment page. To accept Google Pay payments you need to have at least one configured card processor.
To configure card processors go to MONEI Dashboard → Settings → Payment Methods → Card payments.
Before you start, you need to:
- Make sure that you have Google Pay enabled in MONEI Dashboard → Settings → Payment Methods.
- Add a card in Chrome.
- Serve your application over HTTPS. This is a requirement both in development and in production. One way to get up and running is to use a service like ngrok.
To test your integration:
- Use your test mode Account ID and API Key.
- You can use any real card details, you will not be charged in the test mode (card details are automatically replaced with the test card).
- You can check the status of the test payment in your MONEI Dashboard → Payments (in test mode).
Google Pay Terms
By integrating Google Pay™, you adhere to the Google Pay APIs Acceptable Use Policy and accept the terms defined in the Google Pay API Terms of Service.
Google Pay direct API integration
If you prefer to integrate directly against the Google Pay API, follow Google’s instructions.
Specify following tokenization specification
const tokenizationSpecification = {
type: 'PAYMENT_GATEWAY',
parameters: {
gateway: 'monei',
gatewayMerchantId: 'MONEI_ACCOUNT_ID'
}
};
To use Google Pay API directly you need to request production access and obtain your merchantId
in Google Console (this step is not required if you are using our Google Pay Сomponent).
paymentDataRequest.merchantInfo = {
merchantName: 'Example Merchant',
merchantId: 'GOOGLE_MERCHANT_ID'
};
Exchange Google Pay token for MONEI Payment Token that can be used to confirm payment as described in step 3.
function processPayment(paymentData) {
// Encode Google Pay token as a base64 string
const token = window.btoa(paymentData.paymentMethodData.tokenizationData.token);
return monei.api
.createToken({
paymentId: '{{payment_id}}',
paymentMethod: {
googlePay: {
token: token
}
}
})
.then(function (result) {
return moneiTokenHandler(result.token);
});
}
Before you go live
- Make sure that you are using live (production) mode Account ID and API Key.
- Make sure that you have at least one enabled card processor.
- Make sure that you have Google Pay enabled in MONEI Dashboard → Settings → Payment Methods.