gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: adapt to latest merchant API


From: gnunet
Subject: [taler-anastasis] branch master updated: adapt to latest merchant API
Date: Mon, 06 Apr 2020 19:57:28 +0200

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

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new fb30bb5  adapt to latest merchant API
fb30bb5 is described below

commit fb30bb50f1d5ba879b7b0a61c54ce713e7730815
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Apr 6 19:57:26 2020 +0200

    adapt to latest merchant API
---
 src/backend/anastasis-httpd_policy_upload.c | 44 +++++++++++++----------------
 1 file changed, 20 insertions(+), 24 deletions(-)

diff --git a/src/backend/anastasis-httpd_policy_upload.c 
b/src/backend/anastasis-httpd_policy_upload.c
index 93cfc02..dfde43a 100644
--- a/src/backend/anastasis-httpd_policy_upload.c
+++ b/src/backend/anastasis-httpd_policy_upload.c
@@ -245,17 +245,12 @@ amount_to_post_counter (const struct TALER_Amount *amount)
  * /contract request to a merchant.
  *
  * @param cls our `struct PolicyUploadContext`
- * @param http_status HTTP response code, 200 indicates success;
- *                    0 if the backend's reply is bogus (fails to follow the 
protocol)
- * @param ec taler-specific error code
- * @param obj raw JSON reply, or error details if the request failed
+ * @param hr HTTP response details
  * @param order_id payment_identifier (base32 encoded) of the newly created 
order
  */
 static void
 proposal_cb (void *cls,
-             unsigned int http_status,
-             enum TALER_ErrorCode ec,
-             const json_t *obj,
+             const struct TALER_MERCHANT_HttpResponse *hr,
              const char *order_id)
 {
   struct PolicyUploadContext *puc = cls;
@@ -271,22 +266,25 @@ proposal_cb (void *cls,
                                puc);
   MHD_resume_connection (puc->con);
   AH_trigger_daemon ();
-  if (MHD_HTTP_OK != http_status)
+  if (MHD_HTTP_OK != hr->http_status)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Backend returned status %u/%u\n",
-                http_status,
-                (unsigned int) ec);
+                "Backend returned status %u/%d\n",
+                hr->http_status,
+                (int) hr->ec);
     GNUNET_break (0);
-    puc->resp = TALER_MHD_make_json_pack ("{s:I, s:s, s:I, s:I}",
-                                          "code",
-                                          (json_int_t)
-                                          
TALER_EC_SYNC_PAYMENT_CREATE_BACKEND_ERROR,
-                                          "hint",
-                                          "Failed to setup order with merchant 
backend",
-                                          "backend-ec", (json_int_t) ec,
-                                          "backend-http-status",
-                                          (json_int_t) http_status);
+    puc->resp = TALER_MHD_make_json_pack (
+      "{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,
+      "backend-http-status",
+      (json_int_t) hr->http_status,
+      "backend-reply",
+      hr->reply);
     GNUNET_assert (NULL != puc->resp);
     puc->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
     return;
@@ -352,8 +350,7 @@ ongoing_payment_cb (void *cls,
  * Callback to process a GET /check-payment request
  *
  * @param cls our `struct PolicyUploadContext`
- * @param http_status HTTP status code for this request
- * @param obj raw response body
+ * @param hr HTTP response
  * @param paid #GNUNET_YES if the payment is settled, #GNUNET_NO if not
  *        settled, $GNUNET_SYSERR on error
  *        (note that refunded payments are returned as paid!)
@@ -366,8 +363,7 @@ ongoing_payment_cb (void *cls,
  */
 static void
 check_payment_cb (void *cls,
-                  unsigned int http_status,
-                  const json_t *obj,
+                  const struct TALER_MERCHANT_HttpResponse *hr,
                   int paid,
                   int refunded,
                   struct TALER_Amount *refund_amount,

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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