commit 2e13cfbbd212f13b3aefeeb9311c6c496d239963
parent cfdbc9a3c3fba99982beaf156794cb51494e0c3f
Author: Florian Dold <florian@dold.me>
Date: Mon, 11 Dec 2023 20:24:20 +0100
fakebank: implement change to bank integration API
We now return the status field in POST /withdrawal-operation/$WITHDRAWAL_ID
Diffstat:
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/bank-lib/fakebank_tbi_post_withdrawal_operation.c b/src/bank-lib/fakebank_tbi_post_withdrawal_operation.c
@@ -53,6 +53,7 @@ do_post_withdrawal (
struct WithdrawalOperation *wo;
char *credit_name;
struct Account *credit_account;
+ const char *status_string;
GNUNET_assert (0 ==
pthread_mutex_lock (&h->big_lock));
@@ -138,11 +139,20 @@ do_post_withdrawal (
wo->selection_done = true;
GNUNET_assert (0 ==
pthread_mutex_unlock (&h->big_lock));
+ if (wo->aborted)
+ status_string = "aborted";
+ else if (wo->confirmation_done)
+ status_string = "confirmed";
+ else
+ status_string = "selected";
return TALER_MHD_REPLY_JSON_PACK (
connection,
MHD_HTTP_OK,
+ // FIXME: Deprecated field, should be deleted in the future.
GNUNET_JSON_pack_bool ("transfer_done",
- wo->confirmation_done));
+ wo->confirmation_done),
+ GNUNET_JSON_pack_string ("status",
+ status_string));
}