gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated (1f55bc5 -> 48e6c1d)


From: gnunet
Subject: [taler-anastasis] branch master updated (1f55bc5 -> 48e6c1d)
Date: Fri, 30 Oct 2020 17:13:16 +0100

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

grothoff pushed a change to branch master
in repository anastasis.

    from 1f55bc5  added appendices
     new f0fc345  API rename in merchant
     new 48e6c1d  update to match merchant API change

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/backend/anastasis-httpd_policy_upload.c | 35 +++++++++++++----------------
 src/backend/anastasis-httpd_truth.c         | 33 ++++++++++++---------------
 2 files changed, 29 insertions(+), 39 deletions(-)

diff --git a/src/backend/anastasis-httpd_policy_upload.c 
b/src/backend/anastasis-httpd_policy_upload.c
index bddc811..3063d4b 100644
--- a/src/backend/anastasis-httpd_policy_upload.c
+++ b/src/backend/anastasis-httpd_policy_upload.c
@@ -98,7 +98,7 @@ struct PolicyUploadContext
   /**
    * Used while we are awaiting proposal creation.
    */
-  struct TALER_MERCHANT_PostOrdersOperation *po;
+  struct TALER_MERCHANT_PostOrdersHandle *po;
 
   /**
    * Used while we are waiting payment.
@@ -279,17 +279,14 @@ amount_to_post_counter (const struct TALER_Amount *amount)
 
 /**
  * Callbacks of this type are used to serve the result of submitting a
- * /contract request to a merchant.
+ * POST /private/orders request to a merchant.
  *
  * @param cls our `struct PolicyUploadContext`
- * @param hr HTTP response details
- * @param order_id payment_identifier (base32 encoded) of the newly created 
order
+ * @param por response details
  */
 static void
 proposal_cb (void *cls,
-             const struct TALER_MERCHANT_HttpResponse *hr,
-             const char *order_id,
-             const struct TALER_ClaimTokenP *claim_token)
+             const struct TALER_MERCHANT_PostOrdersReply *por)
 {
   struct PolicyUploadContext *puc = cls;
   enum ANASTASIS_DB_QueryStatus qs;
@@ -299,40 +296,38 @@ proposal_cb (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Resuming connection with order `%s'\n",
-              order_id);
+              puc->order_id);
   GNUNET_CONTAINER_DLL_remove (puc_head,
                                puc_tail,
                                puc);
   MHD_resume_connection (puc->con);
   AH_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/%d\n",
-                hr->http_status,
-                (int) hr->ec);
+                por->hr.http_status,
+                (int) por->hr.ec);
     GNUNET_break (0);
     puc->resp = TALER_MHD_make_json_pack (
-      (NULL == hr->reply)
-      ? "{s:I, s:s, s:I, s:I}"
-      : "{s:I, s:s, s:I, s:I, s:O}",
+      "{s:I, s:s, s:I, s:I, s:O?}",
       "code",
       (json_int_t) TALER_EC_SYNC_PAYMENT_CREATE_BACKEND_ERROR,
       "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 != puc->resp);
     puc->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
     return;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Storing payment request for order `%s'\n",
-              order_id);
+              por->details.ok.order_id);
 
   post_counter = (uint32_t) amount_to_post_counter (&AH_annual_fee);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -356,8 +351,8 @@ proposal_cb (void *cls,
   }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Obtained fresh order `%s'\n",
-              order_id);
-  puc->resp = make_payment_request (order_id);
+              por->details.ok.order_id);
+  puc->resp = make_payment_request (por->details.ok.order_id);
   GNUNET_assert (NULL != puc->resp);
   puc->response_code = MHD_HTTP_PAYMENT_REQUIRED;
 }
diff --git a/src/backend/anastasis-httpd_truth.c 
b/src/backend/anastasis-httpd_truth.c
index 9baddb3..8aadf38 100644
--- a/src/backend/anastasis-httpd_truth.c
+++ b/src/backend/anastasis-httpd_truth.c
@@ -60,7 +60,7 @@ struct GetContext
   /**
    * Used while we are awaiting proposal creation.
    */
-  struct TALER_MERCHANT_PostOrdersOperation *po;
+  struct TALER_MERCHANT_PostOrdersHandle *po;
   /**
    * Used while we are waiting payment.
    */
@@ -203,14 +203,11 @@ make_payment_request (const char *order_id)
  * /contract request to a merchant.
  *
  * @param cls our `struct PolicyUploadContext`
- * @param hr HTTP response details
- * @param order_id payment_identifier (base32 encoded) of the newly created 
order
+ * @param por response details
  */
 static void
 proposal_cb (void *cls,
-             const struct TALER_MERCHANT_HttpResponse *hr,
-             const char *order_id,
-             const struct TALER_ClaimTokenP *claim_token)
+             const struct TALER_MERCHANT_PostOrdersReply *por)
 {
   struct GetContext *gc = cls;
   enum ANASTASIS_DB_QueryStatus qs;
@@ -219,40 +216,38 @@ proposal_cb (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Resuming connection with order `%s'\n",
-              order_id);
+              gc->order_id);
   GNUNET_CONTAINER_DLL_remove (gc_head,
                                gc_tail,
                                gc);
   MHD_resume_connection (gc->connection);
   AH_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/%d\n",
-                hr->http_status,
-                (int) hr->ec);
+                por->hr.http_status,
+                (int) por->hr.ec);
     GNUNET_break (0);
     gc->resp = TALER_MHD_make_json_pack (
-      (NULL == hr->reply)
-      ? "{s:I, s:s, s:I, s:I}"
-      : "{s:I, s:s, s:I, s:I, s:O}",
+      "{s:I, s:s, s:I, s:I, s:O?}",
       "code",
       (json_int_t) TALER_EC_SYNC_PAYMENT_CREATE_BACKEND_ERROR,
       "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 != gc->resp);
     gc->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
     return;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Storing payment request for order `%s'\n",
-              order_id);
+              por->details.ok.order_id);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Payment-Identifier to be saved to db: %s\n",
               TALER_B2S (&gc->payment_identifier));
@@ -271,8 +266,8 @@ proposal_cb (void *cls,
   }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Obtained fresh order `%s'\n",
-              order_id);
-  gc->resp = make_payment_request (order_id);
+              por->details.ok.order_id);
+  gc->resp = make_payment_request (por->details.ok.order_id);
   GNUNET_assert (NULL != gc->resp);
   gc->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]