Google Pay

1 Introduction

Google Pay™ (formerly Android Pay) is a digital wallet, which enables simple and fast card payments, without the need to enter the card data for each payment. The card data is safely stored by Google. This payment method is available for all devices (mobile phones and computers), irrespective of the operating system and web browser.

In case of Google Pay usage, Acceptor is obligated to comply with the provisions of the following regulations.

Note: the description below applies to provision of this service directly by displaying the Google Pay lightbox at the website of payment recipient (e-store) or in the mobile application.

If you wish to offer this method via PayU hosted payment page, no additional integration effort is required.

2 Integration

2.1 Web integration

To integrate the website with the Google Pay method, proceed according to the instructions placed at this website:

The gateway parameter in the script should have the constant value of payu, according to the example below:

                const tokenizationSpecification = {
                  type: 'PAYMENT_GATEWAY',
                  parameters: {
                    'gateway': 'payu',
                    'gatewayMerchantId': '[Point of Service Id (pos_id)]'

The value of the gatewayMerchantId parameter should be the identifier of the payment point where the order is made.

Please note that PayU as the processor of Google Pay payments enables the handling of all types of payment cards issued by the Visa and MasterCard organizations (including Maestro). This implies the following configuration of the Google script:

                const allowedCardNetworks = ['MASTERCARD', 'VISA'];
                const allowedCardAuthMethods = ['PAN_ONLY', 'CRYPTOGRAM_3DS'];

In response, Google shall return the PaymentData item, and the field paymentMethodData.tokenizationData.token shall contain a safely encrypted Google Pay Token (a string of characters).

A sample Google Pay Token looks like this:

                    "signature": "MEUCIQDY3wBQyHB4sZcktRoJXKxm+OLcjHzCvdDeGn23oX0kkwIgKznRFZZL+sDMv1b5cuD+YurXMZraYBsr9hbravVY5Ro\u003d",
                    "protocolVersion": "ECv1",
                    "signedMessage": "{\"encryptedMessage\":\"cI87tLqzqTGyCFnMMCVWcTHw3xhYIK+CEnuQ74K+nlLpCgOlfpScib9jds4sxDtN6CunCqCSMfd/3yHeeRy6aCx1yyqcT4ey6NueeBznprJpkmVVgI1JHWLQt4hzAXMUAcYASYLOabKP9fUZvHkOBDytD531jpzNXa+Spc/zrpGzFKx2C4VU9sC95q9i+ey+kr7ZMNVCOFJPWXu7lKZ105IOOqozJ6/70MKmxP3jM89eeq+/19QnyHjQLXfnQPvQjiUJKGCcRKDLlrb3XoY5ZUUzGfN5eZCLzCVg0hWEbwU+6J7KWYJyW+Wr1r8bagN9zWsrMKhDpsQbHfyzb+yBzFUoxeUgL4a7FeVvEllIcHtqsvTCf6FENV20aF5VLDv5qzUkV+PzTAIbFEuabA0God9UbVCVVv7nM8QFzvRPhzYYFVFTn4JHvL2qZ4pAR9lE+w\\u003d\\u003d\",\"ephemeralPublicKey\":\"BPHLC4sBHpenY1M0ixmiDMuWJTaTJOqggRUwtgBJMcBp28VsxHD7zPI7985x4F5EjMP5y8j/cuUzbe/cGPjOKGk\\u003d\",\"tag\":\"RaXrPOUuc5iw3oxDa0C2MOjaKxgxIRQvwOspmtFV0zU\\u003d\"}"

2.2 Android integration

For mobile applications, native Google Pay integration is recommended, as Google Pay does not support WebView mode.

To integrate the mobile application with the Google Pay method, proceed according to the instructions placed at this website:

To make the integration easier, use the technical documentation for the PayU | Mobile SDK.

3 Order

To charge the payment card stored under Google Pay, in the request OrderCreateRequest place an extended item of payMethods.

The item payMethods.payMethod must contain the authorizationCode field, whose value is the GooglePay Token parameter, coded with the Base64 function. The field payMethod.value should have the ap value, and the field payMethod.type - the PBL value.

                "payMethods": {
                    "payMethod": {
                        "value": "ap",
                        "type": "PBL",

Further processing of the request is subject to the standard process, which is described under REST API.

Please note that it may be necessary to handle a redirect of the request to the 3D Secure authentication page.

As the orders paid with the Google Pay method shall be settled just as standard card payments, it is worth considering the integration of the service transaction data retrieve. In this manner, you will be able to differentiate cards entered through the PayU form from cards downloaded from Google Pay.

4 Error codes in Google Pay

List of standard errors returned by Google Pay lightbox can be found on the Google Developers site.

In addition following errors may occur:

StatusCode CodeLiteral Code Description
Google Pay token was created for different point of sale.
Point of sale IDs used in OrderCreateRequest and in the gatewayMerchantId field must match.
  • "Nieoczekiwany błąd po stronie programisty - spróbuj ponownie później" - returned e.g. if parameter environment is specified as "PRODUCTION" for POS from the Sandbox environment.

5 Sandbox

The Google Pay payment method is available also under the Sandbox environment – during the integration process, openly indicate the test environment:

                var paymentsClient = new google.payments.api.PaymentsClient({environment: 'TEST'});

As Google Pay is not the default payment method, please contact our IT support department after registration in the Sandbox environment, but before commencing integration with the use of the Google Pay method.