diff options
author | Florian Dold <florian@dold.me> | 2023-12-11 20:24:20 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-12-11 20:24:20 +0100 |
commit | 2e13cfbbd212f13b3aefeeb9311c6c496d239963 (patch) | |
tree | 49fc1bdc351eec55b5b49e763742f2f493d988cc | |
parent | cfdbc9a3c3fba99982beaf156794cb51494e0c3f (diff) |
fakebank: implement change to bank integration API
We now return the status field in POST /withdrawal-operation/$WITHDRAWAL_ID
-rw-r--r-- | src/bank-lib/fakebank_tbi_post_withdrawal_operation.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/bank-lib/fakebank_tbi_post_withdrawal_operation.c b/src/bank-lib/fakebank_tbi_post_withdrawal_operation.c index 3dbbb3c91..38b92e494 100644 --- 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)); } |