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.
Follow the setup steps in the Google Pay documentation below. The exact steps you must follow depend on the nature of your integration with Payrails. In any case, you must get your Google Pay implementation approved by Google as described in Publish your Google Pay integration. Please then ensure to configure your Google Pay merchant ID in your SDK implementation as described in Google Pay Element.
Make sure you’re sending the Google Pay-specific meta fields (found under Merchant configurations -> Meta fields on your Payrails dashboard and in the examples below) in your requests.
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 development work is required to accept payments with Google Pay.For a more flexible implementation using our SDK, you can use our Google Pay element. For your client-side implementation, see Google Pay Element.
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.
Please setup your gatewayMerchantId with Payrails before you start testing
your Google Pay integration in case of client owned Google Pay integration.
Payrails performs validations on the merchant Id we receive after decrypting
the token to ensure that we did not receive a forged token.
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. See an example below.