summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-get-orders-ID.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-10-20 20:24:03 +0200
committerChristian Grothoff <christian@grothoff.org>2020-10-20 20:24:03 +0200
commit3a74de266c9724c6b804244e14870cd017e8a721 (patch)
tree5def2405afae3d20839e02681a42ca5c02ab31ab /src/backend/taler-merchant-httpd_private-get-orders-ID.c
parent33e80b885a9c97d85eb009027feecfba2928165f (diff)
downloadmerchant-3a74de266c9724c6b804244e14870cd017e8a721.tar.gz
merchant-3a74de266c9724c6b804244e14870cd017e8a721.tar.bz2
merchant-3a74de266c9724c6b804244e14870cd017e8a721.zip
expose refund_pending status in GET /private/orders/<ID> operation. Fixes #6491.
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-orders-ID.c')
-rw-r--r--src/backend/taler-merchant-httpd_private-get-orders-ID.c69
1 files changed, 39 insertions, 30 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
index 49bd63cf..9f0b9fef 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -251,6 +251,12 @@ struct GetOrderRequestContext
bool refunded;
/**
+ * Set to true if this payment has been refunded and
+ * some refunds remain to be picked up by the wallet.
+ */
+ bool refund_pending;
+
+ /**
* Did the client request us to fetch the wire transfer status?
* If false, we may still return it if it is available.
*/
@@ -667,6 +673,7 @@ process_refunds_cb (void *cls,
&gorc->refund_amount,
refund_amount));
gorc->refunded = true;
+ gorc->refund_pending = pending;
}
@@ -1262,36 +1269,38 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh,
h_contract);
}
- ret = TALER_MHD_reply_json_pack (connection,
- MHD_HTTP_OK,
- "{s:o, s:I, s:I, s:o, s:O,"
- " s:s, s:b, s:b, s:o, s:o, s:o, s:s}",
- "wire_reports",
- gorc->wire_reports,
- "exchange_ec",
- (json_int_t) gorc->exchange_ec,
- "exchange_hc",
- (json_int_t) gorc->exchange_hc,
- "deposit_total",
- TALER_JSON_from_amount (
- &gorc->deposits_total),
- "contract_terms",
- gorc->contract_terms,
- "order_status",
- "paid",
- "refunded",
- gorc->refunded,
- "wired",
- wired,
- "refund_amount",
- TALER_JSON_from_amount (
- &gorc->refund_amount),
- "wire_details",
- gorc->wire_details,
- "refund_details",
- gorc->refund_details,
- "order_status_url",
- order_status_url);
+ ret = TALER_MHD_reply_json_pack (
+ connection,
+ MHD_HTTP_OK,
+ "{s:o, s:I, s:I, s:o, s:O,"
+ " s:s, s:b, s:b, s:b, s:o,"
+ " s:o, s:o, s:s}",
+ "wire_reports",
+ gorc->wire_reports,
+ "exchange_ec",
+ (json_int_t) gorc->exchange_ec,
+ "exchange_hc",
+ (json_int_t) gorc->exchange_hc,
+ "deposit_total",
+ TALER_JSON_from_amount (&gorc->deposits_total),
+ "contract_terms",
+ gorc->contract_terms,
+ "order_status",
+ "paid",
+ "refunded",
+ gorc->refunded,
+ "wired",
+ wired,
+ "refund_pending",
+ gorc->refund_pending,
+ "refund_amount",
+ TALER_JSON_from_amount (&gorc->refund_amount),
+ "wire_details",
+ gorc->wire_details,
+ "refund_details",
+ gorc->refund_details,
+ "order_status_url",
+ order_status_url);
GNUNET_free (order_status_url);
gorc->wire_details = NULL;
gorc->wire_reports = NULL;