### Payment Method Tokenization Data Example Source: https://developers.google.com/pay/api/web/reference/response-objects This example shows a tokenized response object prepared for the 'example' gateway. It includes the type of tokenization and the generated payment method token. ```json { "type": "PAYMENT_GATEWAY", "token": "examplePaymentMethodToken" } ``` -------------------------------- ### Example Signed String Construction Source: https://developers.google.com/pay/api/web/guides/resources/payment-data-cryptography This example demonstrates the final byte-string construction for a specific sender ID ('Google') and recipient ID ('merchant:12345'), including the lengths and components as defined by the formula. ```text signedStringForMessageSignature = \x06\x00\x00\x00 || Google || \x0e\x00\x00\x00 || merchant:12345 || | \x04\x00\x00\x00 || ECv2 || \xd2\x00\x00\x00 || {"tag":"jpGz1F1Bcoi/fCNxI9n7Qrsw7i7KHrGtTf3NrRclt+U\u003d","ephemeralPublicKey":"BJatyFvFPPD21l8/uLP46Ta1hsKHndf8Z+tAgk+DEPQgYTkhHy19cF3h/bXs0tWTmZtnNm+vlVrKbRU9K8+7cZs\u003d","encryptedMessage":"mKOoXwi8OavZ"} ``` -------------------------------- ### Deferred Transaction Example Source: https://developers.google.com/pay/api/web/reference/request-objects Demonstrates how to configure a deferred transaction for a hotel room reservation. This example shows a $200 USD charge to be finalized on December 1st, 2025, with a direct integration tokenization specification. ```json # A deferred transaction for USD$200 to be charged on 2025 December 1st. { "apiVersion": 2, "apiVersionMinor": 0, "merchantInfo": { "merchantName": "Example Merchant", "merchantId": "12345678901234567890", }, "allowedPaymentMethods": [ { "type": "CARD", "parameters": { "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowedCardNetworks": ["AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA"] }, "tokenizationSpecification": { "type": "DIRECT", "parameters": { "protocolVersion": "ECv2", "publicKey": "YOUR PUBLIC KEY FOR DIRECT INTEGRATION" } } } ], "deferredTransactionInfo": { "currencyCode": "USD", "countryCode": "US", "transactionId": "example-transaction-id", "tokenUpdateUrl": "https://api.merchant.com/token/update", "managementUrl": "https://merchant.com/account/bookings", "billingAgreement": "Example localized billing agreement and terms.", "immediateTotalPrice": "0.00", "billingDateTime": "2025-12-01T08:00:00Z", "price": "200.00", "priceStatus": "FINAL", "label": "Hotel Room Reservation", } } ``` -------------------------------- ### Example Byte String Construction (Google Sender ID) Source: https://developers.google.com/pay/api/web/guides/resources/payment-data-cryptography This example demonstrates the resulting `signedStringForIntermediateSigningKeySignature` when the sender ID is 'Google' and the protocol version is 'ECv2'. It shows the concatenated byte values, including lengths and string data, formatted as specified. ```text signedStringForIntermediateSigningKeySignature = \x06\x00\x00\x00 || Google || | \x04\x00\x00\x00 || ECv2 || \xb5\x00\x00\x00 || {"keyExpiration":"1542323393147","keyValue":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/1+3HBVSbdv+j7NaArdgMyoSAM43yRydzqdg1TxodSzA96Dj4Mc1EiKroxxunavVIvdxGnJeFViTzFvzFRxyCw\u003d\u003d"} ``` -------------------------------- ### Automatic Reload Transaction Info Example Source: https://developers.google.com/pay/api/web/reference/request-objects This example demonstrates how to configure an automatic reload enrollment. It sets up a scenario where the balance is reloaded by $30 when it drops below $20. Ensure that the `tokenUpdateUrl` and `managementUrl` are valid HTTPS endpoints. ```json { "apiVersion": 2, "apiVersionMinor": 0, "merchantInfo": { "merchantName": "Example Merchant", "merchantId": "12345678901234567890" }, "allowedPaymentMethods": [ { "type": "CARD", "parameters": { "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowedCardNetworks": ["AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA"] }, "tokenizationSpecification": { "type": "DIRECT", "parameters": { "protocolVersion": "ECv2", "publicKey": "YOUR PUBLIC KEY FOR DIRECT INTEGRATION" } } } ], "automaticReloadTransactionInfo": { "currencyCode": "USD", "countryCode": "US", "transactionId": "example-transaction-id", "tokenUpdateUrl": "https://api.merchant.com/token/update", "managementUrl": "https://merchant.com/account/balance", "billingAgreement": "Example localized billing agreement and terms.", "immediateTotalPrice": "0.00", "minimumBalanceAmount": "20.00", "reloadAmount": "30.00", "label": "Gift Card Reload" } } ``` -------------------------------- ### Final Price Example in USD Source: https://developers.google.com/pay/api/web/reference/request-objects This example demonstrates how to structure the TransactionInfo object for a final price transaction in United States dollars. Ensure currencyCode and totalPrice match the actual transaction details to avoid declines. ```json "transactionInfo": { "currencyCode": "USD", "countryCode": "US", "totalPriceStatus": "FINAL", "totalPrice": "12.00", "checkoutOption": "COMPLETE_IMMEDIATE_PURCHASE" } ``` -------------------------------- ### CardInfo Example Source: https://developers.google.com/pay/api/web/reference/response-objects This snippet demonstrates the structure of the CardInfo object, showing a card on the Visa network with its associated details. ```json { "cardNetwork": "VISA", "cardDetails": "1234", "cardFundingSource": "CREDIT", "assuranceDetails": { "cardHolderAuthenticated": false, "accountVerified": true } } ``` -------------------------------- ### Example Byte String for Intermediate Signing Key Signature Source: https://developers.google.com/pay/api/web/guides/resources/payment-data-cryptography?hl=zh-CN This example shows the constructed signed string for an intermediate signing key signature, with Google as the sender ID and ECv2 as the protocol version. The byte lengths are represented in little-endian format. ```text signedStringForIntermediateSigningKeySignature = \x06\x00\x00\x00 || Google || \x04\x00\x00\x00 || ECv2 || \xb5\x00\x00\x00 || {"keyExpiration":"1542323393147","keyValue":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/1+3HBVSbdv+j7NaArdgMyoSAM43yRydzqdg1TxodSzA96Dj4Mc1EiKroxxunavVIvdxGnJeFViTzFvzFRxyCw\u003d\u003d"} ``` -------------------------------- ### Support All Available Card Networks and Authentication Methods Source: https://developers.google.com/pay/api/web/reference/request-objects Use this example to configure support for all available card networks and authentication methods. Ensure `assuranceDetailsRequired` is set to `true` if you need validation details. ```json { "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowedCardNetworks": ["AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA"], "assuranceDetailsRequired": true } ``` -------------------------------- ### Configure Monthly Subscription Request Source: https://developers.google.com/pay/api/web/reference/request-objects Sets up a monthly subscription with a fixed price, starting immediately. Ensure the currency and country codes are appropriate for your region. ```json # A monthly subscription for USD$25.00 that begins billing immediately. { "PaymentDataRequest": { "apiVersion": 2, "apiVersionMinor": 0, "merchantInfo": { "merchantName": "Example Merchant", "merchantId": "12345678901234567890" }, "allowedPaymentMethods": [ { "type": "CARD", "parameters": { "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowedCardNetworks": ["AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA"] }, "tokenizationSpecification": { "type": "DIRECT", "parameters": { "protocolVersion": "ECv2", "publicKey": "YOUR PUBLIC KEY FOR DIRECT INTEGRATION" } } } ], "recurringTransactionInfo": { "currencyCode": "USD", "countryCode": "US", "transactionId": "example-transaction-id", "tokenUpdateUrl": "https://api.merchant.com/token/update", "managementUrl": "https://merchant.com/account/subscriptions", "billingAgreement": "Example localized billing agreement and terms.", "immediateTotalPrice": "25.00", "recurrenceItems": [ { "label": "Premium Plan Monthly Subscription", "price": "25.00", "priceStatus": "FINAL", "recurrencePeriod": "MONTH", "recurrencePeriodCount": 1 } ] } } } ``` -------------------------------- ### Call create_google_pay_integration Tool with Curl Source: https://developers.google.com/pay/api/web/reference/mcp/tools_list/create_google_pay_integration This example demonstrates how to invoke the `create_google_pay_integration` tool using a `curl` command. Ensure that the `arguments` object is populated with the correct details as per the tool's MCP specification. ```bash curl --location 'https://paydeveloper.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "create_google_pay_integration", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' ``` -------------------------------- ### PaymentMethod Object for Cards Source: https://developers.google.com/pay/api/web/reference/request-objects Example of a PaymentMethod object configured to support various card payment methods and tokenization through an example gateway. This object specifies supported payment methods and their parameters. ```json { "type": "CARD", "parameters": { "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowedCardNetworks": ["AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA"] }, "tokenizationSpecification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "example", "gatewayMerchantId": "exampleGatewayMerchantId" } } } ``` -------------------------------- ### Test Gateway Configuration Source: https://developers.google.com/pay/api/web/guides/tutorial Use the 'example' gateway for testing the API flow without actual transactions. This configuration is suitable for initial integration testing. ```json { "gateway": "example", "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" } ``` -------------------------------- ### Basic Google Pay Button Configuration Source: https://developers.google.com/pay/api/web/reference/request-objects This example shows how to configure a Google Pay payment button with a click event handler. It uses default display options for the button. ```javascript { onClick: onGooglePaymentButtonClicked } ``` -------------------------------- ### PaymentDataRequest Example Source: https://developers.google.com/pay/api/web/reference/request-objects This example demonstrates a PaymentDataRequest supporting payment cards and Android device tokens for a specific gateway. It specifies allowed card networks, authentication methods, and transaction details including total price and currency. ```json { "apiVersion": 2, "apiVersionMinor": 0, "merchantInfo": { "merchantName": "Example Merchant" }, "offerInfo": { "offers": [ { "redemptionCode": "exampleCode", "description": "example description of offer" } ] }, "allowedPaymentMethods": [ { "type": "CARD", "parameters": { "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowedCardNetworks": ["AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA"] }, "tokenizationSpecification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "example", "gatewayMerchantId": "exampleGatewayMerchantId" } } } ], "transactionInfo": { "totalPriceStatus": "FINAL", "totalPrice": "12.34", "currencyCode": "USD" } } ``` -------------------------------- ### Configure Payment Gateway Tokenization Source: https://developers.google.com/pay/api/web/guides/tutorial Set up the tokenization specification for a payment gateway. Replace 'example' and 'exampleGatewayMerchantId' with your payment provider's specific values. ```javascript const tokenizationSpecification = { type: 'PAYMENT_GATEWAY', parameters: { 'gateway': 'example', 'gatewayMerchantId': 'exampleGatewayMerchantId' } }; ``` -------------------------------- ### Gateway Configuration Examples Source: https://developers.google.com/pay/api/web/reference/request-objects These snippets show the configuration for various payment gateways. Each includes a 'gateway' identifier and a 'gatewayMerchantId'. ```json "gateway": "mpgs" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mayaph" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mellifera" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "merchante" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "midtrans" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "menahel4ugocredit" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "merchantwarrior" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "minsaitpaymentsgateway" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mitecmx" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mixplat" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mobimoney" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "modulbank" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mollie" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mondido" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "monei" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "monek" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "moneris" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "moneta" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "monext" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "moneyhash" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "moneymailru" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "monripayments" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "moov" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "moyasar" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "managepay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "msolution" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mstartipg" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mulitcarta" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "multisafepay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mundipagg" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mycheck" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mycarpay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mychoice2pay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "myfatoorah" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mypay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "mypos" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "netsgroup" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "nccc" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "neolinkprocessing" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "neonpay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "netopia" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "netvalve" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "networkintl" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` -------------------------------- ### Gateway Configuration Examples Source: https://developers.google.com/pay/api/web/reference/request-objects These snippets show the configuration for various payment gateways. Each includes the gateway name and the corresponding merchant ID. Ensure you replace 'YOUR_GATEWAY_MERCHANT_ID' with your actual credentials. ```json "gateway": "paycoreio" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "corvuspay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "credit2000" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "credorax" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "crosspay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "crossswitch" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "csgforte" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "ctbcbank" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "curopayments" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "cyberbizpay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "cybersource" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "danubepay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "datatrans" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "decta" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "denovosystempay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "deuna" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "veritrans" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "dcpayments" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "digitalfinance" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "dintero" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "dlocal" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "dnapayments" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "dojo" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "dokudjakarta" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "doremitech" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "dotpay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "softwareexpress" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "easycard" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "easypay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "easypaypt" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "ebanx" "gatewayMerchantId": "YOUR_PUBLIC_INTEGRATION_KEY" ``` ```json "gateway": "ecard" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "ecartpay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "ecommmerchantsolutions" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "ecommpay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "ecopaynet" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "ecpay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "ecrypt" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` ```json "gateway": "edfapay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` -------------------------------- ### Example Byte String for Message Signature Source: https://developers.google.com/pay/api/web/guides/resources/payment-data-cryptography?hl=zh-CN This example illustrates the constructed signed string for a message signature, with Google as the sender ID and merchant:12345 as the recipient ID. The byte lengths are shown in little-endian format. ```text signedStringForMessageSignature = \x06\x00\x00\x00 || Google || \x0e\x00\x00\x00 || merchant:12345 || \x04\x00\x00\x00 || ECv2 || \xd2\x00\x00\x00 || {"tag":"jpGz1F1Bcoi/fCNxI9n7Qrsw7i7KHrGtTf3NrRclt+U\u003d","ephemeralPublicKey":"BJatyFvFPPD21l8/uLP46Ta1hsKHndf8Z+tAgk+DEPQgYTkhHy19cF3h/bXs0tWTmZtnNm+vlVrKbRU9K8+7cZs\u003d","encryptedMessage":"mKOoXwi8OavZ"} ``` -------------------------------- ### Example FULL-ISO3166 Address Object Source: https://developers.google.com/pay/api/web/reference/response-objects This example shows a FULL-ISO3166 formatted address for the United States, including multiple lines for the street address. ```json { "name": "John Doe", "address1": "c/o Google LLC", "address2": "1600 Amphitheatre Pkwy", "address3": "Building 40", "locality": "Mountain View", "administrativeArea": "CA", "countryCode": "US", "postalCode": "94043", "sortingCode": "", "iso3166AdministrativeArea": "US-CA" } ``` -------------------------------- ### Direct Integration Tokenization Specification Example Source: https://developers.google.com/pay/api/web/guides/resources/payment-data-cryptography This JavaScript object shows the structure for the tokenization specification in a direct integration, including the protocol version and the public encryption key. ```javascript const tokenizationSpecification = { "type": "DIRECT", "parameters": { "protocolVersion": "ECv2", "publicKey": "BOdoXP1aiNp.....kh3JUhiSZKHYF2Y=" } } ``` -------------------------------- ### Example Redirect URIs for Web Applications Source: https://developers.google.com/pay/api/web/guides/use-pay-wallet-mcp These are example redirect URIs for various AI applications when configuring a Web application OAuth 2.0 client. Ensure you use the correct URI for your specific application. ```text https://antigravity.google/oauth-callback https://claude.ai/api/mcp/auth_callback http://localhost:CLAUDE_REDIRECT_PORT/callback ``` -------------------------------- ### Get MCP Tool Specifications with Curl Source: https://developers.google.com/pay/api/web/reference/mcp Use this `curl` command to list all tools and their specifications available on the MCP server. Ensure the `content-type` and `accept` headers are correctly set. ```bash curl --location 'https://paydeveloper.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/list", "jsonrpc": "2.0", "id": 1 }' ``` -------------------------------- ### PaymentMethodData Example for CARD Source: https://developers.google.com/pay/api/web/reference/response-objects This object provides data for a selected payment method. For CARD type, it includes card network and details, along with tokenization data for the payment gateway. ```json { "type": "CARD", "description": "Visa\u200B\u200B••••\u200B1234", "info": { "cardNetwork": "VISA", "cardDetails": "1234" }, "tokenizationData": { "type": "PAYMENT_GATEWAY", "token": "examplePaymentMethodToken" } } ``` -------------------------------- ### SH Start High Gateway Configuration Source: https://developers.google.com/pay/api/web/guides/tutorial Use this configuration for the SH Start High gateway. Requires a gateway merchant ID. ```json { "gateway": "shstartpay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" } ``` -------------------------------- ### Get Google Pay Ready to Pay Request Source: https://developers.google.com/pay/api/web/guides/tutorial Configures the site's support for payment methods that can be processed by the Google Pay API. This function returns the necessary request object for checking readiness. ```javascript /** * Configure your site's support for payment methods supported by the Google Pay * API. * * Each member of allowedPaymentMethods should contain only the required fields, * allowing reuse of this base request when determining a viewer's ability * to pay and later requesting a supported payment method * * @returns {object} Google Pay API version, payment methods supported by the site */ function getGoogleIsReadyToPayRequest() { return Object.assign( {}, baseRequest, { allowedPaymentMethods: [baseCardPaymentMethod] } ); } ``` -------------------------------- ### OfferData Object Example Source: https://developers.google.com/pay/api/web/reference/response-objects Provides information about an offer code entered into the payment sheet. It always contains a `redemptionCodes` array, which includes all entered promotional codes, even those not yet approved. ```json "offerData": { "redemptionCodes": ["PROMOTIONALCODE"] } ``` -------------------------------- ### MerchantInfo Object Example Source: https://developers.google.com/pay/api/web/reference/request-objects Example of a merchantInfo object including the merchantName property. This is used to provide information about the merchant requesting payment data. ```json "merchantInfo": { "merchantName": "Example Merchant" } ``` -------------------------------- ### Initialize PaymentsClient for Production Source: https://developers.google.com/pay/api/web/guides/test-and-deploy/deploy-production-environment Initialize the PaymentsClient with the production environment setting. ```javascript const paymentsClient = new google.payments.api.PaymentsClient({environment: 'PRODUCTION'}); ``` -------------------------------- ### JCB Non-Tokenized Card Payload (with authMethod) Source: https://developers.google.com/pay/api/web/guides/resources/sample-tokens Example of a decrypted payload for a non-tokenized JCB card, including authentication method. Note: This example appears to have a syntax error in the source. ```json { { "gatewayMerchantId": "some-merchant-id", "messageExpiration": "1650574736277", "messageId": "AH2Ejtc88ZHJ-2aYBQWzHwvp6l0JsCHgxVt8s91A-ZUikaXNbcjsFm6gg9ExeVR-jzIyT-mJvA_ntvfRsDDOH2jnKMjdTtXIJvPt0NBUU45R7-gnjxkx-sI0ldcWvbDHsV0735yFDbWk", "paymentMethod": "CARD", "paymentMethodDetails": { "expirationYear": 2028, "expirationMonth": 12, "pan": "4111111111111111", "authMethod": "PAN_ONLY" } } } ``` -------------------------------- ### JCB Non-Tokenized Card Payload (without authMethod) Source: https://developers.google.com/pay/api/web/guides/resources/sample-tokens Example of a decrypted payload for a non-tokenized JCB card, without the authentication method specified. Note: This example appears to have a syntax error in the source. ```json { { "messageExpiration": "1507738377032", "paymentMethod": "CARD", "messageId": "AH2EjtcHYs1Ye-ZIZuZXd7eNO4QjQfZjBDtP2ti0tob_a5o22lHmGWHsBVYrrSylkFC3ZTsRdvMadQpwOGCIl7XxhTKcfElmgF7UFbcI8CeUZCWRmbTH5s7h69Baqr4FAM735VNThPiP", "paymentMethodDetails": { "expirationYear": 2028, "expirationMonth": 12, "pan": "4111111111111111" } } } } ``` -------------------------------- ### Constructor: new PaymentsClient(paymentOptions) Source: https://developers.google.com/pay/api/web/reference/client Initializes the `PaymentsClient` object, which is the entry point for interacting with the Google Pay API. It takes an optional `paymentOptions` object to configure the client. ```APIDOC ## Constructor: new PaymentsClient(paymentOptions) ### Description Initializes the `PaymentsClient` object, which is the entry point for interacting with the Google Pay API. It takes an optional `paymentOptions` object to configure the client. ### Parameters #### Optional Parameters - **paymentOptions** (object) - An object containing configuration options for the PaymentsClient. ``` -------------------------------- ### Invoke search_documentation Tool with Curl Source: https://developers.google.com/pay/api/web/reference/mcp/tools_list/search_documentation Demonstrates how to use `curl` to call the `search_documentation` MCP tool. Ensure the `arguments` field is populated according to the tool's specification. ```bash curl --location 'https://paydeveloper.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "search_documentation", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' ``` -------------------------------- ### Configure VS Code (Copilot) MCP Server Source: https://developers.google.com/pay/api/web/guides/use-pay-wallet-mcp Edit the `.vscode/mcp.json` file in your workspace to configure VS Code (Copilot) to use the Google Pay & Wallet Developer MCP server. This setup requires manual entry of OAuth client ID and secret during the first tool call. ```json { "servers": { "google-pay-wallet-dev": { "url": "https://paydeveloper.googleapis.com/mcp" } } } ``` -------------------------------- ### CardRowTwoItems Source: https://developers.google.com/pay/api/web/reference/mcp/tools_list/list_pass_classes Defines the template for a card row containing two items, aligned to the start and end. ```APIDOC ## CardRowTwoItems ### Description Defines the template for a card row containing two items, aligned to the start and end. ### Fields - **startItem** (TemplateItem) - Optional. The item to be displayed at the start of the row. This item will be aligned to the left. - **endItem** (TemplateItem) - Optional. The item to be displayed at the end of the row. This item will be aligned to the right. ``` -------------------------------- ### Initialize PaymentsClient for Test Environment Source: https://developers.google.com/pay/api/web/guides/test-and-deploy/integration-checklist Initialize a new PaymentsClient with the environment property set to 'TEST' to use a test configuration. This allows testing purchase workflow elements without using live payment information. ```javascript var paymentsClient = new google.payments.api.PaymentsClient({environment: 'TEST'}); ``` -------------------------------- ### CardRowThreeItems Source: https://developers.google.com/pay/api/web/reference/mcp/tools_list/list_pass_classes Defines the template for a card row containing three items, aligned to the start, middle, and end. ```APIDOC ## CardRowThreeItems ### Description Defines the template for a card row containing three items, aligned to the start, middle, and end. ### Fields - **startItem** (TemplateItem) - Optional. The item to be displayed at the start of the row. This item will be aligned to the left. - **middleItem** (TemplateItem) - Optional. The item to be displayed in the middle of the row. This item will be centered between the start and end items. - **endItem** (TemplateItem) - Optional. The item to be displayed at the end of the row. This item will be aligned to the right. ``` -------------------------------- ### Configure SUMIT Gateway Source: https://developers.google.com/pay/api/web/reference/request-objects Set the gateway to 'sumit' and provide your 'gatewayMerchantId' for SUMIT integration. ```json "gateway": "sumit" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` -------------------------------- ### CardRowThreeItems Structure Source: https://developers.google.com/pay/api/web/reference/mcp/tools_list/list_pass_classes Defines the template for a card row containing three items: start, middle, and end. ```json { "startItem": { object (TemplateItem) }, "middleItem": { object (TemplateItem) }, "endItem": { object (TemplateItem) } } ``` -------------------------------- ### CardRowTwoItems Structure Source: https://developers.google.com/pay/api/web/reference/mcp/tools_list/list_pass_classes Defines the template for a card row containing two items, aligned to the start and end. ```json { "startItem": { object (TemplateItem) }, "endItem": { object (TemplateItem) } } ``` -------------------------------- ### SelectionOptionData Object Example Source: https://developers.google.com/pay/api/web/reference/response-objects Represents a shipping option selected in the payment sheet. It requires an ID that matches the `SelectionOption.id`. ```json { "id": "shipping-001" } ``` -------------------------------- ### IntroductoryPeriodInfo Object Source: https://developers.google.com/pay/api/web/reference/request-objects Details about an introductory period for a recurring transaction. ```APIDOC ## IntroductoryPeriodInfo An introductory period for the recurring transaction. It's a time bound period with no recurrence. Pricing can be free or a single flat fee. ### Properties * **`introductoryPeriodStartDateTime`** (string) - Optional - The start time of the introductory service period in RFC 3339 format. It's optional for introductory periods that start immediately. Must be a RFC 3339 formatted date time. If specified, the time must be greater than the current time and before the `introductoryPeriodEndDateTime`. * **`introductoryPeriodEndDateTime`** (string) - Required - The end time of the introductory service period in RFC 3339 format. For prepaid recurring transactions, it must be contiguous with the first `RecurrencePeriodItem`. Must be a RFC 3339 formatted date time. Must be after the `introductoryPeriodStartDateTime`. Must be after the current time. The end time must be before or equal to the earliest `billingInitialDateTime` of any `RecurrencePeriodItem` in the `RecurringTransactionInfo`. * **`label`** (string) - Required - A short label for the introductory period, such as `7 Day Free Trial`. It's limited to 100 characters. * **`totalPrice`** (string) - Required - Price of the introductory period. It must be non-negative numeric with optional precision of two decimal places. It can be `0.00` for a free period. * **`displayItems`** (DisplayItem[]) - Optional - Line items that compose the introductory period. ``` -------------------------------- ### Mstartipg Gateway Configuration Source: https://developers.google.com/pay/api/web/guides/tutorial Use this configuration when integrating with Mstartipg as your payment gateway. ```json { "gateway": "mstartipg" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" } ``` -------------------------------- ### Discover Non-Tokenized Card Payload (with authMethod) Source: https://developers.google.com/pay/api/web/guides/resources/sample-tokens Example of a decrypted payload for a non-tokenized Discover card, including authentication method. ```json { "gatewayMerchantId": "some-merchant-id", "messageExpiration": "1650574781399", "messageId": "AH2EjteSxPPpbJOXKXzG1Cqkh1kzJz0UP1AG4w75n9q7gCtWsawfRlqtUZofjIBnKlbozvASxKkkdbjv2-rOfNGd_st4kFqPeb6O3IE-fXeIcHzH8x56tMRylEnfnrF6x01ET8KdUeLS", "paymentMethod": "CARD", "paymentMethodDetails": { "expirationYear": 2028, "expirationMonth": 12, "pan": "6011111111111117", "authMethod": "PAN_ONLY" } } ``` -------------------------------- ### Configure Asperato (Payonomy Limited) Gateway Source: https://developers.google.com/pay/api/web/guides/tutorial Configure your integration for Payonomy Limited (Asperato) by setting the gateway and your merchant ID. Substitute 'YOUR_GATEWAY_MERCHANT_ID' with your actual credentials. ```json "gateway": "asperato" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` -------------------------------- ### Mastercard Non-Tokenized Card Payload (with authMethod) Source: https://developers.google.com/pay/api/web/guides/resources/sample-tokens Example of a decrypted payload for a non-tokenized Mastercard card, including authentication method. ```json { "gatewayMerchantId": "some-merchant-id", "messageExpiration": "1650574585777", "messageId": "AH2Ejte23Sp0DBWqKVQ1d8ICVQialPGgXSsTT4NnCjNy3i-jdJg6B_wllO8590dFfrLg16GqGcuSrEPjl-sQZ-K8sKCL62ahwh5kzUv4ggLwioImJmuEuKfAiEQBRW0L8zlo0Nv6LFuk", "paymentMethod": "CARD", "paymentMethodDetails": { "expirationYear": 2028, "expirationMonth": 12, "pan": "5555555555554444", "authMethod": "PAN_ONLY" } } ``` -------------------------------- ### Configure Gemini CLI MCP Server Source: https://developers.google.com/pay/api/web/guides/use-pay-wallet-mcp Add this configuration to your `~/.gemini/settings.json` file to set up the Gemini CLI for the Google Pay & Wallet Developer MCP server. This enables dynamic discovery for authentication. ```json { "mcpServers": { "google-pay-wallet-dev": { "httpUrl": "https://paydeveloper.googleapis.com/mcp", "authProviderType": "dynamic_discovery", "oauth": { "enabled": true, "clientId": "GEMINI_CLI_CLIENT_ID", "clientSecret": "GEMINI_CLI_CLIENT_SECRET", "scopes": [ "https://www.googleapis.com/auth/paydeveloper.merchant", "https://www.googleapis.com/auth/paydeveloper.issuer.readonly" ] } } } } ``` -------------------------------- ### Visa Non-Tokenized Card Payload (with authMethod) Source: https://developers.google.com/pay/api/web/guides/resources/sample-tokens Example of a decrypted payload for a non-tokenized Visa card, including authentication method. ```json { "gatewayMerchantId": "some-merchant-id", "messageExpiration": "1650574736277", "messageId": "AH2Ejtc88ZHJ-2aYBQWzHwvp6l0JsCHgxVt8s91A-ZUikaXNbcjsFm6gg9ExeVR-jzIyT-mJvA_ntvfRsDDOH2jnKMjdTtXIJvPt0NBUU45R7-gnjxkx-sI0ldcWvbDHsV0735yFDbWk", "paymentMethod": "CARD", "paymentMethodDetails": { "expirationYear": 2028, "expirationMonth": 12, "pan": "4111111111111111", "authMethod": "PAN_ONLY" } } ``` -------------------------------- ### Initialize Payment Sheet with Callback Intents Source: https://developers.google.com/pay/api/web/guides/tutorial Initialize the payment sheet with required shipping address and shipping options configuration, including callback intents for dynamic updates. ```javascript const paymentDataRequest = Object.assign({}, baseRequest); paymentDataRequest.allowedPaymentMethods = [cardPaymentMethod]; paymentDataRequest.transactionInfo = getGoogleTransactionInfo(); paymentDataRequest.merchantInfo = { merchantId: '12345678901234567890', merchantName: 'Example Merchant' }; paymentDataRequest.callbackIntents = ["SHIPPING_ADDRESS", "SHIPPING_OPTION", "PAYMENT_AUTHORIZATION"]; paymentDataRequest.shippingAddressRequired = true; paymentDataRequest.shippingAddressParameters = getGoogleShippingAddressParameters(); paymentDataRequest.shippingOptionRequired = true; ``` -------------------------------- ### EventDateTime Source: https://developers.google.com/pay/api/web/reference/mcp/tools_list/list_pass_classes Represents a date and time range for an event. Used for specifying start and end times, particularly for multi-day events. ```APIDOC ## EventDateTime ### Description Represents a date and time range for an event. Used for specifying start and end times, particularly for multi-day events. ### Fields - **start** (string) - Optional. The date/time when the event starts. If the event spans multiple days, it should be the start date/time on the first day. The format is an ISO 8601 extended format date/time without an offset, and the time may be specified up to millisecond precision, e.g. 2027-03-05T06:30:00. - **end** (string) - Optional. The date/time when the event ends. If the event spans multiple days, it should be the end date/time on the last day. The format is an ISO 8601 extended format date/time without an offset, and the time may be specified up to millisecond precision, e.g. 2027-03-05T06:30:00. ``` -------------------------------- ### Configure Time Project LLC Gateway Source: https://developers.google.com/pay/api/web/reference/request-objects Integrate with Time Project LLC by setting the gateway to 'timeproject' and providing your merchant ID. ```json "gateway": "timeproject" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` -------------------------------- ### EventDateTime JSON Structure Source: https://developers.google.com/pay/api/web/reference/mcp/tools_list/list_pass_classes Defines the structure for representing event start and end times. Use this for events that have a specific duration. ```json { "start": string, "end": string } ``` -------------------------------- ### Configure TIPTOP PAY Gateway Source: https://developers.google.com/pay/api/web/reference/request-objects Use 'tiptoppay' as the gateway and provide your 'gatewayMerchantId' for TIPTOP PAY integration. ```json "gateway": "tiptoppay" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` -------------------------------- ### Get Google Offer Invalid Error Source: https://developers.google.com/pay/api/web/guides/tutorial Constructs a PaymentDataError object for an invalid offer or promo code. Used in PaymentDataRequestUpdate. ```javascript function getGoogleOfferInvalidError(redemptionCode) { return { reason: 'OFFER_INVALID', message: redemptionCode + ' is not a valid promo code.', intent: 'OFFER' }; } ``` -------------------------------- ### Configure Splitit Gateway Source: https://developers.google.com/pay/api/web/reference/request-objects To use Splitit, set the gateway to 'splitit' and provide your 'gatewayMerchantId'. ```json "gateway": "splitit" "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID" ``` -------------------------------- ### Configure PaymentOptions for Test Environment Source: https://developers.google.com/pay/api/web/reference/request-objects Use this configuration for testing purposes. It includes merchant information and payment data callbacks for dynamic price updates. ```javascript { environment: "TEST", merchantInfo: { merchantName: "Example Merchant", merchantId: "12345678901234567890" }, paymentDataCallbacks: { onPaymentDataChanged: onPaymentDataChanged, onPaymentAuthorized: onPaymentAuthorized } } ```