A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/w3c/payment-handler/issues/240 below:

Just-in-time payment handler install · Issue #240 · w3c/payment-handler · GitHub

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.

  1. The merchant calls new PaymentRequest([{supportedMethods: 'https://bobpay.xyz/pay'}], shoppingCart).show();
  2. The browser checks the HTTP headers from 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.
  3. Otherwise, if the header is present, the browser shows the payment sheet with a prompt Install a payment app from https://bobpay.xyz/pay? [ ALLOW ] [ DENY ].
  4. If the user taps [ DENY ], the merchant would receive NotSupportedError.
  5. Otherwise, if the user taps [ 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.
  6. If the payment handler navigates to 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.
  7. Otherwise, if the payment handler navigates to 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.

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