-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Description
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.
- The merchant calls
new PaymentRequest([{supportedMethods: 'https://bobpay.xyz/pay'}], shoppingCart).show(); - The browser checks the HTTP headers from
http://bobpay.xyz/payto 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 receiveNotSupportedError. - 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 ]. - If the user taps
[ DENY ], the merchant would receiveNotSupportedError. - 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. - 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. - 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 scopehttps://bobpay.xyz/payand 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.
- An HTTP header for
https://bobpay.xyz/payto indicate that it supports just-in-time install. #install-payment-handler-and-prepare-for-payment-from-origin=#fail#success
jsnellpluscpandj5
Metadata
Metadata
Assignees
Labels
No labels