Skip to content

Commit 8291243

Browse files
committed
conjoin methodData sents
1 parent 5346554 commit 8291243

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

microsoft-edge/progressive-web-apps-chromium/how-to/digital-goods-api.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,13 @@ MDN:
161161

162162

163163
<!-- ====================================================================== -->
164-
## Purchasing an item (`PaymentRequest.show` method)
164+
## Purchasing an item (`PaymentRequest` constructor and `show` method)
165165

166-
Use the `show` method of the `PaymentRequest` interface to purchase an item, after you construct a request that contains the item details.
166+
After your products and details are displayed to the user, implement the purchase flow by using the Payment Request API. To purchase an item, construct a request that contains the item details by using the `PaymentRequest` constructor, and then use the `show` method of the `PaymentRequest` object.
167167

168-
Once your products and details are displayed to the user, you can implement the purchase flow by using the Payment Request API. When combined with the Digital Goods API, the only required input parameter is `methodData`.
169-
170-
In the `PaymentRequest` constructor's `methodData`⁠⁠ parameter:
168+
When combined with the Digital Goods API, the only required input parameter for the `PaymentRequest` constructor is `methodData`. In that parameter:
171169
* Use the `supportedMethods` member to identify Microsoft Store Billing as the payment method with the string `"https://store.microsoft.com/billing"`.
172-
* In the `data` member, pass along the item ID as the `sku`:
173-
174-
<!-- todo: in PaymentRequest ctor, the 2nd param (details) is missing, per ctor docs: https://developer.mozilla.org/docs/Web/API/PaymentRequest/PaymentRequest - the 3rd param, "options", says "optional" next to it, unlike "details" param - is that page missing a 1-param overload? new PaymentRequest(methodData)
175-
-->
170+
* In the `data` member, pass along the item ID as the `sku`.
176171

177172
```javascript
178173
const details = await digitalGoodsService.getDetails(['monthly_subscription']);
@@ -204,6 +199,7 @@ See also:
204199
* [Payment Request API](https://developer.mozilla.org/docs/Web/API/Payment_Request_API)
205200
* [PaymentRequest: PaymentRequest() constructor](https://developer.mozilla.org/docs/Web/API/PaymentRequest/PaymentRequest)
206201
* [PaymentRequest: show() method](https://developer.mozilla.org/docs/Web/API/PaymentRequest/show)
202+
* [PaymentResponse: details property](https://developer.mozilla.org/docs/Web/API/PaymentResponse/details)
207203

208204

209205
<!-- ====================================================================== -->
@@ -294,6 +290,7 @@ MDN:
294290
* [Payment Request API](https://developer.mozilla.org/docs/Web/API/Payment_Request_API)
295291
* [PaymentRequest: PaymentRequest() constructor](https://developer.mozilla.org/docs/Web/API/PaymentRequest/PaymentRequest)
296292
* [PaymentRequest: show() method](https://developer.mozilla.org/docs/Web/API/PaymentRequest/show)
293+
* [PaymentResponse: details property](https://developer.mozilla.org/docs/Web/API/PaymentResponse/details)
297294
* [Intl.NumberFormat](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat)
298295

299296
W3C:

0 commit comments

Comments
 (0)