- From: Dave Longley <notifications@github.com>
- Date: Mon, 24 Sep 2018 09:55:00 -0700
- To: w3c/payment-handler <payment-handler@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/payment-handler/pull/325/review/158198476@github.com>
dlongley commented on this pull request.
> @@ -1643,6 +1654,44 @@ <h2>
<a>PaymentRequest</a>. A single <a>payment handler</a> SHOULD NOT be
allowed to open more than one client window using this method.
</p>
+ <section data-dfn-for="PaymentHandlerContainer" data-link-for=
+ "PaymentHandlerContainer">
+ <h2>
+ <dfn>PaymentHandlerContainer</dfn> interface
+ </h2>
+ <pre class="idl">
+ [SecureContxt, Exposed=Window]
+ interface PaymentHandlerContainer {
+ readonly attribute object? data;
+ void respondWith(PaymentHandlerResponse response);
+ };
+
+ partial interface Navigator {
+ [SecureContext, SameObject] readonly attribute PaymentHandlerContainer paymentHandler;
`paymentHandler.data` should be a Promise, IMO. This seemed to work well with the Web Payment CG's original API design where the "payment request" could be retrieved via `getPendingRequest`:
```js
const paymentRequest = await navigator.payment.getPendingRequest();
// ... handle payment request, generate acknowledgement
// acknowledge payment request handled
navigator.payment.acknowledge(acknowledgement);
```
https://github.com/Spec-Ops/payment-polyfill#getting-a-pending-payment-request
Here it would be:
```js
const data = await navigator.paymentHandler.data;
// ... handle payment request, generate response
// respond to payment request
navigator.paymentHandler.respondWith(response);
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-handler/pull/325#discussion_r219910819
Received on Monday, 24 September 2018 16:55:21 UTC