summaryrefslogtreecommitdiff
path: root/core/api-merchant.rst
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-04-01 15:17:36 +0200
committerChristian Grothoff <christian@grothoff.org>2024-04-01 15:17:36 +0200
commitb1c4949cda876f698ccfc9cc190f4a50453cb194 (patch)
tree2a46ed0522dcd4edb214eb8135f1b9e107ea2d9f /core/api-merchant.rst
parent709e431603d6226836d937620cda2909ebfeaa36 (diff)
downloaddocs-b1c4949cda876f698ccfc9cc190f4a50453cb194.tar.gz
docs-b1c4949cda876f698ccfc9cc190f4a50453cb194.tar.bz2
docs-b1c4949cda876f698ccfc9cc190f4a50453cb194.zip
resolve build warnings
Diffstat (limited to 'core/api-merchant.rst')
-rw-r--r--core/api-merchant.rst200
1 files changed, 99 insertions, 101 deletions
diff --git a/core/api-merchant.rst b/core/api-merchant.rst
index 537dc67c..3454313e 100644
--- a/core/api-merchant.rst
+++ b/core/api-merchant.rst
@@ -354,7 +354,7 @@ Making the payment
// @since protocol **vSUBSCRIBE**
choice_index?: Integer;
- // Input tokens required by choice indicated by `choice_index`.
+ // Input tokens required by choice indicated by ``choice_index``.
// @since protocol **vSUBSCRIBE**
tokens: TokenPaySig[];
@@ -1809,7 +1809,7 @@ Inspecting inventory
product_id: string;
// ``product_serial_id`` of the product in the database.
- product_serial: integer;
+ product_serial: Integer;
}
@@ -2171,81 +2171,81 @@ of buying an article, the merchant could present the customer with the choice
to use a valid subscription token or pay using a gift voucher. Available since
protocol **vSUBSCRIBE**.
-.. ts:def:: OrderChoice
+ .. ts:def:: OrderChoice
- interface OrderChoice {
- // Inputs that must be provided by the customer, if this choice is selected.
- inputs: OrderInput[];
+ interface OrderChoice {
+ // Inputs that must be provided by the customer, if this choice is selected.
+ inputs: OrderInput[];
- // Outputs provided by the merchant, if this choice is selected.
- outputs: ContractOutput[];
- }
+ // Outputs provided by the merchant, if this choice is selected.
+ outputs: ContractOutput[];
+ }
-.. ts:def:: OrderInput
+ .. ts:def:: OrderInput
- // For now, only token inputs are supported.
- type OrderInput = OrderInputToken;
+ // For now, only token inputs are supported.
+ type OrderInput = OrderInputToken;
-.. ts:def:: OrderInputToken
+ .. ts:def:: OrderInputToken
- interface OrderInputToken {
+ interface OrderInputToken {
- // Token input.
- type: "token";
+ // Token input.
+ type: "token";
- // Token family slug as configured in the merchant backend. Slug is unique
- // across all configured tokens of a merchant.
- token_family_slug: string;
+ // Token family slug as configured in the merchant backend. Slug is unique
+ // across all configured tokens of a merchant.
+ token_family_slug: string;
- // Start of the validity period of the token. Based on this, the merchant
- // will select the relevant signing key.
- valid_after: Timestamp;
+ // Start of the validity period of the token. Based on this, the merchant
+ // will select the relevant signing key.
+ valid_after: Timestamp;
- // How many units of the input are required.
- // Defaults to 1 if not specified. Output with count == 0 are ignored by
- // the merchant backend.
- count?: Integer;
+ // How many units of the input are required.
+ // Defaults to 1 if not specified. Output with count == 0 are ignored by
+ // the merchant backend.
+ count?: Integer;
- }
+ }
-.. ts:def:: OrderOutput
+ .. ts:def:: OrderOutput
- type OrderOutput = OrderOutputToken | OrderOutputTaxReceipt;
+ type OrderOutput = OrderOutputToken | OrderOutputTaxReceipt;
-.. ts:def:: OrderOutputToken
+ .. ts:def:: OrderOutputToken
- interface OrderOutputToken {
+ interface OrderOutputToken {
- // Token output.
- type: "token";
+ // Token output.
+ type: "token";
- // Token family slug as configured in the merchant backend. Slug is unique
- // across all configured tokens of a merchant.
- token_family_slug: string;
+ // Token family slug as configured in the merchant backend. Slug is unique
+ // across all configured tokens of a merchant.
+ token_family_slug: string;
- // Start of the validity period of the token. Based on this, the merchant
- // will select the relevant signing key.
- valid_after: Timestamp;
+ // Start of the validity period of the token. Based on this, the merchant
+ // will select the relevant signing key.
+ valid_after: Timestamp;
- // How many units of the output are issued by the merchant.
- // Defaults to 1 if not specified. Output with count == 0 are ignored by
- // the merchant backend.
- count?: Integer;
+ // How many units of the output are issued by the merchant.
+ // Defaults to 1 if not specified. Output with count == 0 are ignored by
+ // the merchant backend.
+ count?: Integer;
- }
+ }
-.. ts:def:: OrderOutputTaxReceipt
+ .. ts:def:: OrderOutputTaxReceipt
- interface OrderOutputTaxReceipt {
+ interface OrderOutputTaxReceipt {
- // Tax receipt output.
- type: "tax-receipt";
+ // Tax receipt output.
+ type: "tax-receipt";
- // Base URL of the donation authority that will
- // issue the tax receipt.
- donau_url: string;
+ // Base URL of the donation authority that will
+ // issue the tax receipt.
+ donau_url: string;
- }
+ }
The following `MinimalInventoryProduct` can be provided if the parts of the
order are inventory-based, that is if the `PostOrderRequest` uses
@@ -2259,51 +2259,49 @@ protocol **vSUBSCRIBE**.
the ``amount`` of the ``order``, so the frontend must already have calculated
the total price --- including the ``inventory_products``.
- .. ts:def:: MinimalInventoryProduct
+.. ts:def:: MinimalInventoryProduct
- // Note that if the frontend does give details beyond these,
- // it will override those details (including price or taxes)
- // that the backend would otherwise fill in via the inventory.
-
- interface MinimalInventoryProduct {
- // Which product is requested (here mandatory!).
- product_id: string;
-
- // How many units of the product are requested.
- quantity: Integer;
- }
+ // Note that if the frontend does give details beyond these,
+ // it will override those details (including price or taxes)
+ // that the backend would otherwise fill in via the inventory.
+ interface MinimalInventoryProduct {
+ // Which product is requested (here mandatory!).
+ product_id: string;
+ // How many units of the product are requested.
+ quantity: Integer;
+ }
- .. ts:def:: PostOrderResponse
+.. ts:def:: PostOrderResponse
- interface PostOrderResponse {
- // Order ID of the response that was just created.
- order_id: string;
+ interface PostOrderResponse {
+ // Order ID of the response that was just created.
+ order_id: string;
- // Token that authorizes the wallet to claim the order.
- // Provided only if "create_token" was set to 'true'
- // in the request.
- token?: ClaimToken;
- }
+ // Token that authorizes the wallet to claim the order.
+ // Provided only if "create_token" was set to 'true'
+ // in the request.
+ token?: ClaimToken;
+ }
- .. ts:def:: OutOfStockResponse
+.. ts:def:: OutOfStockResponse
- interface OutOfStockResponse {
+ interface OutOfStockResponse {
- // Product ID of an out-of-stock item.
- product_id: string;
+ // Product ID of an out-of-stock item.
+ product_id: string;
- // Requested quantity.
- requested_quantity: Integer;
+ // Requested quantity.
+ requested_quantity: Integer;
- // Available quantity (must be below ``requested_quantity``).
- available_quantity: Integer;
+ // Available quantity (must be below ``requested_quantity``).
+ available_quantity: Integer;
- // When do we expect the product to be again in stock?
- // Optional, not given if unknown.
- restock_expected?: Timestamp;
- }
+ // When do we expect the product to be again in stock?
+ // Optional, not given if unknown.
+ restock_expected?: Timestamp;
+ }
Inspecting orders
@@ -3145,17 +3143,17 @@ Adding templates
template_contract: TemplateContractDetails;
// Key-value pairs matching a subset of the
- // fields from `template_contract` that are
+ // fields from ``template_contract`` that are
// user-editable defaults for this template.
// Since protocol **v13**.
editable_defaults?: Object;
// Required currency for payments. Useful if no
- // amount is specified in the `template_contract`
+ // amount is specified in the ``template_contract``
// but the user should be required to pay in a
// particular currency anyway. Merchant backends
- // may reject requests if the `template_contract`
- // or `editable_defaults` do
+ // may reject requests if the ``template_contract``
+ // or ``editable_defaults`` do
// specify an amount in a different currency.
// This parameter is optional.
// Since protocol **v13**.
@@ -3230,17 +3228,17 @@ Editing templates
template_contract: TemplateContractDetails;
// Key-value pairs matching a subset of the
- // fields from `template_contract` that are
+ // fields from ``template_contract`` that are
// user-editable defaults for this template.
// Since protocol **v13**.
editable_defaults?: Object;
// Required currency for payments. Useful if no
- // amount is specified in the `template_contract`
+ // amount is specified in the ``template_contract``
// but the user should be required to pay in a
// particular currency anyway. Merchant backends
- // may reject requests if the `template_contract`
- // or `editable_defaults` do
+ // may reject requests if the ``template_contract``
+ // or ``editable_defaults`` do
// specify an amount in a different currency.
// This parameter is optional.
// Since protocol **v13**.
@@ -3315,17 +3313,17 @@ Inspecting template
template_contract: TemplateContractDetails;
// Key-value pairs matching a subset of the
- // fields from `template_contract` that are
+ // fields from ``template_contract`` that are
// user-editable defaults for this template.
// Since protocol **v13**.
editable_defaults?: Object;
// Required currency for payments. Useful if no
- // amount is specified in the `template_contract`
+ // amount is specified in the ``template_contract``
// but the user should be required to pay in a
// particular currency anyway. Merchant backends
- // may reject requests if the `template_contract`
- // or `editable_defaults` do
+ // may reject requests if the ``template_contract``
+ // or ``editable_defaults`` do
// specify an amount in a different currency.
// This parameter is optional.
// Since protocol **v13**.
@@ -3376,17 +3374,17 @@ Using template
template_contract: TemplateContractDetails;
// Key-value pairs matching a subset of the
- // fields from `template_contract` that are
+ // fields from ``template_contract`` that are
// user-editable defaults for this template.
// Since protocol **v13**.
editable_defaults?: Object;
// Required currency for payments. Useful if no
- // amount is specified in the `template_contract`
+ // amount is specified in the ``template_contract``
// but the user should be required to pay in a
// particular currency anyway. Merchant backends
- // may reject requests if the `template_contract`
- // or `editable_defaults` do
+ // may reject requests if the ``template_contract``
+ // or ``editable_defaults`` do
// specify an amount in a different currency.
// This parameter is optional.
// Since protocol **v13**.