Google Pay

Google Pay is a mobile payment and digital wallet service. With Google Pay, consumers can enjoy a seamless checkout experience, eliminating the need to enter payment and shipping information manually.

Introduction

Google Pay is a widely used mobile payment solution that offers a convenient and secure way for customers to pay for goods and services. Integrating Google Pay with Payrails allows you to provide a fast, easy-to-use payment option for your customers while leveraging our platform to route the payment to any Payment Service Provider (PSP). This guide will explain the process of integrating Google Pay into your app or website using Payrails.

Pre-requisites

In order to start using Google Pay with Payrails, you must:

  1. Integrate with Payrails using one of our SDKs or our API
  2. Configure a new integration account for cards via one of the following Payment Service Providers:
    Stripe, Checkout.com or Adyen
  3. Enable Google Pay as a payment option.
  4. Make sure you're sending the provider specific card meta fields (found under Merchant configurations -> Meta fields on your Payrails dashboard and in the examples below) in your requests.
  5. Follow the setup steps in the Google Pay documentation below:

Google Pay on Android Devices

Google Pay on the Web

Ways to integrate

Payrails SDK

The simplest way to use Google Pay with Payrails is to use our drop-in in your checkout flow. With this integration type, no additional work is required to accept payments with Google Pay.

For a more flexible implementation using our SDK, you can use our Google Pay element. See special instructions here for your client-side implementation.

Server-to-server integration

You also have the option to completely manage your own client-side implementation, and use Payrails APIs with a server-to-server integration to process payments with Google Pay. With this approach, follow the Google documentation linked above to build Google Pay into your applications.

Pass Google Pay configuration in lookup response to Google Pay SDK

With a server-to-server integration, you can call our lookup payment options endpoint to get available payment options and relevant configurations for each payment method. You can get allowedAuthMethods and allowedCardNetworks from the response here and pass it to the Google Pay SDK. Please contact your Payrails representative during the onboarding phase in order to set these configurations before going live.

{
  "name": "lookup",
  "actionId": "bd879370-6935-4ff2-872e-fdb0c5ce3024",
  "executedAt": "2023-06-12T07:53:09.360484718Z",
  "data": {
    "paymentCompositionOptions": [
      {
        "integrationType": "api",
        "paymentMethodCode": "googlePay",
        "description": "GooglePay",
        "config": {
          "parameters": {
            "allowedAuthMethods": [
              "PAN_ONLY",
              "CRYPTOGRAM_3DS"
            ],
            "allowedCardNetworks": [
              "MASTERCARD",
              "VISA",
              "AMEX",
              "DISCOVER"
            ]
          },
          "tokenizationSpecification": {
            "parameters": {
              "gateway": "payrails",
              "gatewayMerchantId": "EXAMPLE_MERCHANT_ID"
            },
            "type": "PAYMENT_GATEWAY"
          },
          "type": "CARD"
        }
      }
    ]
  },
  "links": {
    "execution": "https://payrails-api.staging.payrails.io/merchant/workflows/payment-acceptance/executions/2ef29a74-d1ae-4fa5-a1d9-84e2cd710c23",
    "authorize": {
      "method": "POST",
      "href": "https://payrails-api.staging.payrails.io/merchant/workflows/payment-acceptance/executions/2ef29a74-d1ae-4fa5-a1d9-84e2cd710c23/authorize"
    }
  }
}

Pass Google Pay payment token in request to authorize payment with Payrails

When you initiate a transaction with the Google Pay SDK, a Payment Token (paymentMethodData.tokenizationData.token) containing a JSON-formatted string is sent to the merchant app. Pass the paymentMethodData.tokenizationData.token in your call to our authorize a payment endpoint. It will look something like this:

{
  "signature": "MEYCIQDTe92wpG6OUgxJ/8Qnr36XzSgjGGCM7R3LwxjgwPYMTAIhAJDrjHG9wEm1BxVM6MMMB+jGTGpi3VScEMVbHIUsObFi",
  "protocolVersion": "ECv1",
  "signedMessage": "{\"encryptedMessage\":\"FY8w/U3IbdsZQovX8ufNGFDOePgc/genRiMjHyvuIBqLY4a6uPz7wI0ra31K6YbFJlAnCjFhTwSvDxAYXw6hlmI8sESO5eM1eZlzfP3+NoKV80OXKvOM/xI/qOQEqpEQEVXx6Bw2EpMMFW8yBaA8XPUNee3EJlUk+/f8lRdRcNmI65QKPLAzUnySo75HzBkSc5It/8/oXdYwR93/K6HRKGZuD+bIaxy3SUvC9ehQqhBoP+A34yQX1knfJ1qjBMhhVVcPZHi+Bg6LXA4ms/lfDdim6D1Epr6XQhc2h4RZ/dT+6Enn81s/8ym+jMMs8kqsW9ib8vkdTARv9AbUu7zeGPrKTCAxwc1n6joRR72dSnNCI9j9sxd9tkuC9wuRyDmjbWT+hRZgLc1v/xzzNImo3NxdKdaPzKBE3t9XQZY5fp3lZELaoXAuxAZYtZ7bX64Mz9c28wD8EM+krvfbmGMiBjIt8EfeH48/SjeaUKfDu+yQnjPJAKbDZPhKJ1jqlY/ChP0Om7spQacT86QUVK/DwfzukwvwwRJkWydNEac5fgfS2T6ToZ+PW4VHbxkDnY/h+B0uwdlNQIL2a3Ar5Q\\u003d\\u003d\",\"ephemeralPublicKey\":\"BGkK4bSvob+e7ZgaNV/4vSJYYa10OJzd3aUk9yPEP6iNBRcfHiD/NTvhKjN4P24l0tEzH3L8TrySl6AczPJpCkw\\u003d\",\"tag\":\"xGEhEfJESIyBSfq2fExWiZxNWelnm3m4i8P7cgsarqg\\u003d\"}"
}
       

