summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-29 22:28:16 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-29 22:28:16 +0200
commit220b06cf14f44f3241590e8e1cc08d23d44885e0 (patch)
treef6e83d6868bda00562c7b544bc4f599f410f3c1f
parent5823ad8b68e7259de00fda3c1187e046ae04abbd (diff)
downloaddocs-220b06cf14f44f3241590e8e1cc08d23d44885e0.tar.gz
docs-220b06cf14f44f3241590e8e1cc08d23d44885e0.tar.bz2
docs-220b06cf14f44f3241590e8e1cc08d23d44885e0.zip
update spec
-rw-r--r--core/api-merchant.rst46
1 files changed, 19 insertions, 27 deletions
diff --git a/core/api-merchant.rst b/core/api-merchant.rst
index b8c9eae8..70241b09 100644
--- a/core/api-merchant.rst
+++ b/core/api-merchant.rst
@@ -417,7 +417,7 @@ management.
// including all existing sales ever. Given in product-specific
// units.
// A value of -1 indicates "infinite" (i.e. for "electronic" books).
- total_stocked: Integer;
+ total_stock: Integer;
// Number of units of the product that have already been sold.
total_sold: Integer;
@@ -483,7 +483,7 @@ management.
// including all existing sales ever. Given in product-specific
// units.
// A value of -1 indicates "infinite" (i.e. for "electronic" books).
- total_stocked: Integer;
+ total_stock: Integer;
// Identifies where the product is in stock.
address: Location;
@@ -498,7 +498,7 @@ management.
.. http:patch:: /private/products/$PRODUCT_ID
This is used to update product details in the inventory. Note that the
- ``total_stocked`` and ``total_lost`` numbers MUST be greater or equal than
+ ``total_stock`` and ``total_lost`` numbers MUST be greater or equal than
previous values (this design ensures idempotency). In case stocks were lost
but not sold, increment the ``total_lost`` number. All fields in the
request are optional, those that are not given are simply preserved (not
@@ -548,7 +548,7 @@ management.
// including all existing sales ever. Given in product-specific
// units.
// A value of -1 indicates "infinite" (i.e. for "electronic" books).
- total_stocked: Integer;
+ total_stock: Integer;
// Number of units of the product that were lost (spoiled, stolen, etc.)
total_lost: Integer;
@@ -786,7 +786,7 @@ Receiving Payments
:query wired: *Optional*. If set to yes, only return wired orders, if no only orders with missing wire transfers. Do not give (or use "all") to see all orders regardless of wire transfer status.
:query date: *Optional.* Time threshold, see ``delta`` for its interpretation. Defaults to the oldest or most recent entry, depending on ``delta``.
:query start: *Optional*. Row number threshold, see ``delta`` for its interpretation. Defaults to ``UINT64_MAX``, namely the biggest row id possible in the database.
- :query delta: *Optional*. takes value of the form ``N (-N)``, so that at most ``N`` values strictly younger (older) than ``start`` and ``date`` are returned. Defaults to ``-20``.
+ :query delta: *Optional*. takes value of the form ``N (-N)``, so that at most ``N`` values strictly older (younger) than ``start`` and ``date`` are returned. Defaults to ``-20`` to return the last 20 entries (before ``start`` and/or ``date``).
:query timeout_ms: *Optional*. Timeout in milli-seconds to wait for additional orders if the answer would otherwise be negative (long polling). Only useful if delta is positive. Note that the merchant MAY still return a response that contains fewer than delta orders.
**Response:**
@@ -815,20 +815,6 @@ Receiving Payments
// Transaction's timestamp
timestamp: Timestamp;
- // Total amount the customer should pay for this order.
- total: Amount;
-
- // Total amount the customer did pay for this order. Payments
- // that were later aborted (/abort) are NOT included.
- paid: Amount;
-
- // Total amount the customer was refunded for this order.
- // (excludes refunds from aborts).
- refunded: Amount;
-
- // Was the order fully paid?
- is_paid: boolean;
-
}
@@ -921,7 +907,13 @@ Receiving Payments
.. ts:def:: PayRequest
interface PayRequest {
+ // The coins used to make the payment.
coins: CoinPaySig[];
+
+ // The session for which the payment is made (or replayed).
+ // Only set for session-based payments.
+ session_id: string;
+
}
.. ts:def:: CoinPaySig
@@ -936,8 +928,8 @@ Receiving Payments
// Signature made by the denomination public key.
ub_sig: string;
- // The denomination public key associated with this coin.
- denom_pub: string;
+ // The hash of the denomination public key associated with this coin.
+ h_denom: HashCode;
// The amount that is subtracted from this coin with this payment.
contribution: Amount;
@@ -1975,28 +1967,28 @@ The contract terms must have the following structure:
description_i18n?: { [lang_tag: string]: string };
// The number of units of the product to deliver to the customer.
- quantity: Integer;
+ quantity?: Integer;
// The unit in which the product is measured (liters, kilograms, packages, etc.)
- unit: string;
+ unit?: string;
// The price of the product; this is the total price for ``quantity`` times ``unit`` of this product.
- price: Amount;
+ price?: Amount;
// An optional base64-encoded product image
image?: ImageDataUrl;
// a list of taxes paid by the merchant for this product. Can be empty.
- taxes: Tax[];
+ taxes?: Tax[];
// time indicating when this product should be delivered
- delivery_date: Timestamp;
+ delivery_date?: Timestamp;
// where to deliver this product. This may be an URL for online delivery
// (i.e. 'http://example.com/download' or 'mailto:customer@example.com'),
// or a location label defined inside the proposition's 'locations'.
// The presence of a colon (':') indicates the use of an URL.
- delivery_location: string;
+ delivery_location?: string;
}
.. ts:def:: Tax