summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-10-02 20:20:08 +0200
committerChristian Grothoff <christian@grothoff.org>2020-10-02 20:20:20 +0200
commite24064063f5d7dc36ab14e1f911708e6d981a10e (patch)
tree0c46d0fe2e8f6401eef0c40256d0c434fc00c1f5 /src/include
parentfc51e020796e4faa5435520adb5e3ca67ee6105f (diff)
downloadmerchant-e24064063f5d7dc36ab14e1f911708e6d981a10e.tar.gz
merchant-e24064063f5d7dc36ab14e1f911708e6d981a10e.tar.bz2
merchant-e24064063f5d7dc36ab14e1f911708e6d981a10e.zip
implement #6616 claim status in /private/orders/ID handler
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_merchant_service.h45
-rw-r--r--src/include/taler_merchant_testing_lib.h8
2 files changed, 44 insertions, 9 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index f59cfec0..1ff5fde3 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -1632,24 +1632,46 @@ struct TALER_MERCHANT_RefundOrderDetail
/**
+ * Status of an order.
+ */
+enum TALER_MERCHANT_OrderStatusCode
+{
+ /**
+ * The order was paid.
+ */
+ TALER_MERCHANT_OSC_PAID = 1,
+
+ /**
+ * The order was claimed but not yet paid.
+ */
+ TALER_MERCHANT_OSC_CLAIMED = 2,
+
+ /**
+ * The order was never paid or claimed.
+ */
+ TALER_MERCHANT_OSC_UNPAID = 3
+};
+
+
+/**
* Details about the status of an order.
*/
struct TALER_MERCHANT_OrderStatusResponse
{
/**
- * true if the payment is settled, false if not settled.
+ * Status of the order.
*/
- bool paid;
+ enum TALER_MERCHANT_OrderStatusCode status;
/**
- * Details depending on the payment status given in @e paid.
+ * Details depending on the payment status given in @e status.
*/
union
{
/**
- * Details provided if @e paid is #GNUNET_YES.
+ * Details provided if @e status is #TALER_MERCHANT_OSC_PAID.
*/
struct
{
@@ -1729,7 +1751,20 @@ struct TALER_MERCHANT_OrderStatusResponse
} paid;
/**
- * Details provided if @e paid is #GNUNET_NO.
+ * Details provided if @e status is #TALER_MERCHANT_OSC_CLAIMED.
+ */
+ struct
+ {
+
+ /**
+ * The full contract terms of the claimed order (including client nonce from claiming).
+ */
+ const json_t *contract_terms;
+
+ } claimed;
+
+ /**
+ * Details provided if @e status is #TALER_MERCHANT_OSC_UNPAID.
*/
struct
{
diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h
index aa0211a9..7c904dee 100644
--- a/src/include/taler_merchant_testing_lib.h
+++ b/src/include/taler_merchant_testing_lib.h
@@ -641,7 +641,7 @@ TALER_TESTING_cmd_wallet_poll_order_conclude (
* @param merchant_url base URL of the merchant which will
* serve the request.
* @param order_reference reference to a command that created an order.
- * @param paid whether the order has been paid for or not.
+ * @param osc expected order status
* @param refunded whether the order has been refunded.
* @param http_status expected HTTP response code for the request.
* @param ... NULL-terminated list of labels (const char *) of
@@ -653,7 +653,7 @@ struct TALER_TESTING_Command
TALER_TESTING_cmd_merchant_get_order (const char *label,
const char *merchant_url,
const char *order_reference,
- bool paid,
+ enum TALER_MERCHANT_OrderStatusCode osc,
bool refunded,
unsigned int http_status,
...);
@@ -666,7 +666,7 @@ TALER_TESTING_cmd_merchant_get_order (const char *label,
* @param merchant_url base URL of the merchant which will
* serve the request.
* @param order_reference reference to a command that created an order.
- * @param paid whether the order has been paid for or not.
+ * @param osc expected order status
* @param wired whether the order has been wired or not.
* @param transfers NULL-terminated list of labels (const char *) of
* wire transfers (commands) we expect to be aggregated in the order
@@ -686,7 +686,7 @@ struct TALER_TESTING_Command
TALER_TESTING_cmd_merchant_get_order2 (const char *label,
const char *merchant_url,
const char *order_reference,
- bool paid,
+ enum TALER_MERCHANT_OrderStatusCode osc,
bool wired,
const char **transfers,
bool refunded,