Skip to main content

Google Pay

Enable Google Payโ„ข to allow customers to purchase using a credit or debit card connected to their Google Account. This guide walks you through the payment flow and steps to implement the service.

Terms of Service

By using Google Pay, you agree to Google's acceptable use policy and terms of service.

Supported Regionsโ€‹

RegionCurrencyRefundableMinimum API Version
ThailandTHBโœ… Yes2017-11-02
JapanJPYโœ… Yes2017-11-02
SingaporeSGDโœ… Yes2017-11-02
MalaysiaMYRโœ… Yes2017-11-02

How to Enableโ€‹

To enable Google Pay, send an email requesting this feature to support@omise.co.

Payment Flowโ€‹

Google Pay supports payments on websites and Android devices. Customers who choose to make payments using Google Pay initiate the transaction by tapping or clicking the Google Pay button embedded in your platform. Customers who have already linked a card to their Google Account will be able to choose their preferred card right away. Those who have not will be given the option to link a new card.

Once the customer selects their preferred card and confirms the payment, the card will be charged the same way as the normal credit card payments flow. This means your account's current card processing settings (for example, whether 3-D Secure is enabled) will also apply to Google Pay transactions.

Using a Desktop Browserโ€‹

To start a Google Pay payment, the customer selects Google Pay as their preferred payment method during checkout on your website โถ. The customer then chooses their preferred credit or debit card โท. Upon confirmation, Omise will send a webhook event (if enabled) indicating that the charge is complete โธ.

Google Pay Desktop Flow

Using a Mobile Applicationโ€‹

To start a Google Pay payment, the customer selects Google Pay as their preferred payment method on your mobile application โถ. The customer then chooses their preferred credit or debit card โท. The customer reviews and confirms the payment โธ. Omise will send a webhook event (if enabled) indicating that the charge is complete โน.

Google Pay Mobile Flow

Implementationโ€‹

Follow the Google Pay Brand guidelines (Web, Android) to add Google Pay payment buttons to your website or Android app. After the customer taps on the button and selects their card, you will receive a Google Pay token from Google, which contains the card information. You then send this type of token to our client-side libraries (Omise.js or the Android SDK) to obtain a card token that's usable on our Charge API.

Omise treats Google Pay tokens the same way as sensitive card data. Therefore, unless you have a PCI-DSS license, these tokens must first be converted to card tokens before being used on your servers. Read more in Collecting Cards.

In summary, make the following API requests to create a charge with Google Pay:

  1. Obtain a Google Pay token from Google when the user initiates payment through the Google Pay button.
  2. Create a card token from the Google Pay token using Omise.js or the Android SDK.
  3. Create a new charge using the obtained card token from Step 2.
  4. After receiving the charge completion webhook event, retrieve the charge to verify its status (optional, but recommended).

The following sequence diagram shows how to obtain the card token:

If you use the Omise pre-built payment form, a Google Pay button will be provided, and a usable card token will be returned automatically. Use your secret key to create a charge on the server.

Obtaining a Google Pay Tokenโ€‹

To render a Google Pay button and receive a Google Pay token, follow the Google Pay Web or Android developer documentation. In the API request, ensure the following fields follow the guidelines below:

  • Field allowedAuthMethods must only contain PAN_ONLY.
  • Field allowedCardNetworks should reflect the supported card brands from the Capability API.
  • Field gateway is set to omise.
  • Field gatewayMerchantId is your Omise public key.

After the request is sent, a new Google Pay token will be returned under the name token in the response.

Please make sure that your implementation also follows the Google Pay Web or Android brand guidelines.

Creating a Card Tokenโ€‹

Once you receive a Google Pay token, create a new card token using the following tokenization parameters.

