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.
Display button
Start with the following required steps to add Google Pay to the Solidgate Payment Form:
- Domain verification
Verify your domain on the Google site. For this you need to have a Google developer account. - Merchant ID
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, you must add the GooglePay properties to the paymentIntent
object. Google Pay can be accessed and used on the platforms listed in the
Google guide
Reference
.
Subscribe to the Google Pay mounted
Using the payment form, you can build your user 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.
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
Create a seamless experience for customers by styling your payment form.
Payment Form
.
To maintain a consistent and recognizable user 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 .
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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.
Please note that if you specify a container that does not exist, the Google Pay button will not be displayed. In this case, Solidgate will return the error to the console.
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
Create a seamless experience for customers by styling your payment form.
Payment Form
.