Google Pay™ (Beta)
Google Pay allows customers to securely complete payments using credit or debit cards linked to their Google account. Evervault has built in support for Google Pay using UI Components. Our Google Pay component will intercept the Google Pay token and provide you with direct access to the encrypted payment method, which can then be sent to any payment processor using Relay.
Install the Evervault SDK
To use the Google Pay component, you will first need to install the Evervault SDK. Our JavaScript SDK is distributed from our CDN and can be loaded with a simple script tag. The SDK must be loaded directly from our CDN and cannot be bundled with your application or self hosted.
Once the SDK script has been loaded, you can initialize the SDK with your Team and App IDs.
Create a Transaction
Next, you will need to create a transaction to describe the payment you want to process. You will need to provide the amount, currency, country, and merchant details for the transaction.
Mount the Google Pay Component
Now that you have created a transaction, you can create and mount the Google Pay component to display the Google Pay button to your users. The Google Pay component takes the transaction you created as a first argument and an options object with a process
function that will be called with the encrypted payment method when the user completes the payment. The process
function is an async function that takes the encrypted payment method as the first argument and an object with a fail
function as the second argument. The fail
function can be called with an error message to display an error to the user.
Customize the Google Pay Button
Google Pay allows you to customize the appearance of the payment button with various predefined styles. These can be passed as additional options when initializing the Google Pay component. You can see the available options in the Google Pay Docs.
Configure Authorization Methods and Card Network Support
Google Pay allows you to specify the authorization methods and card networks that are supported by your merchant. This can be done by passing the allowedAuthMethods
and allowedCardNetworks
options when initializing the Google Pay component. You can see the available options in the Google Pay Docs.
The full list of supported authorization methods and card networks can be found in the Google Pay Docs. Please check with your payment processor to ensure that the authorization methods and card networks you specify are supported.
3DS Support
Google Pay supports tokenized and non-tokenized payment methods. Tokenized payment methods are preferred as they provide enhanced security and reduced fraud. Non-tokenized payment methods are also supported, and when used can subsequently be submitted for authentication via our 3DS API. See our 3DS Guide for more information. You can directly pass the encrypted card.number
string from the returned payment method to our 3DS API to perform an authentication.
Content Security Policy (CSP)
If you are using a Content Security Policy (CSP), you will need to add the following directives to allow the Evervault SDK to function correctly.