Re: [w3c/payment-request] Some clarifications with Payment Request API (#774)

@adimallikarjunareddy wrote:

> Google Pay with PaymentRequest API distinguishes between cards that are added in Android devices and cards added directly to Google Pay Account. Some times it does not show the cards added through Google Pay Account

See https://blog.chromium.org/2018/07/bringing-google-pay-to-paymentrequest.html - "As of version 70, Chrome will no longer return cards stored in a user’s Google Account as part of the basic-card payment method. To continue getting access to cards stored in a user’s Google Account, developers will need to add support for Google Pay. "

To get the best results, your PaymentRequest objects should include as many payment methods as you can support:

```javascript
const request = new PaymentRequest([{
  supportedMethods: "basic-card",
  data: {/* payment-method-specific-data */},
}, {
  supportedMethods: "https://pay.google.com",  // Double-check the actual identifier.
  data: {/* payment-method-specific-data */},
}, {
  supportedMethods: "https://apple.com/pay",  // Double-check the actual identifier.
  data: {/* payment-method-specific-data */},
}, {
  supportedMethods: "https://samsung.com/pay",  // Double-check the actual identifier.
  data: {/* payment-method-specific-data */},
}, {
  supportedMethods: "tokenized-card",  // Double-check the actual identifier.
  data: {/* payment-method-specific-data */},
}], shoppingCart);
```

The benefits of this style are:
1. Single checkout button the webpage.
2. The same code works in Edge, Chrome, Safari, Samsung Internet, and soon Firefox.
3. The same code works with cards stored in the browser, Google Pay, Apple Pay, Microsoft Pay, Samsung Pay, and soon other payment handlers.

Keep in mind that some payment apps are available only on some platforms. For example, Samsung Pay is on Samsung phones only. Apple Pay is in Safari only. For the latter case, you can check the user agent string to customize your button appearance accordingly.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-request/issues/774#issuecomment-420399473

Received on Tuesday, 11 September 2018 19:44:34 UTC