summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-12-11 22:00:27 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2023-12-11 22:00:27 +0100
commitaa19314cc57e0db045b84829410c01e0084cb540 (patch)
tree4534144c4da67a2961d9433274d04b9b8540108b
parenta9c54ef2095fa930f500eeaa606c34621948e706 (diff)
parentc8a56f18cabc139b3f860b6eab3d9e4cb0c63355 (diff)
downloadexchange-aa19314cc57e0db045b84829410c01e0084cb540.tar.gz
exchange-aa19314cc57e0db045b84829410c01e0084cb540.tar.bz2
exchange-aa19314cc57e0db045b84829410c01e0084cb540.zip
Merge branch 'master' of ssh://git.taler.net/exchange
-rw-r--r--src/bank-lib/fakebank_tbi_get_withdrawal_operation.c14
-rw-r--r--src/bank-lib/fakebank_tbi_post_withdrawal_operation.c12
2 files changed, 25 insertions, 1 deletions
diff --git a/src/bank-lib/fakebank_tbi_get_withdrawal_operation.c b/src/bank-lib/fakebank_tbi_get_withdrawal_operation.c
index fba8c5de6..4749bda77 100644
--- a/src/bank-lib/fakebank_tbi_get_withdrawal_operation.c
+++ b/src/bank-lib/fakebank_tbi_get_withdrawal_operation.c
@@ -56,6 +56,7 @@ TALER_FAKEBANK_tbi_get_withdrawal_operation_ (
{
struct ConnectionContext *cc = *con_cls;
struct WithdrawContext *wc;
+ const char *status_string;
GNUNET_assert (0 ==
pthread_mutex_lock (&h->big_lock));
@@ -97,15 +98,28 @@ TALER_FAKEBANK_tbi_get_withdrawal_operation_ (
json_string ("x-taler-bank")));
GNUNET_assert (0 ==
pthread_mutex_unlock (&h->big_lock));
+ if (wc->wo->aborted)
+ status_string = "aborted";
+ else if (wc->wo->confirmation_done)
+ status_string = "confirmed";
+ else if (wc->wo->selection_done)
+ status_string = "selected";
+ else
+ status_string = "pending";
return TALER_MHD_REPLY_JSON_PACK (
connection,
MHD_HTTP_OK,
+ // FIXME: deprecated field, should be removed in the future.
GNUNET_JSON_pack_bool ("aborted",
wc->wo->aborted),
+ // FIXME: deprecated field, should be removed in the future.
GNUNET_JSON_pack_bool ("selection_done",
wc->wo->selection_done),
+ // FIXME: deprecated field, should be removed in the future.
GNUNET_JSON_pack_bool ("transfer_done",
wc->wo->confirmation_done),
+ GNUNET_JSON_pack_string ("status",
+ status_string),
GNUNET_JSON_pack_allow_null (
GNUNET_JSON_pack_string ("suggested_exchange",
h->exchange_url)),
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));
}