You can then make a request to our authorize a payment endpoint with googlePay as the paymentMethodCode and including the Google Pay token in the paymentToken field. See an example below.

{
  "amount": {
    "value": "12.50",
    "currency": "EUR"
  },
  "meta": {
    "shippingType": "Delivery"
  },
  "returnInfo": {
    "success": "https://mysuccessurl.com"
  },
  "paymentComposition": [
    {
      "integrationType": "api",
      "amount": {
        "value": "12.50",
        "currency": "EUR"
      },
      "paymentInstrumentData": {
        "paymentToken": "{\"signature\":\"MEUCIQCjP8Zv1M0Vzc02uwVuOhAOIfdr7..."
      },
      "storeInstrument": false,
      "paymentMethodCode": "googlePay"
    }
  ]
}

Supported regions / countries

Region(s)Countries
EuropešŸ‡¦šŸ‡¹ Austria, šŸ‡§šŸ‡Ŗ Belgium, šŸ‡§šŸ‡¬ Bulgaria, šŸ‡­šŸ‡· Croatia, šŸ‡ØšŸ‡¾ Cyprus,
šŸ‡ØšŸ‡æ Czech Republic, šŸ‡©šŸ‡° Denmark, šŸ‡ŖšŸ‡Ŗ Estonia, šŸ‡«šŸ‡® Finland, šŸ‡«šŸ‡· France,
šŸ‡©šŸ‡Ŗ Germany, šŸ‡¬šŸ‡® Gibraltar, šŸ‡¬šŸ‡· Greece, šŸ‡­šŸ‡ŗ Hungary, šŸ‡®šŸ‡ø Iceland,
šŸ‡®šŸ‡Ŗ Ireland, šŸ‡®šŸ‡¹ Italy, šŸ‡±šŸ‡» Latvia, šŸ‡±šŸ‡® Liechtenstein, šŸ‡±šŸ‡¹ Lithuania,
šŸ‡±šŸ‡ŗ Luxembourg, šŸ‡²šŸ‡¹ Malta, šŸ‡³šŸ‡± Netherlands, šŸ‡³šŸ‡“ Norway, šŸ‡µšŸ‡± Poland,
šŸ‡µšŸ‡¹ Portugal, šŸ‡·šŸ‡“ Romania, šŸ‡øšŸ‡° Slovakia, šŸ‡øšŸ‡® Slovenia, šŸ‡ŖšŸ‡ø Spain,
šŸ‡øšŸ‡Ŗ Sweden, šŸ‡ØšŸ‡­ Switzerland, šŸ‡¬šŸ‡§ UK, others..
North and Central AmericašŸ‡ŗšŸ‡ø USA, šŸ‡²šŸ‡½ Mexico, šŸ‡ØšŸ‡¦ Canada, šŸ‡µšŸ‡· Puerto Rico, others..
South AmericašŸ‡§šŸ‡· Brazil, others..
Africa-
Asia PacificšŸ‡¦šŸ‡ŗ Australia, šŸ‡­šŸ‡° Hong Kong, šŸ‡ÆšŸ‡µ Japan, šŸ‡²šŸ‡¾ Malaysia, šŸ‡³šŸ‡æ New Zealand,
šŸ‡øšŸ‡¬ Singapore, šŸ‡¹šŸ‡­ Thailand, šŸ‡¦šŸ‡Ŗ UAE, others..

Supported workflows and services

WorkflowSupported
Available via Payrails SDKāœ”ļø
Available via Payrails APIāœ”ļø
Delayed / Manual Captureāœ”ļø
Instant Captureāœ”ļø
Cancel / Voidāœ”ļø
Refund / Reverseāœ”ļø
Save Instrumentsāœ”ļø
Merchant Initiated Transaction (MIT)āœ”ļø
InteroperabilityPSP tokens, Network tokens