Overview of Google Pay Merchant SDK
Stay organized with collections
Save and categorize content based on your preferences.
The Google Pay Merchant SDK (or Google Pay SDK) is a toolkit that enables
developers to integrate their applications with Google Pay for accepting
payments online. Users making purchases on the developers’ apps can make
payments easily and conveniently.
The SDK can be integrated directly by the merchant into their app, or it may be
bundled into the SDK provided by their Payment Gateway (PG) . If you are a
merchant with an existing PG SDK, check with your PG if the Google Pay SDK
functionality can be provided within that PG SDK.
High level Google Pay SDK flow

- Merchant app integrated with Google Pay SDK calls the
IsReadyToPay
API to check
if the user device is ready to pay with Google Pay. Assume the device is
ready.
- Merchant app calls the
loadPaymentData
API
with the required input, which is passed on to Google Pay.
- Google Pay user selects from available payment methods, and authenticates
the payment. The Google Pay server backend is called with instructions to
execute the payment.
- The Google Pay server makes the payment call, either to the merchant’s PG or
to the user’s PSP (Payment Service Provider). The former is used for card
payments and for merchants who have UPI payments set up through their PG,
while the latter is for cases where the merchant wants to integrate with UPI
directly through Google Pay.
- The payment status is returned to the Google Pay server.
- The Google Pay client receives the state, and displays it in the UI that is
rendered on the merchant app.
The Google Pay SDK reverts control to the merchant app. In cases where the
merchant’s PG has provided a response bundle for the merchant, this is
included in the gatewayResponse
field.
- The Google Pay response can be used for an initial check of payment
parameters such as the amount, transaction ID, and payee VPA.
To check the payment status, the merchant needs to do the following:
- Verify the authenticity of
gatewayResponse
, if the field is
populated.
- Call their PG or acquiring PSP for status, if the
gatewayResponse
field is not populated.
The merchant displays the payment status and next steps for fulfilment in
the merchant app.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-16 UTC.
[null,null,["Last updated 2024-10-16 UTC."],[[["\u003cp\u003eThe Google Pay Merchant SDK allows developers to integrate Google Pay into their apps for seamless online payments.\u003c/p\u003e\n"],["\u003cp\u003eMerchants can integrate the SDK directly or through their Payment Gateway's SDK.\u003c/p\u003e\n"],["\u003cp\u003eThe SDK facilitates payment by enabling users to select payment methods within the app and authenticating securely via Google Pay.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Pay server processes the payment through the merchant's Payment Gateway or the user's Payment Service Provider.\u003c/p\u003e\n"],["\u003cp\u003eMerchants receive payment status and details for verification and order fulfillment.\u003c/p\u003e\n"]]],["The Google Pay SDK enables developers to integrate Google Pay into their apps for online payments. The merchant app uses the `IsReadyToPay` API to check device readiness and then calls `loadPaymentData`. Google Pay processes the user's payment selection and authentication, then initiates the payment either through the merchant's Payment Gateway (PG) or directly with the user's Payment Service Provider (PSP). Payment status is relayed back to the merchant app, where it is displayed and used for further actions. The merchant must then verify the response and check payment status with the PG or PSP.\n"],null,["# Overview of Google Pay Merchant SDK\n\nThe **Google Pay Merchant SDK** (or **Google Pay SDK**) is a toolkit that enables\ndevelopers to integrate their applications with Google Pay for accepting\npayments online. Users making purchases on the developers' apps can make\npayments easily and conveniently.\n\nThe SDK can be integrated directly by the merchant into their app, or it may be\nbundled into the SDK provided by their Payment Gateway (PG) . If you are a\nmerchant with an existing PG SDK, check with your PG if the Google Pay SDK\nfunctionality can be provided within that PG SDK.\n\nHigh level Google Pay SDK flow\n------------------------------\n\n1. Merchant app integrated with Google Pay SDK calls the [`IsReadyToPay`](/pay/india/api/merchant-sdk/reference/api#isreadytopay) API to check if the user device is ready to pay with Google Pay. Assume the device is ready.\n2. Merchant app calls the [`loadPaymentData`](/pay/india/api/merchant-sdk/reference/api#loadpaymentdata) API with the required input, which is passed on to Google Pay.\n3. Google Pay user selects from available payment methods, and authenticates the payment. The Google Pay server backend is called with instructions to execute the payment.\n4. The Google Pay server makes the payment call, either to the merchant's PG or to the user's PSP (Payment Service Provider). The former is used for card payments and for merchants who have UPI payments set up through their PG, while the latter is for cases where the merchant wants to integrate with UPI directly through Google Pay.\n5. The payment status is returned to the Google Pay server.\n6. The Google Pay client receives the state, and displays it in the UI that is rendered on the merchant app.\n7. The Google Pay SDK reverts control to the merchant app. In cases where the\n merchant's PG has provided a response bundle for the merchant, this is\n included in the `gatewayResponse` field.\n\n 1. The Google Pay response can be used for an initial check of payment parameters such as the amount, transaction ID, and payee VPA.\n 2. To check the payment status, the merchant needs to do the following:\n\n - Verify the authenticity of `gatewayResponse`, if the field is populated.\n - Call their PG or acquiring PSP for status, if the `gatewayResponse` field is not populated.\n8. The merchant displays the payment status and next steps for fulfilment in\n the merchant app."]]