# Test & go live

> Test your Google Pay integration and complete Google's production approval process.

Google Pay has two environments — `TEST` for development and `PRODUCTION` for live payments. You must complete Google's approval process before accepting real payments.

## Testing in the TEST environment

Set `environment: 'TEST'` in the `PaymentsClient` constructor to use Google's test environment. In `TEST` mode:

- No real cards are charged and no real money moves.
- Google provides pre-defined test card numbers for each card brand and outcome.
- `isReadyToPay` returns `true` regardless of whether the device has a real card enrolled.

Verify the following scenarios before submitting for production:

- **Successful payment** — Google Pay sheet appears, customer confirms, `payment.completed` fires.
- **Declined payment** — Use a test card that triggers a decline; confirm your UI handles the error gracefully.
- **Customer cancels** — Tap outside the payment sheet; confirm your checkout recovers cleanly.
- **3DS challenge** — Use a test card that triggers an additional challenge; confirm VINR handles it without action on your part.

> In the VINR sandbox, Google Pay tokens are accepted as `TEST` environment tokens automatically. You do not need to configure anything separately in the VINR Dashboard for sandbox testing.

## Going live

Before switching to `PRODUCTION`, complete the following checklist:

#### Google merchant registration

Register in the [Google Pay & Wallet Console](https://pay.google.com/business/console) with `gateway: vinr` and your VINR merchant ID. Wait for Google's approval email (typically 1–2 business days).

#### Button and brand guidelines

Confirm your implementation uses only Google-approved button styles. The `createButton` API produces compliant buttons automatically — do not restyle or replace the Google Pay logo.

#### Allowed card networks

Verify that `allowedCardNetworks` in your `paymentDataRequest` matches the networks your VINR account supports. Remove networks your account is not configured for.

#### Error handling

Ensure declined payments and cancelled sheets surface a clear message to the customer and allow them to retry with a different payment method.

#### Webhook confirmation

Fulfillment must be triggered by the `payment.completed` webhook, not by the client-side redirect. Confirm your webhook handler is live and reachable.

Once Google approves your registration, update the `PaymentsClient` constructor to `environment: 'PRODUCTION'` and deploy. No VINR Dashboard changes are needed — VINR switches to the production token flow automatically when it detects a production Google merchant ID.

## Common issues

| Symptom                                          | Likely cause                                                                         |
| ------------------------------------------------ | ------------------------------------------------------------------------------------ |
| Google Pay button does not appear                | Domain not allowlisted, or `isReadyToPay` returned false — check the browser console |
| Payment fails in production with `invalid_token` | `environment` still set to `TEST`; or merchant registration not yet approved         |
| Button rejected by Google review                 | Logo or button style does not follow Google Pay brand guidelines                     |

## See also

[Set up Google Pay](/docs/payments/payment-methods/add-payment-methods/wallets/google-pay/setup) — Dashboard configuration and API integration.

[Google Pay overview](/docs/payments/payment-methods/add-payment-methods/wallets/google-pay) — How Google Pay works with VINR.
