> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revolv3.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Google Pay

> Accept Google Pay payments through Revolv3 using gateway-based tokenization (PAYMENT_GATEWAY). Includes Worldpay (Vantiv) examples, environment setup, and architecture diagrams.

## Using Google Pay with Revolv3

Revolv3 supports **gateway-based Google Pay tokenization**.\
You must use:

```javascript theme={null}
type: 'PAYMENT_GATEWAY'
```

Revolv3 does **NOT** support `DIRECT` tokenization for Google Pay.

***

## Architecture Overview

```mermaid theme={null}
sequenceDiagram
    participant Customer
    participant Browser
    participant Google
    participant Revolv3
    participant Processor

    Customer->>Browser: Click Google Pay
    Browser->>Google: loadPaymentData()
    Google-->>Browser: GooglePayPaymentDataResponse
    Browser->>Revolv3: Send full response
    Revolv3->>Processor: Forward encrypted token
    Processor-->>Revolv3: Authorization result
    Revolv3-->>Browser: Sale response
```

**Key Point:**\
Google encrypts the token for your **processor**.\
Revolv3 forwards the encrypted payload.\
The processor decrypts and authorizes it.

***

## Prerequisites

* Google Pay enabled on your Revolv3 merchant account
* Processor supports Google Pay (Worldpay, Adyen, Nuvei, etc.)
* Google Pay enabled on your processor account
* Use `PAYMENT_GATEWAY` tokenization

***

## Tokenization Setup (Worldpay Example)

### Correct Configuration

```javascript theme={null}
const tokenizationSpecification = {
  type: 'PAYMENT_GATEWAY',
  parameters: {
    gateway: 'vantiv',  // Worldpay uses 'vantiv'
    'vantiv:merchantPayPageId': 'YOUR_PAYPAGE_ID',
    'vantiv:merchantOrderId': 'ORDER123',
    'vantiv:merchantTransactionId': 'TX123',
    'vantiv:merchantReportGroup': 'report-group'
  }
};
```

#### Why `vantiv`?

Worldpay’s Google Pay gateway identifier is:

```javascript theme={null}
gateway: 'vantiv'
```

It is **not** `'worldpay'`.

Using the wrong gateway value will cause processor token registration failures.

***

## Environment Configuration

### TEST

```javascript theme={null}
environment: 'TEST',
merchantId: '01234567890123456789'
```

* Google shared test merchant ID
* Use processor TEST credentials
* Use Revolv3 sandbox/UAT

### PRODUCTION

```javascript theme={null}
environment: 'PRODUCTION',
merchantId: 'YOUR_GOOGLE_BUSINESS_CONSOLE_ID'
```

You must:

* Register in Google Pay Business Console
* Verify domain
* Use production processor credentials
* Use Revolv3 production API

***

## Sale Request Example

Send the **entire** GooglePayPaymentDataResponse as a JSON string.

```json theme={null}
{
  "IncludeRawProcessorResponse": true,
  "PaymentMethod": {
    "GooglePay": {
      "GooglePayPaymentDataResponse": "{...full Google response JSON...}"
    },
    "BillingFullName": "Joe Smith",
    "BillingAddress": {
      "AddressLine1": "381 Forest Ave",
      "City": "Laguna Beach",
      "State": "CA",
      "PostalCode": "92651",
      "Country": "US"
    }
  },
  "Invoice": {
    "MerchantInvoiceRefId": "ORDER-12345",
    "Amount": {
      "Currency": "USD",
      "Value": "12.20"
    }
  }
}
```

POST to:

```text theme={null}
/api/payments/sale
```

***

## Common Processor Error

### "Unable to register low-value Google Pay token"

Caused by:

* Using `DIRECT` instead of `PAYMENT_GATEWAY`
* Wrong `gateway` value (must be `'vantiv'` for Worldpay)
* Wrong merchant credentials
* Environment mismatch

***

## Environment Alignment Matrix

| Google Pay | Revolv3     | Processor  |
| ---------- | ----------- | ---------- |
| TEST       | Sandbox/UAT | Test       |
| PRODUCTION | Production  | Production |

Mismatch will cause processor failures.

***

## Script Examples

Revolv3 provides:

* Google Pay HTML demo examples
* Sandbox testing pages
* Script-based examples for Worldpay (Vantiv)
* TEST/PRODUCTION toggle examples

Contact Revolv3 Support if you need:

* A working HTML prototype
* Worldpay-specific script example
* Processor credential guidance

***

## Best Practices

1. Always use `PAYMENT_GATEWAY`
2. Use `gateway: 'vantiv'` for Worldpay
3. Send full GooglePayPaymentDataResponse
4. Align environments
5. Test in sandbox before production

***

## Additional Resources

* [Google Pay Web Docs](https://developers.google.com/pay/api/web/overview) — Official Google Pay API documentation
* Contact Revolv3 Support for enablement

## Next Steps

* **[Using Apple Pay](/docs/core-concepts/paymentmethod/using-applepay)** — Learn about Apple Pay integration
* **[Create a Payment Method](/docs/core-concepts/paymentmethod/paymentmethod-guide)** — Store and reuse payment methods
* Contact Revolv3 Support to enable Google Pay for your account
