To help bootstrapping new payment handlers into the ecosystem, we at Chrome would like to experiment with installation of the payment handler at the time of payment. The use case would work as follows for a user that does not have 'https://bobpay.xyz/pay'
payment handler installed, for example.
new PaymentRequest([{supportedMethods: 'https://bobpay.xyz/pay'}], shoppingCart).show();
http://bobpay.xyz/pay
to verify that it supports just-in-time installation of a payment handler. This would be indicated by a header that we need to name something. If the header is absent, the merchant would receive NotSupportedError
.Install a payment app from https://bobpay.xyz/pay? [ ALLOW ] [ DENY ]
.[ DENY ]
, the merchant would receive NotSupportedError
.[ ALLOW ]
, the browser would open a popup window with a URL that instructs the payment app via a hash parameter (#) to install itself and prepare for payment. For example, https://bobpay.xyz/pay#install-payment-handler-and-prepare-for-payment-from-origin=merchant-shop.com
. The payment handler should show an "Initializing..." screen on this page. The payment handler communicates its own readiness to process payments via the hash parameter as well.https://bobpay.xyz/pay#fail
, then the installation failed. The browser should give the user the opportunity to install a different payment app, if possible.https://bobpay.xyz/pay#success
, then the installation succeeded. At this point, the browser fires the 'paymentrequest'
event in the newly installed service worker with scope https://bobpay.xyz/pay
and payment proceeds as defined in the rest of the spec. The service worker should communicate with the existing popup window via the service worker clients API to smoothly transition into showing the normal payment flow.Is this something that's interesting to other implementers as well? If so, we are wondering what, if anything, should be added to this specification. I suspect that the following items would need be defined somewhere.
https://bobpay.xyz/pay
to indicate that it supports just-in-time install.#install-payment-handler-and-prepare-for-payment-from-origin=
#fail
#success
cc: @romandev @marcoscaceres @gogerald @anthonyvd
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3