gnunet-svn
[Top][All Lists]
Advanced

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

[taler-sync] 02/02: update to match merchant API change


From: gnunet
Subject: [taler-sync] 02/02: update to match merchant API change
Date: Fri, 30 Oct 2020 17:04:54 +0100

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

grothoff pushed a commit to branch master
in repository sync.

commit c0e3270e1499a525cd2cc7d21d31c26bdb0e705c
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Oct 30 16:59:57 2020 +0100

    update to match merchant API change
---
 src/sync/sync-httpd_backup_post.c | 40 ++++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 22 deletions(-)

diff --git a/src/sync/sync-httpd_backup_post.c 
b/src/sync/sync-httpd_backup_post.c
index a6c4362..23872e5 100644
--- a/src/sync/sync-httpd_backup_post.c
+++ b/src/sync/sync-httpd_backup_post.c
@@ -109,6 +109,7 @@ struct BackupContext
 
   /**
    * HTTP response code to use on resume, if non-NULL.
+
    */
   struct MHD_Response *resp;
 
@@ -305,35 +306,30 @@ make_payment_request (const char *order_id,
  * /contract request to a merchant.
  *
  * @param cls our `struct BackupContext`
- * @param hr HTTP response details
- * @param order_id order id of the newly created order
- * @param token the claim token generated by the merchant (NULL if
- *        it wasn't generated).
+ * @param por response details
  */
 static void
 proposal_cb (void *cls,
-             const struct TALER_MERCHANT_HttpResponse *hr,
-             const char *order_id,
-             const struct TALER_ClaimTokenP *token)
+             const struct TALER_MERCHANT_PostOrdersReply *por)
 {
   struct BackupContext *bc = cls;
   enum SYNC_DB_QueryStatus qs;
 
   bc->po = NULL;
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Resuming connection with order `%s'\n",
-              order_id);
   GNUNET_CONTAINER_DLL_remove (bc_head,
                                bc_tail,
                                bc);
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "Resuming connection with order `%s'\n",
+              bc->order_id);
   MHD_resume_connection (bc->con);
   SH_trigger_daemon ();
-  if (MHD_HTTP_OK != hr->http_status)
+  if (MHD_HTTP_OK != por->hr.http_status)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "Backend returned status %u/%u\n",
-                hr->http_status,
-                (unsigned int) hr->ec);
+                por->hr.http_status,
+                (unsigned int) por->hr.ec);
     GNUNET_break (0);
     bc->resp = TALER_MHD_make_json_pack ("{s:I, s:s, s:I, s:I, s:O}",
                                          "code",
@@ -342,22 +338,22 @@ proposal_cb (void *cls,
                                          "hint",
                                          "Failed to setup order with merchant 
backend",
                                          "backend-ec",
-                                         (json_int_t) hr->ec,
+                                         (json_int_t) por->hr.ec,
                                          "backend-http-status",
-                                         (json_int_t) hr->http_status,
+                                         (json_int_t) por->hr.http_status,
                                          "backend-reply",
-                                         hr->reply);
+                                         por->hr.reply);
     GNUNET_assert (NULL != bc->resp);
     bc->response_code = MHD_HTTP_FAILED_DEPENDENCY;
     return;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Storing payment request for order `%s'\n",
-              order_id);
+              por->details.ok.order_id);
   qs = db->store_payment_TR (db->cls,
                              &bc->account,
-                             order_id,
-                             token,
+                             por->details.ok.order_id,
+                             por->details.ok.token,
                              &SH_annual_fee);
   if (0 >= qs)
   {
@@ -370,9 +366,9 @@ proposal_cb (void *cls,
   }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Obtained fresh order `%s'\n",
-              order_id);
-  bc->resp = make_payment_request (order_id,
-                                   token);
+              por->details.ok.order_id);
+  bc->resp = make_payment_request (por->details.ok.order_id,
+                                   por->details.ok.token);
   GNUNET_assert (NULL != bc->resp);
   bc->response_code = MHD_HTTP_PAYMENT_REQUIRED;
 }

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