Use the following checklist to ensure you've completed all the required steps in your web integration.
About the test environment
A Google Pay API test configuration doesn't return live and chargeable payment information, it allows you to test elements of your purchase workflow. The following are testable elements:
- Confirmation pages
- Receipts
- Billing address (optional)
- Billing phone number (optional)
- Shipping address (optional)
- Email address (optional)
To use a test environment with an example payment data response, initialize a new PaymentsClient
with a JavaScript object that contains an environment property set to TEST
.
var paymentsClient = new google . payments . api . PaymentsClient ({ environment : 'TEST' });
Test with your browser's developer console
Test your website on the latest version of a supported browser. To do so, open your browser's developer tools to view console messages related to your website. The messages include errors or warnings from the Google Pay API JavaScript client library. The Google Pay API supports Google Chrome, Mozilla Firefox, Apple Safari, Microsoft Edge, Opera, and UCWeb UC Browser.
Additional errors might display in the Google payment selection dialog window after you call loadPaymentData()
. When
you click Continue
or OK
after you view the error message, it might return
additional details in the rejected Promise
handled by your site.
Test on a compatible device
While the Google Pay API is available in many markets, tokenized cards are only available in a subset of countries. If the tokenized cards are set as an allowed payment method, test them on an Android device with Chrome for Android version 59 or greater and Google Play services version 16.0.0 or greater. If your payment method is supported in your country and by your issuing bank, test with a card stored in the Google Pay app.
To view Chrome for Android console errors and warnings, test with remote debugging from Chrome for Desktop
. For more information about possible errors, view
the logs from your Android device. You might be able to view error logs with the Logcat tool window in Android Studio
, with the adb logcat command-line tool
, or inside an Android bug report
. To view error messages related to the
Google Pay API, search for WalletMerchantError
.
The following is a code sample:
adb logcat -s WalletMerchantError
Test your integration
Before you submit your integration to Google for validation with a PaymentsClient
configured for a TEST
environment, ensure that you've fulfilled the exit criteria
for each of the following functional and branding checks.
1. Basics
PAN_ONLY
transactions.DIRECT
tokenizationSpecification
type
integration, you must annually rotate
your public encryption key and provide PCI Attestation to Google using the Google Pay & Wallet Console
. PCI
Attestation can be submitted by a third-party or Qualified Security Assessor certified by the PCI Security Standards Council
, and approved by an Approved Vendor
or Qualified Assessor
.2. Brand tests
isReadyToPay()
function.3. Functional tests
loadPaymentData()
is called synchronously when you click the Google Pay
payment button, and that it maintains the browser's user activation behavior that allows the
Google Pay API to display a payment sheet. Validate that the Google Pay payment sheet isn't
blocked by pop-up blockers.When you request the CARD
payment method type with PAN_ONLY
card authentication, complete the following steps to perform the cards on file test:
- If applicable, remove all cards on file from
pay.google.com
. - Return to your integration.
- Click Google Pay .
- Validate that you see the option to add a card.
- Add a card from a supported network, as defined in
parameters.allowedCardNetworks
. - Validate that you see the added card with a network logo in the selector.
The following test is only applicable for Chrome on Android.
When you request the CARD
payment method type with CRYPTOGRAM_3DS
card authentication, complete the following steps to perform the Android device token test:
- Check that your card issuer is supported , and add an eligible card in the Google Pay Android application .
- Return to your integration.
- Click the Google Pay payment button.
- Validate that you see the added card, with card art, in the chooser.
If you confirm that your processor supports 3D-Secure card authentication, you can proceed, even if an Android device token isn't available to you as an Android user or cardholder.
If you require a shipping address, test the processing of the shipping address in varied states of completion, such as the following:
- Variances on a full name to be parsed into structured fields, such as "John," "John Doe," and "Jane Doe Smith."
- Accurately parse all address lines returned by the Google Pay API, which may exceed the total number of address lines typically collected in your standard checkout flow.
- Verify that the returned country component of the address matches your site's supported shipping destinations . If you specified shipping restrictions, test them: enter an unsupported shipping address that isn't allowed in our payment sheet and see if the restrictions work.
If you've implemented support for Authorize Payments, verify the following:
- When a payment authentication fails, it returns an
ERROR
transactionState
andPaymentDataError
with thePAYMENT_AUTHORIZATION
intent.
If you've implemented support for Dynamic Price Updates, complete the following steps:
- Add a card and address details in the payment sheet.
- Update the shipping options, order list, and total price.
- Add and select a shipping address.
- Update the shipping options, order list, and total price.
- Select a shipping option.
- Update the order list and total price.
- Validate your results:
- If the shipping address doesn't have available shipping options, validate that you get
PaymentDataError
with theSHIPPING_ADDRESS
intent. - If the selected shipping option is invalid, validate that you get
PaymentDataError
with theSHIPPING_OPTION
intent. - If the payment authentication fails, validate that you get
ERROR
transactionState
andPaymentDataError
with thePAYMENT_AUTHORIZATION
intent.