Google Pay elements
Learn how to use Google Pay elements.
Use DigitalRiver.js to create a Google Pay element and interact with Google Pay.
To create a Google Pay element, you should use the
createElement
function exposed through the DigitalRiver object.Example
var paymentRequestData = digitalriver.paymentRequest({
country: "US",
currency: "USD",
total: {
label: "Order Total",
amount: 100
},
displayItems: lineItems,
shippingOptions: shippingOptions,
style: {
buttonType: "plain",
buttonColor: "dark",
buttonLanguage: "en"
}
});
var googlepay = digitalriver.createElement('googlepay', paymentRequestData);
All Google Payment buttons on your site must adhere to the Google Pay Brand Guidelines, which include, but aren't limited to, the following requirements. Digital River provides the following Google Pay button options for clients to add to the product page/checkout page (express checkout) or payment options page.
Configure Button Type | HTML Code |
---|---|
![]() | buttonType: "plain" |
![]() | buttonType: "long"
The shopper hasn't logged in to Google Pay. |
![]() | buttonType: "long"
The shopper has logged in to Google Pay |
Configure Button Color | HTML Code |
![]() | buttonColor: "dark" |
![]() |