NameTypeDescription
methodstring(required) Set to googlepay string.
datastring(required) Google Pay token. Refer to the token field in the PaymentMethodTokenizationData object.
billing_namestring(optional, but recommended) Card owner name. Refer to the name field in the Address object.
billing_citystring(optional, but recommended) Billing address city. Refer to the locality field in the Address object.
billing_countrystring(optional, but recommended) Billing address country as two-letter ISO 3166 code. Refer to the countryCode field in the Address object.
billing_postal_codestring(optional, but recommended) Billing address postal code. Refer to the postalCode field in the Address object.
billing_statestring(optional, but recommended) Billing address state. Refer to the administrativeArea field in the Address object.
billing_street1string(optional, but recommended) Billing address street #1. Refer to the address1 field in the Address object.
billing_street2string(optional) Billing address street #2. Refer to the address2 field in the Address object.
billing_phone_numberstring(optional) Billing address phone number. Refer to the phoneNumber field in the Address object.
Billing Information

By default, the cardholder's name and billing address won't be attached to a card token, and the name will be displayed as "Google Pay" for such a case. To override this behavior, supply billing address parameters when requesting payment to Google. The billing information from the response can be found in the Address object.

For Omise.js, set the token input type to tokenization at the first argument of the createToken function and submit the tokenization parameters at the second.

Omise.setPublicKey("your_omise_public_key");

tokenParameters = {
method: 'googlepay',
data: '{"signature":"MEQCIA+wGZttxT13yz599zQjYugoz5kClNSmVa39vKv6ZOenAiARRtHQ0aYSrfd3oWhB\/ZtEeJs3ilT\/J0pYz1EWnzU2fw\\u003d\\u003d","intermediateSigningKey":{"signedKey":"{\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEev+pVoUgtoS+y8Ecz3c72OFBD3d74XJOcnRxVmCV+2TJTW1g4d0UhDkhHeURhHQNvJPyBFHfYIUUj\/EYhYAzgQ\\\\u003d\\\\u003d\",\"keyExpiration\":\"1647856171825\"}","signatures":["MEYCIQClXfVcil7qaG2btVbyzf6x1\/MqCTbbJM\/tGN4iME4M9wIhANL53daWJHdDPpKxR3M\/Jis4WPVb093PW7fChj\/gCQUS"]},"protocolVersion":"ECv2","signedMessage":"{\"encryptedMessage\":\"4JighTc0b1HhRQu+NgQN1XQWWOeB4YyR5cMFi8Vu3FeWHAjPtGs3LjrdpWhJhWekURzD6BZCbg1xakYvAMsahoTyUzDLtNpKmlglFpVjBSSYkPKFT6xovTKsWS7xC\/x9AvJsATtotwN8TTiP3+1dXtLLFClnCTkg9vEvChvXq0FwnrUOBtMiWukBY84R2rpzqNuZoh6gdvWHgPP6RczhtERg+kqKdd4\/UnKE8ElzOWYDmZoJvFhxU\/O97vHW1ohOe8ut94bxiPH6DB82Ec87Mu\/oArsGMpsnFVsWzIcLX+q+KayGRbKxPQzV726fO7GipG94KiF7YfCk1r+D+jkFR7x0ev6l+XRoTz+PKIlhrcn3DEYJudJAP\/Xh2kj\/csnLn4XdKV0aZ5Ua3IauA4fQl80pAo9foujiRGwagHHOfnp6iMjA\/CdG9SNQS3eUdsxtlJKPoK4rtv7cwISNQvoCWMv748YvV3f+LEOWf8couRgrxPCPbk1vO8TfNOgSAjULzRs+C1xy6\/j5aZU46PpomEClDWrujMAcDVqCnExTx2QE9IAb4n02V6UxWv8Dgqv5TsRKjPe7WSCO0+jRWAvs6wBBUbFPHvEe4do+rQ\\\\u003d\\\\u003d\",\"ephemeralPublicKey\":\"BGJhfH3jWMmZtIALmYr7fWxYSNSCFoAT9MCOcbCZdO3LmP6njpGk9LISmr+H1Wk9XUZuMvNQmMHE+yFzW\/sA5lg\\\\u003d\",\"tag\":\"d9a6aVaoIEQm+bTjd5M2HL7+OeIup0Jb6rM1CN7v3NQ\\\\u003d\"}"}',

// Add your billing information here (optional)
billing_name: 'John Doe',
billing_street1: '1600 Amphitheatre Parkway',
};

