gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: adaptations for #7275


From: gnunet
Subject: [taler-merchant] branch master updated: adaptations for #7275
Date: Sun, 03 Sep 2023 17:58:47 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new d289bb87 adaptations for #7275
d289bb87 is described below

commit d289bb8718d6cb2f3962e325e9d8d7156dd12af8
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Sun Sep 3 17:58:43 2023 +0200

    adaptations for #7275
---
 src/bank/mb_credit.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/bank/mb_credit.c b/src/bank/mb_credit.c
index 345a79c8..65da86e0 100644
--- a/src/bank/mb_credit.c
+++ b/src/bank/mb_credit.c
@@ -69,15 +69,21 @@ static enum GNUNET_GenericReturnValue
 parse_account_history (struct TALER_MERCHANT_BANK_CreditHistoryHandle *hh,
                        const json_t *history)
 {
-  json_t *history_array;
+  const json_t *history_array;
+  const char *credit_account_uri;
+  struct GNUNET_JSON_Specification spec[] = {
+    GNUNET_JSON_spec_array_const ("incoming_transactions",
+                                  &history_array),
+    GNUNET_JSON_spec_string ("credit_account",
+                             &credit_account_uri),
+    GNUNET_JSON_spec_end ()
+  };
 
-  if (NULL == (history_array = json_object_get (history,
-                                                "incoming_transactions")))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (! json_is_array (history_array))
+  if (GNUNET_OK !=
+      GNUNET_JSON_parse (history,
+                         spec,
+                         NULL,
+                         NULL))
   {
     GNUNET_break_op (0);
     return GNUNET_SYSERR;
@@ -97,8 +103,6 @@ parse_account_history (struct 
TALER_MERCHANT_BANK_CreditHistoryHandle *hh,
                                &td.wire_subject),
       GNUNET_JSON_spec_string ("debit_account",
                                &td.debit_account_uri),
-      GNUNET_JSON_spec_string ("credit_account",
-                               &td.credit_account_uri),
       GNUNET_JSON_spec_end ()
     };
     json_t *transaction = json_array_get (history_array,
@@ -112,6 +116,7 @@ parse_account_history (struct 
TALER_MERCHANT_BANK_CreditHistoryHandle *hh,
       GNUNET_break_op (0);
       return GNUNET_SYSERR;
     }
+    td.credit_account_uri = credit_account_uri;
     if (GNUNET_OK !=
         hh->hcb (hh->hcb_cls,
                  MHD_HTTP_OK,

-- 
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]