2

Is it possible to add a "Cash on Delivery" option to the Payment Request API ?

Can I solve this problem with methodData?

msanford
  • 11,803
  • 11
  • 66
  • 93
Kloot
  • 228
  • 1
  • 2
  • 8
  • I'm not overly familiar with the PRAPI, but what would be the goal in using the Payment Request API for an out-of-bound transaction method? I'd add that fork at a higher level: "Pay by cash or now!" To answer your question: it seems _not_, given the [standardized-payment-method](https://www.w3.org/TR/payment-method-id/#dfn-standardized-payment-method). – msanford May 16 '18 at 16:54
  • The goal is that the user can select his shipping address and has a good user experience – Kloot May 16 '18 at 17:01
  • Not a bad goal, but this feels like fitting a square peg into a round hole. The purpose of the PRAPI is to facilitate electronic transactions, not just gather billing address, which is trivial for any form (especially with autofill). As of right now, `basic-card` seems to be the [only one listed in the standard payment method registry](https://w3c.github.io/payment-method-id/#registry). – msanford May 16 '18 at 17:24

1 Answers1

1

Cash on delivery is one of most frequently requested features. There is no plan to provide such payment method as a standard AFAIK but an idea to accommodate it as part of Payment Request API user experience exists.

A spec called Payment Handler API enables anyone to develop their own payment method and its implementing payment app (webpage) as part of Payment Request API (if merchant adds it).

The idea is a merchant can create a cash on delivery payment app and serve it by itself. The payment method simply tells a user that they need to pay upon receiving an item.

That way, you can take advantage of collecting shipping address part of PR API yet using cash on delivery as a payment method.

If you want to try Payment Handler example, visit https://bobpay.xyz and install "Bobpay web payment app" then go to https://rsolomakhin.github.io/pr/bob/ to make payment.

agektmr
  • 2,144
  • 15
  • 14
  • Thx this is what i was looking for, unfortunately this function does not work on my phone yet (by default settings), so i think i have to wait a bit until i can use it in production – Kloot May 18 '18 at 14:15