Add a Google Pay button to your embedded payment form for one-tap checkout on Android devices and Chrome browsers with token security
Add Google Pay as a payment option to your Solidgate Payment Form to provide customers with a fast and secure way to pay with cards saved in their Google account. Once integrated, the Google Pay button appears on your form, allowing customers to complete purchases seamlessly.
Solidgate Payment Form meets Google’s integration standards for Google Pay, ensuring a smooth checkout experience across Android devices and web browsers. Follow this guide to set up Google Pay, making it easier for customers to use their preferred payment methods.
Obtain the merchant ID parameter from the Google console, which enables Google Pay transactions on your site.
To display the Google Pay button on the Solidgate Payment Form, configure the paymentIntent object with the fields below. Google Pay can be accessed and used on the platforms listed in the
Google guide
Reference .
paymentIntent object
Expand all
Description
Order ID, which must be unique, is specified in the merchant system.
Example
123456
Description
Order description in your system and for bank processing.
Highly recommended to keep the description brief to improve the clarity of payment processing, ideally not exceeding 100 characters. It is used in the email receipt sent to the customer.
Example
Premium package
Description
Currency in three-letter code per the
ISO-4217
Wiki standard.
Should not be provided for Subscription 2.0 and Invoice in Billing flow.
Example
USD
Description
Order amount in minor units. For example, 1020 means 10 USD and 20 cents. Can be 0 for zero-amount authorization.
Example
1020
Description
Merchant ID parameter you receive on Google’s side.
Required for displaying the Google Pay button.
Example
10911390523550288022
Description
Merchant name, which can be displayed to the customers when paying via Google.
Recommended to pass this parameter so that Google does not substitute the merchant name on its own. There is no channel-level merchant name fallback.
Example
Solidgate
Description
Customer email.
If not provided, it is collected on the payment form.
Example
test@solidgate.com
Description
Customer’s first name.
Example
John
Description
Customer’s last name.
Example
Snow
Description
Public IP address of the customer. Both IPv4 and IPv6 are supported.
Private IPs (10.0.0.0-10.255.255.255, 172.16.0.0-172.31.255.255, 192.168.0.0-192.168.255.255) result in an ‘Invalid IP’ error.
If not provided, it is automatically inferred. Google Pay is unavailable in restricted regions.
Example
USA
Description
Customer platform at the moment of payment.
WEB
- desktop
MOB
- mobile version
APP
- application
If this parameter is not provided, it is automatically inferred from the header.
Example
WEB
Description
Customer language settings for the translation of Payment Form fields and the language of email receipts sent for successful payments.
Example
en
Description
Routing payments flag for 3DS flow. See Google Pay and 3DS for the specifics of authentication on tokenized cards.
Example
true
Description
Metadata is useful for storing additional, structured information about an object, consisting of up to 10 key-value pairs with a validation limit of 380 characters per field.
The callback notification returns an order_metadata from the order in each state.
Example
{"coupon_code": "NY2025", "partner_id": "123989"}
Description
Provide this URL if you want to redirect a customer to your own Success Screen.
If you do not provide the URL, Solidgate directs customers to the Solidgate Success Screen.
Example
https://merchant.example/success
Description
Provide this URL if you want to redirect a customer to your own Fail Screen.
If you do not provide the URL, Solidgate directs customers to the Solidgate Fail Screen.
Pass
Guide
Pass Billing-specific fields in paymentIntent for catalog products, subscriptions, and invoices.
Billing-specific
fields in paymentIntent for catalog products, subscriptions, and invoices. Match the scenario to your Billing version.
The paymentIntent object lists fields the Google Pay button needs. Combine both on the same intent. Subscription 2.0 and Invoice omit top-level amount, currency, and product_id.
After the form is initialized with a checkout object, replace line items, discounts, or trial terms in the
Guide
Replace checkout line items, discounts, and trial terms on an initialized Billing checkout form using the form.updateCheckout method.
checkout update
flow. Totals still come from checkout.line_items. Match the wallet payment sheet total with the
Guide
The invoicePreview event reports the calculated invoice for a Billing checkout intent at form initialization and after a billing address change.
invoicePreview
event.
Select the Billing flow:
Billing 1.0 one-time product payment.
Provide product_id and merchant customer_account_id.
Description
Identifier of the predefined product in UUID v4 format.
Example
faf3b86a-1fe6-4ae5-84d4-ab0651d75db2
Description
Merchant-defined customer ID for Billing 1.0.
This is not Billing 2.0 customer_id.
Example
4dad42f878
Description
Coupon ID in UUID v4 format for a product discount.
Active only when product_id is present.
Example
eb4c6e93-4c53-447a-b215-5d5786af9844
Billing 1.0 recurring subscription payment.
Provide product_id and merchant customer_account_id.
Description
Identifier of the predefined product in UUID v4 format.
Coupon ID in UUID v4 format for a product discount.
Active only when product_id is present.
Example
eb4c6e93-4c53-447a-b215-5d5786af9844
Billing 2.0 recurring subscription payment.
Provide a checkout object with mode as
subscription
and Billing customer_id. Pass exactly one recurring product in line_items.
Description
Recurring subscription payment parameters with one recurring line item, discounts, customer, and subscription data.
Description
Checkout flow type for a recurring subscription payment.
Google Pay properties are added to paymentIntent object
If you request to create a payment form with Google Pay without proper setup, the button is not displayed, and the appropriate warning is sent.
Google Pay is
supported
Reference within Android WebView, enabling native payment sheet feature when your web checkout process is embedded in an Android app. This uses the payment request to launch Android payment apps from within WebView, starting with WebView version
137
and Google Play Services
25.18.30
.
Subscribe to the Google Pay mounted
Guide
Using the payment form, you can build your customer actions tracking by the events that the Solidgate payment form returns.
event
to check when the button is mounted and rendered. When the event is emitted for the googlebtn entity, this means the Google Pay button is fully displayed.
You can test the Google Pay payments when setting up the integration.
Google Pay is not supported in
Guide
Follow implementation best practices for the payment form including error handling, mobile optimization, and production validation steps.
certain
regions, including India.
Customization
In addition to displaying the button on the payment form, you can also control its position, color, and size. Use the googlePayButtonParams object for changes as you would for all other customization in the Solidgate
Guide
Customize payment form appearance with CSS overrides, theme configuration, font selection, and layout adjustments to match your brand.
Payment Form.
To maintain a consistent and recognizable customer experience, Google Pay supports only the customization of predefined styles, including color themes or button type and size. For example, you can choose from black, white, or the default button colors. For more information, check the Google Pay brand guidelines for
Android
Reference and
website
Reference.
Customization properties
Expand all
Description
Displays the Google Pay button.
Example
false
Default
true
Description
Identifier of container to place the Google Pay button.
By default, if not set, button is displayed above the form.
PAN_ONLY: This authentication method is associated with payment cards stored on file with the customer’s Google Account. Returned payment data includes personal account number (PAN) with the expiration month and the expiration year.
CRYPTOGRAM_3DS: This authentication method is associated with cards stored as Android device tokens. Returned payment data includes a 3D Secure (3DS) cryptogram generated on the device.
The ability to transmit only PAN_ONLY or CRYPTOGRAM_3DS is also available, and such transmission works for both one-time payments and subscriptions.
Example
['PAN_ONLY']
Default
['PAN_ONLY', 'CRYPTOGRAM_3DS']
Description
Price status the Google Pay sheet renders for the order total.
Supported values:
TOTAL_PRICE_STATUS_FINAL
the sheet promises the displayed amount is the final charge.
TOTAL_PRICE_STATUS_ESTIMATED
the sheet shows the total as an estimated price that might still change.
Required to update the order from the wallet card details, which are included in the walletCardType event.
<template><Payment:merchant-data="merchantData":google-pay-button-params="google"width="100%"/></template><scriptlang="ts"setup>import{defineAsyncComponent}from'vue'import{InitConfig}from'@solidgate/vue-sdk'constPayment=defineAsyncComponent(()=>import('@solidgate/vue-sdk'))constmerchantData:InitConfig['merchantData']={merchant:'<<--YOUR MERCHANT ID-->>',signature:'<<--YOUR SIGNATURE OF THE REQUEST-->>',paymentIntent:'<<--YOUR PAYMENT INTENT-->>'}constgoogle:Omit<InitConfig['googlePayButtonParams'],'containerId'>={color:'white',type:'plain',allowedAuthMethods:['PAN_ONLY','CRYPTOGRAM_3DS']}</script>
import{Component}from'@angular/core';import{FormType,InitConfig}from"@solidgate/angular-sdk";@Component({selector:'app-root',template:`
<ngx-solid-payment
[googlePayButtonParams]="google"
[merchantData]="merchantData"
></ngx-solid-payment>
`})exportclassAppComponent{merchantData: InitConfig['merchantData']={merchant:'<<--YOUR MERCHANT ID-->>',signature:'<<--YOUR SIGNATURE OF THE REQUEST-->>',paymentIntent:'<<--YOUR PAYMENT INTENT-->>'}google: Omit<InitConfig['googlePayButtonParams'],'containerId'>={color:'white',type:'plain',allowedAuthMethods:['PAN_ONLY','CRYPTOGRAM_3DS']}}
Button position
To position the Google Pay button as needed, create and specify the div. Then, pass the value of the created container to the containerId parameter in the googlePayButtonParams object.
<template><Payment:merchant-data="merchantData":google-pay-container-ref="googleButton"/><divref="googleButton"/></template><scriptlang="ts"setup>import{defineAsyncComponent,ref}from'vue'import{InitConfig}from'@solidgate/vue-sdk'constPayment=defineAsyncComponent(()=>import('@solidgate/vue-sdk'))constgoogleButton=ref<HTMLDivElement>()constmerchantData:InitConfig['merchantData']={merchant:'<<--YOUR MERCHANT ID-->>',signature:'<<--YOUR SIGNATURE OF THE REQUEST-->>',paymentIntent:'<<--YOUR PAYMENT INTENT-->>'}</script>
import{Component}from'@angular/core';import{FormType,InitConfig}from"@solidgate/angular-sdk";@Component({selector:'app-root',template:`
<ngx-solid-payment
[merchantData]="merchantData"
[googlePayContainer]="googlePay"
></ngx-solid-payment>
<div class="google-pay" #googlePay></div>
`})exportclassAppComponent{merchantData: InitConfig['merchantData']={merchant:'<<--YOUR MERCHANT ID-->>',signature:'<<--YOUR SIGNATURE OF THE REQUEST-->>',paymentIntent:'<<--YOUR PAYMENT INTENT-->>'}}
In this example, the div with the id yourCustomContainerId is created in the HTML, and its id value is passed to the containerId parameter in the googlePayButtonParams object.
This specifies that the Google Pay button should be rendered inside the specified container.
If you do not specify the containerId, Solidgate displays it above all fields of the Solidgate Payment Form by default.
If you specify a container that does not exist, the Google Pay button is not displayed. In this case, Solidgate returns the error to the console.
Container with id =‘specified-container’
does not exist.
Button styling
Some options on the Payment Form allow customization of the Google Pay button to better match the style of your site.
Solidgate allows changing two parameters of the button in the googlePayButtonParams object:
default
- may change the color over time (light/night mode).
black
- a black button suitable for use on a white or light background.
white
- a white button suitable for use on a colorful background.
Supported types:
buy
- a 'Buy with Google Pay' button (default).
plain
- button without additional text.
checkout
order
pay
subscribe
Not supported types:
donate
book
Button hiding
To hide the button for the customer, pass
false
to the enabled parameter. You do not need to specify
true
to display the button on the form as it is a default value. When you pass the
false
value, the form with the passed parameters of containerId, color, and type is collected but not displayed on the Solidgate
Guide
Customize payment form appearance with CSS overrides, theme configuration, font selection, and layout adjustments to match your brand.
Payment Form.