Google Pay API PaymentRequest Tutorial

The Google Pay API can be used in conjunction with other supported
payment methods in
PaymentRequest.

Important: Chrome for Android is currently the only web browser supporting the Payment
Request API with third-party payment methods, including Google Pay.
Sites wishing to implement Google Pay as a standalone payment
method should use the
Google Pay API JavaScript client library
with a branded Google Pay button
to reach a broader Google audience across multiple browsers and platforms.

Step 1: Create a PaymentDataRequest object

Configure a
PaymentDataRequest
object specifying your payment gateway and accepted methods of payment.
We recommend you obtain shipping address, email address, and phone number
through the browser's PaymentRequestoptions argument,
not the Google Pay API, for consistency across payment methods.
Use the Google Pay API to receive only the payment credentials and
optional billing address.