Skip to main content

Hosted Checkout

The easiest way to use Google Pay is by using the Dintero checkout solution, where we handle the whole payment flow for you. If you are already using Dintero checkout you just need to enable Google Pay.

Getting started

To use Google Pay as a payment method you have to ensure you follow Google Pay APIs Acceptable User Policy and accept Google Pay APIs Terms of Service.

You also have to set up a Dintero account.

Enable Google Pay on your Dintero account

During your onboarding, Google Pay will generally be enabled as a payment method by default. If it's not enabled, you can go to settings and payment methods. There you can enable Google Pay as a payment method for your account. If you use payment profiles ensure that Google Pay is added to the relevant profiles.

Authentication methods

Google Pay can provide both cards on file (PAN_ONLY) or device tokens (CRYPTOGRAM_3DS). Device tokens are bound to an Android device and authenticated with a 3-D Secure cryptogram. Both authentication methods are supported for hosted checkout.

3-D Secure

Device tokens will generally not require 3-D Secure authentication as they are already authenticated, while PAN_ONLY will generally require 3-D Secure authentication. For hosted checkout we will handle 3-D Secure for you, both determining if it is required as well as handling the authentication flow.

One click Google Pay in Checkout Express

For Checkout Express sessions we support a one click Google Pay checkout flow where the customer can pay by clicking a Google Pay button that is shown above the customer data form. When the customer clicks this button the session is updated with customer details from Google Pay and the customer selects a shipping option in the Google Pay UI.

Since Google Pay's express features behaves a bit differently from the default Checkout Express flow this requires an opt in property in the payment session configuration, the allow_express_wallet_payment must be set to true.

Google Pay can still be used for payment in Express Checkout when this flag is not set. Google Pay will then be shown next to the other payment options after the customer has entered their address details manually.

Testing

Sandbox Environment

If you enable test mode and create a payment with Google Pay, you will get a dialog where you can select the card with the desired behavior. This uses a Google Pay sandbox to simulate getting a payload from Google Pay.

The test payments will not charge any cards.

Production Testing

Once you are ready to test in production you can enable Google Pay for production and try payments. Note that this will actually charge your card, but you can cancel or refund the payment after testing.

If you want to avoid exposing Google Pay to customers while testing in production you can set up a payment profiles and add Google Pay to a profile that isn't used for customers.