summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_responses.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-12-23 23:33:22 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2023-12-23 23:33:22 +0100
commit234b0cd56f69305f27ac5f6cd3828c0d115dcd0f (patch)
tree10d8f0872098d308cbaf2f0b6abb69936a104fb8 /src/exchange/taler-exchange-httpd_responses.c
parent13bb37b6a811451accc14b3501173637f2c28d10 (diff)
downloadexchange-234b0cd56f69305f27ac5f6cd3828c0d115dcd0f.tar.gz
exchange-234b0cd56f69305f27ac5f6cd3828c0d115dcd0f.tar.bz2
exchange-234b0cd56f69305f27ac5f6cd3828c0d115dcd0f.zip
Added appropriate response on contract-conflict during deposit
In case of a detected conflict during deposit, because (merchant_pub, h_contract_terms) already existed, with different other field values, we now provide the client an error response that contains the h_wire. This way, the client can retrieve further details about the conflicting transaction via /deposits/$H_WIRE/$MERCHANT_PUB/$H_CONTRACT_TERMS/$COIN_PUB Fixes #8002
Diffstat (limited to 'src/exchange/taler-exchange-httpd_responses.c')
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
index a6d2c7ffc..8993ea50f 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -180,6 +180,21 @@ TEH_RESPONSE_reply_coin_insufficient_funds (
MHD_RESULT
+TEH_RESPONSE_reply_coin_conflicting_contract (
+ struct MHD_Connection *connection,
+ enum TALER_ErrorCode ec,
+ const struct TALER_MerchantWireHashP *h_wire)
+{
+ return TALER_MHD_REPLY_JSON_PACK (
+ connection,
+ TALER_ErrorCode_get_http_status_safe (ec),
+ GNUNET_JSON_pack_data_auto ("h_wire",
+ h_wire),
+ TALER_JSON_pack_ec (ec));
+}
+
+
+MHD_RESULT
TEH_RESPONSE_reply_coin_denomination_conflict (
struct MHD_Connection *connection,
enum TALER_ErrorCode ec,