gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: fakebank: update bank integratio


From: gnunet
Subject: [taler-exchange] branch master updated: fakebank: update bank integration API
Date: Mon, 11 Dec 2023 20:30:31 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new c8a56f18 fakebank: update bank integration API
c8a56f18 is described below

commit c8a56f18cabc139b3f860b6eab3d9e4cb0c63355
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Dec 11 20:29:33 2023 +0100

    fakebank: update bank integration API
    
    The response to GET /withdrawal-operation/$WITHDRAWAL_ID also must
    include the status field.
---
 src/bank-lib/fakebank_tbi_get_withdrawal_operation.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/bank-lib/fakebank_tbi_get_withdrawal_operation.c 
b/src/bank-lib/fakebank_tbi_get_withdrawal_operation.c
index fba8c5de..4749bda7 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)),

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]