Register your merchant account in the Google Pay Business Console and obtain your merchantId; configure your allowed payment methods with the card networks and auth methods your processor supports.
Set the tokenizationSpecification type to PAYMENT_GATEWAY and populate gateway and gatewayMerchantId for processor-managed decryption; use DIRECT only if you handle decryption yourself with your own encryption keys.
For authMethods, include CRYPTOGRAM_3DS for transactions requiring an EMV cryptogram (device-bound tokens, higher fraud protection, liability shift) and PAN_ONLY for transactions where the raw PAN is returned without a cryptogram (desktop/browser flows, no liability shift).
In your PaymentDataRequest, set merchantInfo with merchantId and merchantName; set transactionInfo with totalPrice, totalPriceStatus (FINAL or ESTIMATED), and currencyCode.
Handle the paymentData response: parse paymentMethodData.tokenizationData.token, pass it to your payment processor's API as the encrypted payment token.
Test using the Google Pay test environment by setting environment to TEST in the PaymentsClient constructor; production requires environment to be set to PRODUCTION and your merchantId to be approved.
Known gotchas
PAN_ONLY tokens do not include an EMV cryptogram and do not provide liability shift — processors that require a cryptogram for card-present liability shift must only request CRYPTOGRAM_3DS.
DIRECT tokenization requires you to register your own encryption keys in the Google Pay Business Console and handle ECDH decryption yourself; most integrations should use PAYMENT_GATEWAY instead.
The test environment returns predictable test tokens that do not charge real cards; switching to PRODUCTION without updating the environment parameter will continue to return test tokens silently.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp