123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- // Copyright 2022 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.
- // These types are shared between Blink, ARC, and crosapi, so they must conform
- // to the requirements of the strictest API and be stable and versioned.
- // Next MinVersion: 2
- [JavaPackage="org.chromium.payments.mojom"]
- module payments.mojom;
- import "url/mojom/url.mojom";
- import "components/payments/mojom/payment_request_data.mojom";
- // Result of Digital Goods operations. The response code is forwarded to the
- // renderer, so individual errors don't need to be handled. Any value other than
- // |kOK| will result in a JavaScript exception with a description message to aid
- // in debugging.
- [Extensible, Stable]
- enum BillingResponseCode {
- // Success.
- kOk,
- // Unknown error calling a Digital Goods action (a more specific error code
- // below is preferred).
- kError,
- // Item purchased is already owned.
- kItemAlreadyOwned,
- // Failure to consume an item since it is not owned.
- kItemNotOwned,
- // Requested item is not available for purchase.
- kItemUnavailable,
- // The requested client app is not installed.
- kClientAppUnavailable,
- // Client app failed to handle Digital Goods message format.
- kClientAppError,
- };
- [Extensible, Stable]
- enum ItemType {
- kUnknown,
- kProduct,
- kSubscription,
- };
- // Describes an item from a digital goods service provider.
- // See https://wicg.github.io/digital-goods/#itemDetails-dictionary
- [Stable]
- struct ItemDetails {
- string item_id;
- string title;
- string description;
- PaymentCurrencyAmount price;
- // Periods are specified as ISO 8601 durations.
- // https://en.wikipedia.org/wiki/ISO_8601#Durations
- string? subscription_period;
- string? free_trial_period;
- PaymentCurrencyAmount? introductory_price;
- string? introductory_price_period;
- // Set to 0 for no introductory cycles.
- [MinVersion=1] uint32 introductory_price_cycles;
- [MinVersion=1] ItemType type;
- [MinVersion=1] array<url.mojom.Url>? icon_urls;
- };
- // Result of creating a Digital Goods service.
- [Extensible, Stable]
- enum CreateDigitalGoodsResponseCode {
- kOk,
- kError,
- kUnsupportedPaymentMethod,
- kUnsupportedContext,
- };
- // Describes a specific purchase of an item.
- // See https://wicg.github.io/digital-goods/#purchaseDetails-dictionary
- [Stable]
- struct PurchaseReference {
- string item_id;
- string purchase_token;
- };
|