Google Pay™ allows your customers to pay quickly and securely using payment methods saved in their Google Account.
Google Pay is fully compatible with PayMe’s products and features: You can use it for traditional payments and multi payments page.
In order to be able to accept Google Pay payments on your website, first contact PayMe Partners partners@payme.io to start the integration process.
We support VISA, Mastercard, American Express, Discover and JCB card networks with the Google Pay API. If you're missing one of these in your PayMe account, you can reach out our team to add the missing network at support@payme.io.
PayMe handles all the technical complexity - you just need to create a sale and redirect customers to our payment page.
By integrating Google Pay, you must adhere to the Google Pay and Wallet API's Acceptable Use Policy and accept Google’s terms of service
By using the VAS-Enable API request, you will need to register to PayMe's Google Pay service.
API call payload:
{
"payme_client_key": "payme_partner_key",
"seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
"vas_payme_id": "VASLDEMO-GOOGLEPAY-VASLDEMO-1234567",
"language": "en"
}
A successful response will be 200 and includes a payload in the form of:
{
"status_code": 0,
"seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
"vas_payme_id": "VASLDEMO-GOOGLEPAY-VASLDEMO-1234567",
"vas_description": "Payments Account",
"vas_type": "AlternativePaymentMethod",
"vas_api_key": "",
"vas_is_active": true,
"vas_payer_type": 2,
"vas_price_currency": "ILS",
"vas_price_setup_fixed": 0,
"vas_price_periodic_fixed": 0,
"vas_price_periodic_variable": "0.00",
"vas_price_usage_fixed": 0,
"vas_price_usage_variable": "0.00",
"vas_market_fee": null,
"vas_period": 1,
}
A failed response will be 500 and includes a payload in the form of:
{
"status_code": 1,
"status_error_details": "The service was not activated",
"status_additional_info": null,
"status_error_code": 720
}
Before you can start Google Pay Payment you have to create a Google Pay Sale, which will be paid by your customer.
Use the PayMe API to create a sale with sale_payment_method: google-pay:
POST https://<env>.payme.io/api/generate-sale
POST /api/generate-sale
Content-Type: application/json
{
"seller_payme_id": "MPL14950-XXXXXXXX-XXXXXXXX-HMWATSBQ",
"sale_price": "1000",
"currency": "ILS",
"product_name": "Test Product",
"installments": "1",
"sale_payment_method": "google-pay",
"sale_type": "sale",
"language": "en"
}
Response:
{
"status_code": 0,
"sale_url": "https://<env>.payme.io/sale/generate/SALE1645-********-********-F2DUVUQI",
"payme_sale_id": "SALE1645-********-********-F2DUVUQI",
"payme_sale_code": 1027305,
"price": 1000,
"transaction_id": "",
"currency": "ILS",
"sale_payment_method": "google-pay"
}
After a successful sale creation, please save the payme_sale_id value from the response you received for future usage.
The button should be shown only after availability checks pass.
You must use the official Google Pay logo and button assets in compliance with Google Pay Android brand guidelines and Google Pay web brand guidelines, without modifications to the Google Pay asset colors, proportions, or appearance.
<script src="https://cdn.paymeservice.com/hf/v1/hostedfields.js"></script>
The SDK URL can switch between production and staging: https://cdn.paymeservice.com/hf/v1/hostedfields.js or https://cdn.payme.io/hf/v1/hostedfields-staging.js.
<div id="pay-with-google-pay"></div>
const isGooglePayAvailable = await PayMe.isGooglePayAvailable(testMode);
if (!isGooglePayAvailable) {
// hide payment section or show fallback
return;
}
const instance = await PayMe.create(apiKey, { testMode: testMode });
const googleSale = instance.googleSale({
saleGuid: paymeSaleId,
debugFn: function(message) {
console.log('[PayMe Debug]', message);
}
});
const interactionConfig = {
payButtonSelector: '#pay-with-google-pay',
buttonType: 'buy',
buttonColor: 'default',
canceled: function() {
console.log('Payment cancelled by user');
},
paymentCompleted: function(err, sale) {
if (err) {
console.error('Payment failed:', err.message);
} else {
console.log('Payment completed:', sale);
}
}
};
await googleSale.letsRock(interactionConfig);
Important: do not expose Google Pay UI when isGooglePayAvailable is false. Always provide fallback payment options.
The payment will be done by the buyer's card saved in his Google Pay wallet.
success_url or error_url based on the payment result.test_mode and staging SDK URL./generate-sale-form using the Google Pay button.paymentCompleted callback returns sale details.| Issue | Likely Cause | Action |
|---|---|---|
| Google Pay button does not appear | PayMe.isGooglePayAvailable(testMode) returned false |
Check browser/device support and keep fallback payment methods enabled. |
| Initialization fails | Invalid or missing public API key | Verify public_key in defaults and use the key for the selected environment. |
| Sale errors on backend | Invalid payload or seller configuration | Verify MPL, sale fields, and that Google Pay VAS is activated for the seller. |
<script src="{{paymeSdkUrl}}"></script>
<div id="pay-with-google-pay"></div>
<script>
(async function initGooglePay() {
const apiKey = '{{apiKey}}';
const saleGuid = '{{payme_sale_id}}';
const testMode = true;
if (!window.PayMe) throw new Error('PayMe SDK not loaded');
const available = await PayMe.isGooglePayAvailable(testMode);
if (!available) return;
const instance = await PayMe.create(apiKey, { testMode: testMode });
const googleSale = instance.googleSale({ saleGuid: saleGuid });
await googleSale.letsRock({
payButtonSelector: '#pay-with-google-pay',
buttonType: 'buy',
buttonColor: 'default',
canceled: function() {},
paymentCompleted: function(err, sale) {}
});
})();
</script>