| // Copyright 2020 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // https://github.com/WICG/digital-goods/blob/master/explainer.md |
| [ |
| SecureContext, |
| RuntimeEnabled=DigitalGoods |
| ] interface DigitalGoodsService { |
| [CallWith=ScriptState, MeasureAs=DigitalGoodsGetDetails] |
| Promise<sequence<ItemDetails>> getDetails(sequence<DOMString> itemIds); |
| |
| [CallWith=ScriptState, MeasureAs=DigitalGoodsAcknowledge] |
| Promise<void> acknowledge(DOMString purchaseToken, PurchaseType purchaseType); |
| |
| [CallWith=ScriptState, MeasureAs=DigitalGoodsListPurchases] |
| Promise<sequence<PurchaseDetails>> listPurchases(); |
| }; |
| |
| enum PurchaseType { |
| "repeatable", |
| "onetime", |
| }; |