aboutsummaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_responses.c
diff options
context:
space:
mode:
authorJoseph <Joseph.xu@efrei.net>2022-11-08 09:22:05 -0500
committerJoseph <Joseph.xu@efrei.net>2022-11-08 09:22:05 -0500
commitf51e8a7150bee920f1bd3649c053b341419795c1 (patch)
treeb0f9f4edd0bb00cefaf2c8a6873871caf91305b1 /src/exchange/taler-exchange-httpd_responses.c
parent4394079a5e789189aa308ac85bcf704e34d3c1ee (diff)
parent0c32c48ac5628b2068fada9fc43fa0fa94d1c002 (diff)
merge
Diffstat (limited to 'src/exchange/taler-exchange-httpd_responses.c')
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
index ca110ad4..4120405f 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -1000,8 +1000,9 @@ TEH_RESPONSE_compile_reserve_history (
* @return MHD result code
*/
static MHD_RESULT
-reply_withdraw_insufficient_funds (
+reply_reserve_insufficient_funds (
struct MHD_Connection *connection,
+ enum TALER_ErrorCode ec,
const struct TALER_Amount *ebalance,
const struct TALER_Amount *withdraw_amount,
const struct TALER_EXCHANGEDB_ReserveHistory *rh)
@@ -1012,12 +1013,12 @@ reply_withdraw_insufficient_funds (
if (NULL == json_history)
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_EXCHANGE_WITHDRAW_HISTORY_ERROR_INSUFFICIENT_FUNDS,
+ TALER_EC_EXCHANGE_RESERVE_HISTORY_ERROR_INSUFFICIENT_FUNDS,
NULL);
return TALER_MHD_REPLY_JSON_PACK (
connection,
MHD_HTTP_CONFLICT,
- TALER_JSON_pack_ec (TALER_EC_EXCHANGE_WITHDRAW_INSUFFICIENT_FUNDS),
+ TALER_JSON_pack_ec (ec),
TALER_JSON_pack_amount ("balance",
ebalance),
TALER_JSON_pack_amount ("requested_amount",
@@ -1030,6 +1031,7 @@ reply_withdraw_insufficient_funds (
MHD_RESULT
TEH_RESPONSE_reply_reserve_insufficient_balance (
struct MHD_Connection *connection,
+ enum TALER_ErrorCode ec,
const struct TALER_Amount *balance_required,
const struct TALER_ReservePublicKeyP *reserve_pub)
{
@@ -1063,8 +1065,9 @@ TEH_RESPONSE_reply_reserve_insufficient_balance (
TALER_EC_GENERIC_DB_FETCH_FAILED,
"reserve history");
}
- mhd_ret = reply_withdraw_insufficient_funds (
+ mhd_ret = reply_reserve_insufficient_funds (
connection,
+ ec,
&balance,
balance_required,
rh);