-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Just-in-time payment handler install #240
Comments
cc: @DurgaTheHutt |
Hey @rsolomakhin! How would this work with |
I assume that the HEAD call would happen before calling |
@jenan-stripe: I can see two approaches to
Does the group have any preference? @adrianhopebailie: You're correct, the HEAD call would happen upon |
@madmath suggested that we use the HTTP Link header to indicate both whether just-in-time install is supported and the URL of the page that can perform the install. For example:
|
Without splitting |
I would lean towards option 1. Ian |
Thank you for the feedabck, @jenan-stripe and @ianbjacobs. |
FYI, @mhahmadi suggests to place the payment handler installer URL in the payment method manifest, which would reduce the number of
{
"default_payment_handler_installer_page": "/payments/just-in-time-install.html",
"default_applications": ["https://bobpay.xyz/pay/app1.json"],
"supported_origins": ["https://partner1.com", "https://partner2.com"]
} |
@rsolomakhin, I totally support your idea. I have some questions.
Does it provide only if there is only one item of supportedMethods array? new PaymentRequest([{
supportedMethods: 'https://bobpay.xyz/pay'
}, {
supportedMethods: 'https://hellopay.xyz/pay'
}], shoppingCart).show(); BTW, is there any reason to have to pop up window here? <!-- In merchant.com -->
<iframe src="https://hellopay.com/register" style="display: none"></iframe>
<!-- In hellopay.com -->
<script>
navigator.serviceWorker.register("payment-handler.js");
const reg = navigator.serviceWorker.ready;
reg.paymentManager.paymentInstruments.set(...);
</script> WDYT? |
@romandev, in case of multiple payment methods, each one can have an install prompt in the payment sheet. This would not be a popup, but would be in place of the payment app selection. Here's an ASCII mock up:
|
TL;DR: No changes needed in this spec. After discussion this morning, we have decided to not add anything to the payment handler spec. @marcoscaceres recommended to indicate success and failure by redirecting to a success or a failure page. The browser can detect HTTP status codes |
@domenic: Do you think it would be better to add |
I think this comes down to the fact that one PMM can point to multiple WAMs. And you derive the payment apps from the WAM, not the PMM; the PMM just points you to one or more WAMs. So it makes more sense to associate the URL with the WAM. I'd call it something slightly more specific like |
Should I send a pull request to the WAM spec? |
Seems reasonable to me! @marcoscaceres can probably help with details, e.g. bikeshedding on the name. |
I am thinking about where to document this (eventually). My current best guess is the Payment Method Good Practice wiki [1]. Does that seem correct to you? Ian [1] https://github.com/w3c/payment-request-info/wiki/PaymentMethodPractice |
That should work, @ianbjacobs. The pull request: w3c/manifest#634 |
What about putting the payment handler installation url in related_applications in the web app manifest like below: |
related_applications is specifically for non-web applications related to the web application that's already available at the main URL specified by the manifest. |
what is the main URL here? the 'start_url' or the url to find the web app manifest in the payment method manifest? |
start_url, or the inferred default (see https://w3c.github.io/manifest/#dfn-processing-the-start_url-member), is indeed the URL of the web application. |
Then do we need extra url for payment handler if we consider payment handler is the web app. I was looking the example in this web page (https://developer.mozilla.org/en-US/docs/Web/Manifest), there is platform:”web” in the related application, but without url which might because that manifest is supposed to embedded in a web page instead of be fetched directly as we do here. |
Thanks, I've fixed that wiki page to no longer include that misleading entry. |
Thank you, all, for your input. It appears that we do not need to make any changes to the spec, because this is an implementer (browser) optimization. With that, let's close this issue. |
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 receiveNotSupportedError
.Install a payment app from https://bobpay.xyz/pay? [ ALLOW ] [ DENY ]
.[ DENY ]
, the merchant would receiveNotSupportedError
.[ 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 scopehttps://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
The text was updated successfully, but these errors were encountered: