Google Pay
Google Pay is a digital wallet made by Google to support in-app, online, and in-person contactless purchases via mobile devices. It lets Android users pay with their smartphones, smartwatches, or tablets. Technically, Google Pay is not a payment method in itself — it is a payment tokenization method, and the actual payment is processed as a card payment using whichever card the shopper has added to their wallet.
Once users enter their card information, it's stored for future purchases, making it easier to pay for their next order. Payment information is securely transferred from the cardholder to us, so we can and complete the payment. Once card information is saved, shoppers use it to tap and pay, make purchases in apps and on websites, automatically fill in forms on Chrome, buy Google products, and transfer money to family and friends (US only). Google Pay users can also use loyalty cards, tickets, gift cards, and coupons from their favorite stores with Google Pay.
Availability
Google Pay is available in many countries and regions worldwide. Customers pay with the cards saved to their Google Account on a supported Android device or in Chrome. See Google Pay help for current device and country coverage.
Activation
As soon as your account has been approved, Google Pay is enabled by default — you do not need to do anything. You can go to MONEI Dashboard → Settings → Payment Methods to make adjustments to your configured payment methods.
Once activated, Google Pay is available in the Hosted Payment Page integration. You can also use the Payment Request Component to render the button directly on your website. See Integration for setup details.
To accept Google Pay payments you need at least one configured card processor in MONEI Dashboard → Settings → Payment Methods → Card payments.
Fees
Google Pay is not technically a payment method — it is a tokenization method. The actual payment method used depends on the credit or debit cards the consumer adds to their Wallet app. There are no extra costs to accept Google Pay through MONEI, and there are no extra transaction fees from Google Pay either — you only pay the regular card fees. For current pricing, see MONEI fees.
Payouts
Google Pay payments are card payments — Google Pay is the digital wallet shoppers use to store their card information. For this reason, the payout process is the same as card settlements, with no additional transaction fees. Learn more about settlements and when you will get paid.
Integration
- Web
- Native Android App
Web integration
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 the direct API integration guide below.
Before you begin
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).
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.
Express checkout
Use express checkout to collect shipping and billing addresses directly in the Google Pay payment sheet. See the Express Checkout guide for setup and examples.
Direct API Integration
If you prefer to integrate directly against the Google Pay API, follow Google's instructions.
Specify following specification:
const tokenizationSpecification = {
type: 'PAYMENT_GATEWAY',
parameters: {
gateway: 'monei',
gatewayMerchantId: 'MONEI_ACCOUNT_ID'
}
};
Use MONEI's merchantId from the Get PaymentMethods API (metadata.googlePay.merchantId). No separate registration with Google is required.
paymentDataRequest.merchantInfo = {
merchantName: 'Your Business Name',
// Get merchantId from Get PaymentMethods API (metadata.googlePay.merchantId)
// Test: 12345678901234567890, Production: BCR2DN6T37ENLJ3M
merchantId: 'MONEI_GOOGLE_PAY_MERCHANT_ID'
};
Exchange Google Pay token for MONEI that can be used to confirm payment:
async function processPayment(paymentData) {
// Encode Google Pay token as a base64 string
const token = window.btoa(paymentData.paymentMethodData.tokenizationData.token);
const result = await monei.api.createToken({
paymentId: '{{payment_id}}',
paymentMethod: {
googlePay: {
token: token
}
}
});
return moneiTokenHandler(result.paymentToken);
}
Confirm the Payment
After you have obtained the MONEI Payment Token, you can confirm the payment using the token.
async function moneiTokenHandler(token) {
try {
const result = await monei.confirmPayment({
paymentId: '{{payment_id}}',
paymentToken: token
});
// At this moment you can show a customer the payment result
// But you should always rely on the result passed to the callback endpoint
// on your server to update the order status
console.log(result);
} catch (error) {
console.error(error);
}
}
Native Android app integration
Google Pay works out of the box on Android with no additional certificate setup required. Simply integrate the Google Pay API and use MONEI as your payment gateway.
Prerequisites
- Google Pay enabled in MONEI Dashboard → Settings → Payment Methods
- At least one configured card processor in MONEI Dashboard
- Android device or emulator with Google Play Services
Add Dependencies
Add the Google Pay library to your app's build.gradle:
dependencies {
implementation 'com.google.android.gms:play-services-wallet:19.2.1'
}
Add the Google Pay API meta-data to your AndroidManifest.xml:
<meta-data
android:name="com.google.android.gms.wallet.api.enabled"
android:value="true" />
Check Google Pay Availability
Before showing the Google Pay button, verify it's available on the device:
val paymentsClient = Wallet.getPaymentsClient(
this,
Wallet.WalletOptions.Builder()
.setEnvironment(WalletConstants.ENVIRONMENT_TEST) // Use ENVIRONMENT_PRODUCTION for live
.build()
)
val isReadyToPayRequest = IsReadyToPayRequest.fromJson("""
{
"apiVersion": 2,
"apiVersionMinor": 0,
"allowedPaymentMethods": [{
"type": "CARD",
"parameters": {
"allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
"allowedCardNetworks": ["VISA", "MASTERCARD", "AMEX", "DISCOVER", "JCB"]
}
}]
}
""")
paymentsClient.isReadyToPay(isReadyToPayRequest)
.addOnCompleteListener { task ->
if (task.isSuccessful) {
// Show Google Pay button
}
}
Configure Payment Request
Create a payment request with MONEI as the gateway. Use the merchantId from the Get PaymentMethods API (metadata.googlePay.merchantId). No separate registration with Google is required:
val paymentDataRequest = PaymentDataRequest.fromJson("""
{
"apiVersion": 2,
"apiVersionMinor": 0,
"allowedPaymentMethods": [{
"type": "CARD",
"parameters": {
"allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
"allowedCardNetworks": ["VISA", "MASTERCARD", "AMEX", "DISCOVER", "JCB"]
},
"tokenizationSpecification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "monei",
"gatewayMerchantId": "YOUR_MONEI_ACCOUNT_ID"
}
}
}],
"merchantInfo": {
"merchantName": "Your Store Name",
"merchantId": "MONEI_GOOGLE_PAY_MERCHANT_ID"
},
"transactionInfo": {
"totalPrice": "10.00",
"totalPriceStatus": "FINAL",
"currencyCode": "EUR",
"countryCode": "ES"
}
}
""")
Launch Google Pay
Launch the Google Pay payment sheet when the user taps the button:
private val googlePayLauncher = registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) { result ->
when (result.resultCode) {
Activity.RESULT_OK -> {
result.data?.let { intent ->
val paymentData = PaymentData.getFromIntent(intent)
handlePaymentSuccess(paymentData)
}
}
Activity.RESULT_CANCELED -> {
// User cancelled
}
AutoResolveHelper.RESULT_ERROR -> {
// Handle error
}
}
}
fun requestPayment() {
val task = paymentsClient.loadPaymentData(paymentDataRequest)
AutoResolveHelper.resolveTask(task, this, GOOGLE_PAY_REQUEST_CODE)
}
Process the Payment
Extract the token from the payment data and send it to your backend:
private fun handlePaymentSuccess(paymentData: PaymentData?) {
val paymentInfo = paymentData?.toJson() ?: return
val json = JSONObject(paymentInfo)
// Extract the Google Pay token
val token = json
.getJSONObject("paymentMethodData")
.getJSONObject("tokenizationData")
.getString("token")
// Base64 encode the token
val encodedToken = Base64.encodeToString(token.toByteArray(), Base64.NO_WRAP)
// Send to your backend to create MONEI payment token and confirm payment
sendToBackend(encodedToken)
}
Backend Integration
On your backend, exchange the Google Pay token for a MONEI payment token:
# 1. Create a payment
curl -X POST https://api.monei.com/v1/payments \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 1000,
"currency": "EUR",
"orderId": "order_123"
}'
# 2. Create a token from Google Pay token
curl -X POST https://api.monei.com/v1/payment-tokens \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"paymentId": "PAYMENT_ID_FROM_STEP_1",
"paymentMethod": {
"googlePay": {
"token": "BASE64_ENCODED_GOOGLE_PAY_TOKEN"
}
}
}'
# 3. Confirm the payment
curl -X POST https://api.monei.com/v1/payments/PAYMENT_ID/confirm \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"paymentToken": "MONEI_TOKEN_FROM_STEP_2"
}'
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.
- For direct API integration, use the
merchantIdfrom the Get PaymentMethods API.
Common questions
How do I activate Google Pay?
As soon as your account has been approved, Google Pay is enabled by default — you do not need to do anything. You can adjust your configured payment methods in MONEI Dashboard → Settings → Payment Methods. See Activation for details.
What happens after I activate Google Pay?
After activation, Google Pay is available in the Hosted Payment Page integration, and you can also use the Payment Request Component to render the button directly on your website.
What are the transaction fees for Google Pay?
There are no extra costs to accept Google Pay through MONEI, and no extra fees from Google Pay. You only pay the regular card fees. See Fees.
How are Google Pay transactions paid out to me?
Google Pay payments are card payments, so the payout process is the same as card settlements with no additional transaction fees. See Payouts.