Google Pay button in React and Next.js: GooglePayButton, the gateway token and a Server Action

Google's own React component, @google-pay/button-react, puts the official Google Pay button on your page and opens the payment sheet. What it hands back is an encrypted token for your payment gateway, not a payment: your server still has to send that token to Adyen, Checkout.com or whichever gateway you use. This page wires it up in the Next.js App Router with a Server Action, keeps the gateway part in one small file you swap, and then puts the button above the animated 3D card form so buyers without Google Pay can still pay by card.

Credit Card Checkout V1, preview

By buying you agree to the Terms.

Ready forCursorv0Lovableshadcn CLI

Full product pageReact · Tailwind · TypeScript