Omise.createToken('tokenization', tokenParameters, function(statusCode, response) {
console.log(response)
});

The id attribute is the token identifier (begins with tokn).

Creating a Chargeโ€‹

Refer to Credit Card Payments to charge a card with the received card token. There are a couple of differences between card tokens that are generated from a specific tokenization method (googlepay) compared to normal ones:

  1. These card tokens have a field tokenization_method to tell what tokenization method was applied to the card.
  2. These card tokens cannot be used in the Customers API.

Additional Optionsโ€‹

When using a pre-built payment form, you can set additional configurations to control the Google Pay API more. The relevant parameters are described below.

Data AttributeParameterDescription
data-googlepay-merchant-idgooglepayMerchantIdMerchant ID for Google Pay (required when accepting live traffic).
data-googlepay-request-billing-addressgooglepayRequestBillingAddressSet to true to attach the cardholder's name and billing address to a card token. Supplying this improves your authorization rate for US, UK, and Canadian cardholders.
data-googlepay-request-phone-numbergooglepayRequestPhoneNumberWhen the cardholder's billing address is requested, set to true to also attach the cardholder's phone number to a card token.

The complete list of the supported parameters can be found here.

Testing and Going Liveโ€‹

To complete the whole user journey, you need to have a Google Account and attach a chargeable card to it or use one of the available test cards provided by Google. If your Google Pay environment is in test mode, the card number in Google Pay tokens will always be 4111 1111 1111 1111. You can charge this card with an Omise test key to simulate a successful charge.

To go live, you need a merchant ID in the merchantId field in the Google Pay API. You can obtain this by registering with the Google Pay Business Console. During launch preparation, ensure that you also adhere to the Google Pay Web or Android integration checklist.

FAQโ€‹

What is Google Pay?

Google Pay is Google's digital wallet and mobile payment service that allows customers to make secure payments using their Android device or any browser with a linked Google account. Customers can pay using credit or debit cards stored in their Google account.

Which regions support Google Pay?

Google Pay through Omise is available in:

  • Thailand (THB)
  • Japan (JPY)
  • Singapore (SGD)
  • Malaysia (MYR)

Contact support@omise.co to enable Google Pay for your account.

Do I need a Google Pay Business account?

For testing, no. For production (live) payments, yes - you need to register with the Google Pay Business Console to obtain a merchant ID. This is required before you can accept real payments.

Does Google Pay support 3D Secure?

Yes, your account's card processing settings (including 3D Secure) apply to Google Pay transactions. If you have 3D Secure enabled, customers may be prompted for additional authentication.

Can I save Google Pay cards for recurring payments?

No, card tokens generated from Google Pay cannot be attached to customers using the Customers API. Each Google Pay transaction requires the customer to authenticate again. For recurring payments, consider collecting card details directly.

What are the transaction limits?

Transaction limits depend on your merchant account settings and the customer's card issuer. There are no specific Google Pay limits imposed by Omise. Check with your account manager for your specific limits.

Can I refund Google Pay payments?

Yes, Google Pay payments can be refunded just like regular card payments. Both full and partial refunds are supported. Refunds are processed to the original card linked to the Google account.

Why isn't the Google Pay button showing?

The Google Pay button only appears when:

  • The customer has Google Pay set up with at least one valid card
  • The card brand is supported (check your Capability API)
  • The allowedAuthMethods includes PAN_ONLY
  • Your integration meets Google Pay brand guidelines

Check the browser console for specific errors.

What's the difference between Web and Android integration?
  • Web: Uses Google Pay JavaScript API, works on any browser where the user is signed into Google
  • Android: Uses Google Pay Android SDK, provides native app integration with better UX

Both methods produce the same token format and work with Omise's tokenization API.

What's the difference between Apple Pay and Google Pay?

Both are digital wallet payment methods, but they target different ecosystems:

  • Apple Pay: For iOS/macOS users (iPhone, iPad, Mac, Apple Watch)
  • Google Pay: For Android users and Chrome browser on any platform

For maximum customer coverage, implement both payment methods.