Configuring Google Pay
Learn how to configure Google Pay for DigitalRiver.js with Elements.
Step 1: Create a Google Pay source using Digital River.js
Create a Google Pay element
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"
},
"sessionId": "9f180964-9da4-43ac-b8e0-ae54d832b03c"
});
var googlepay = digitalriver.createElement('googlepay', paymentRequestData);Configure the Google Pay element to handle events
Event
Triggered When
Place the elements on the page
Receive the source event and use the source
Google Pay example
Step 2: Use the authorized source
Option 1. Attach the source to a cart
Option 2. Attach the source to a customer
Google Pay example
Testing Google Pay
Last updated