Google Pay™ via API

Use Google Pay™ with our Payment Gateway API.

This page gives instructions for setting up Google Pay™ using our Payment Gateway API. This option lets a customer use any payment method stored in their Google account. When selected, Google returns a payment token that you can use in lieu of card details, providing your customers another safe and easy option for payment.

Using Google Pay™ through our API provides the following benefits:

  • Versatile - Supported on all major web browsers. (Maast does not currently support Android integrations.)
  • Flexible - The Google Pay™ token can be used in Authorize, Sale, Credit, and Tokenize transactions.
  • Secure - Maast is a PCI DSS certified Level 1 compliant Service Provider and forces HTTPS on all inbound connections.


Before integrating Google Pay™ with Payment Gateway API, ensure you have performed these steps:

  1. Follow the instructions in the Maast Get Started guide to create a sandbox account, copy your Maast merchant ID (MID), and copy your sandbox API security key.
  2. Use the Maast Authentication guide to format the credentials and generate your API token.
  3. Follow the Maast API: Quick Start guide to set up a basic sale transaction.
  4. Review the Google Pay™ for Payments web documentation.
  5. Enroll in Google Pay™:

Once Maast Support has enabled Google Pay™, follow the instructions in the next section to integrate it.


Perform these steps to integrate Google Pay™ with our Payment Gateway API:

  1. Follow the steps in the Google Pay™ for Payments Tutorial, making modifications to the steps as described below:

    • Modification to Step 2: Request a payment token for your payment provider:
      Replace example with qualpay. Replace exampleGatewayMerchantId with your Maast Merchant ID (MID). See the sample code below:

      const tokenizationSpecification = {
        type: 'PAYMENT_GATEWAY',
        parameters: {
          gateway: 'qualpay',
          gatewayMerchantId: 'Your Maast MID'
    • Modification to Step 3: Define supported payment card networks:
      Only include the card types enabled for your Maast account. See the sample code below:

      const allowedCardNetworks = ["AMEX", "DISCOVER", "JCB","MASTERCARD", "VISA"];
      const allowedCardAuthMethods = ["PAN_ONLY"];

      If you are unsure which cards types are enabled for your account, perform these tasks to find enabled card types:

      • Follow the steps in Create a Sandbox Account to log in to the Maast merchant portal.
      • Select 'Administration' from the left-hand menu.
      • Under 'Account Configuration,' select 'Merchant Details.'
  2. Optionally, add a request object for a billing address. When you do so, Google will return the customer's billing address in the response object, and you can use it in your Maast API request or elsewhere. See the BillingAddressParameters section in Google Pay™ reference for more information, and see the sample code below:

      "format": "MIN"
  3. Complete the request. Google will response with a payment token.

  4. Save the payment token and use it in the payload_google_pay field of your Maast Payment Gateway API request.

  5. Ensure you have completed the Google Pay for Payments integration checklist and have followed its brand guidelines before going live.

Test and Go Live

Perform these tasks to test Google Pay™ transactions via API:

  • Get Google Pay™ test cards from the Google Pay for Payments test card suite.
  • See our Test and Go Live guide to test your API integration and to start transacting with an active production account.