webpaymentpayment-request-apigoogle-pay

What is the difference between Google Pay API vs Payment Request API?


I saw that Google released a new Google Pay API for the web. However, there is also a Payment Request API fo the web. Is Google Pay just a rebrand of Payment Request API? In what cases would you use one API over the other?


Solution

  • The "Payment Request API" is a W3C standard and a part of "Web Payments" effort. This means the API is expected to be implemented by multiple browsers and it's already landed in Chrome, Edge and Samsung Browser. And it's also expected to be available on Firefox, Safari and so on. Payment Request API is never a Google's property and it's an open standard.

    https://www.w3.org/Payments/WG/

    The Payment Request API is said to allow users to pick their saved credit card information with just one tap. But it's just a part of larger ecosystem. It can integrate with any third party payment apps and allow users to make payment through those apps via the Payment Request API.

    Consider Google Pay one of such payment apps. Other good examples are upcoming Apple Pay (when Safari implements the Payment Request API) or Samsung Pay. Alipay also implemented one and have done a talk about it at Google I/O 2017.

    https://www.youtube.com/watch?v=hU89pPBmhds

    What makes it look complicated about Google Pay for those who knew about the Payment Request API is that it conceals the Payment Request API behind its library. By initiating Payment Request with just a single payment method without requesting shipping information, you can bypass Payment Request user interface and directly launch the payment app (in this case Google Pay).

    https://developers.google.com/payments/web/tutorial

    This article should be a good start:

    https://medium.com/dev-channel/addressing-common-misconceptions-about-the-payment-request-api-4d0db51dae75

    Hope this helps.