Enable Google Pay in Stripe by activating it in the Dashboard, adding the Payment Request Button Element to your frontend, and confirming payments with a PaymentIntent. Google Pay appears automatically on Chrome when the customer has a saved payment method in their Google account — no separate Google API setup required.
Accepting Google Pay Payments with Stripe
Google Pay lets customers pay quickly using cards saved in their Google account. With Stripe, enabling Google Pay requires no separate Google API integration — you activate it in the Stripe Dashboard and use the same Payment Request Button Element that also supports Apple Pay. Stripe detects the customer's browser and shows the appropriate wallet option automatically.
Prerequisites
- A Stripe account with payment processing enabled
- Your domain served over HTTPS
- Stripe.js loaded on your frontend with your publishable key (pk_test_...)
- A backend endpoint that creates a PaymentIntent
Step-by-step guide
Activate Google Pay in the Stripe Dashboard
Activate Google Pay in the Stripe Dashboard
Go to Stripe Dashboard → Settings → Payment methods. Find Google Pay in the Wallets section and make sure it is enabled. In most accounts Google Pay is enabled by default.
Expected result: Google Pay shows as 'Enabled' under Payment methods in your Stripe Dashboard.
Create a PaymentIntent on the server
Create a PaymentIntent on the server
Create a PaymentIntent with automatic_payment_methods enabled. This lets Stripe determine which payment methods to offer, including Google Pay.
1// server.js2const express = require('express');3const Stripe = require('stripe');4const stripe = Stripe(process.env.STRIPE_SECRET_KEY);5const app = express();6app.use(express.json());78app.post('/api/create-payment-intent', async (req, res) => {9 const intent = await stripe.paymentIntents.create({10 amount: req.body.amount, // in cents11 currency: 'usd',12 automatic_payment_methods: { enabled: true }13 });14 res.json({ client_secret: intent.client_secret });15});1617app.listen(3001);Expected result: The endpoint returns a client_secret for the frontend to use.
Add the Payment Request Button to your page
Add the Payment Request Button to your page
Create a PaymentRequest object and mount the Payment Request Button Element. On Chrome with a Google account that has saved cards, the Google Pay button will appear automatically.
1const stripe = Stripe('pk_test_your_publishable_key');23const paymentRequest = stripe.paymentRequest({4 country: 'US',5 currency: 'usd',6 total: { label: 'Order total', amount: 2000 },7 requestPayerName: true,8 requestPayerEmail: true9});1011const elements = stripe.elements();12const prButton = elements.create('paymentRequestButton', {13 paymentRequest14});1516paymentRequest.canMakePayment().then(result => {17 if (result) {18 prButton.mount('#google-pay-button');19 } else {20 document.getElementById('google-pay-button').style.display = 'none';21 }22});Expected result: The Google Pay button renders on Chrome when the user has a payment method saved in Google Pay.
Handle the payment confirmation
Handle the payment confirmation
Listen for the paymentmethod event, create a PaymentIntent on the server, and confirm it with the payment method from Google Pay.
1paymentRequest.on('paymentmethod', async (event) => {2 const res = await fetch('/api/create-payment-intent', {3 method: 'POST',4 headers: { 'Content-Type': 'application/json' },5 body: JSON.stringify({ amount: 2000 })6 });7 const { client_secret } = await res.json();89 const { error, paymentIntent } = await stripe.confirmCardPayment(10 client_secret,11 { payment_method: event.paymentMethod.id },12 { handleActions: false }13 );1415 if (error) {16 event.complete('fail');17 } else if (paymentIntent.status === 'requires_action') {18 const { error: actionError } = await stripe.confirmCardPayment(client_secret);19 event.complete(actionError ? 'fail' : 'success');20 } else {21 event.complete('success');22 }23});Expected result: The Google Pay sheet closes after successful payment. The PaymentIntent shows as succeeded in the Stripe Dashboard.
Test Google Pay
Test Google Pay
In test mode, open your page in Chrome with a Google account that has a saved payment method. Stripe will simulate the payment without real charges. You can also add the test card 4242424242424242 to Google Pay for testing.
Expected result: A test payment appears in your Stripe Dashboard under Payments with the payment method type shown as 'google_pay'.
Complete working example
1// google-pay-checkout.js2// Complete Google Pay integration with Stripe Payment Request Button34const stripe = Stripe('pk_test_your_publishable_key');56const paymentRequest = stripe.paymentRequest({7 country: 'US',8 currency: 'usd',9 total: {10 label: 'Order total',11 amount: 2000 // $20.00 in cents12 },13 requestPayerName: true,14 requestPayerEmail: true15});1617const elements = stripe.elements();18const prButton = elements.create('paymentRequestButton', {19 paymentRequest,20 style: {21 paymentRequestButton: {22 type: 'buy',23 theme: 'dark',24 height: '48px'25 }26 }27});2829paymentRequest.canMakePayment().then(result => {30 if (result) {31 prButton.mount('#google-pay-button');32 if (result.googlePay) {33 console.log('Google Pay is available');34 }35 } else {36 document.getElementById('google-pay-button').style.display = 'none';37 }38});3940paymentRequest.on('paymentmethod', async (event) => {41 try {42 const res = await fetch('/api/create-payment-intent', {43 method: 'POST',44 headers: { 'Content-Type': 'application/json' },45 body: JSON.stringify({ amount: 2000 })46 });47 const { client_secret } = await res.json();4849 const { error, paymentIntent } = await stripe.confirmCardPayment(50 client_secret,51 { payment_method: event.paymentMethod.id },52 { handleActions: false }53 );5455 if (error) {56 event.complete('fail');57 return;58 }5960 if (paymentIntent.status === 'requires_action') {61 const { error: actionError } = await stripe.confirmCardPayment(client_secret);62 event.complete(actionError ? 'fail' : 'success');63 } else {64 event.complete('success');65 }66 } catch (err) {67 event.complete('fail');68 console.error('Payment failed:', err);69 }70});Common mistakes when enabling Google Pay in Stripe
Why it's a problem: Trying to use the Google Pay API directly instead of Stripe's Payment Request Button
How to avoid: Stripe wraps Google Pay through the Payment Request Button Element. You do not need the Google Pay API library when using Stripe.
Why it's a problem: Testing in a browser that does not support Google Pay
How to avoid: Google Pay through Stripe works on Chrome (desktop and Android). It does not appear on Safari or Firefox.
Why it's a problem: Not calling event.complete() after payment confirmation
How to avoid: Always call event.complete('success') or event.complete('fail') to dismiss the Google Pay sheet.
Why it's a problem: Serving the checkout page over HTTP
How to avoid: Google Pay requires HTTPS. Use ngrok or a similar tool to test locally over HTTPS.
Best practices
- Use automatic_payment_methods on the server to let Stripe handle payment method availability
- Check canMakePayment() before rendering the button to avoid empty containers on unsupported browsers
- Use the same Payment Request Button for both Google Pay and Apple Pay — Stripe shows the right one automatically
- Show a card input form as a fallback when wallet payments are not available
- Test on both Chrome desktop and Chrome for Android to cover all Google Pay surfaces
- Set requestPayerEmail to true if you need the customer's email for receipts or order confirmation
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I want to accept Google Pay on my website using Stripe. Show me how to enable it in the Dashboard, create a Payment Request Button with Stripe.js, and handle the payment confirmation. Include the Node.js backend code for creating a PaymentIntent.
Add a Google Pay button to my checkout page using Stripe's Payment Request Button Element. Check if Google Pay is available, mount the button, handle the paymentmethod event, and confirm the payment. Include error handling.
Frequently asked questions
Do I need a Google API key to accept Google Pay with Stripe?
No. Stripe handles the Google Pay integration entirely through the Payment Request Button. You do not need any separate Google API credentials.
Is the Google Pay button the same as the Apple Pay button in Stripe?
Yes, they use the same Payment Request Button Element. Stripe detects the customer's browser and shows Apple Pay on Safari or Google Pay on Chrome automatically.
Can customers use Google Pay on desktop Chrome?
Yes. Desktop Chrome supports Google Pay if the user has a payment method saved in their Google account. The Google Pay button will appear when canMakePayment returns true.
What currencies does Google Pay support through Stripe?
Google Pay through Stripe supports all currencies that Stripe supports for card payments. The currency is set in the paymentRequest configuration object.
Why does the Google Pay button not appear on my page?
Check that you are using HTTPS, the browser is Chrome, the user has a card saved in Google Pay, and canMakePayment() returns a result. Also verify Google Pay is enabled in your Stripe Dashboard.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation