gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] 02/06: fix #6752


From: gnunet
Subject: [taler-anastasis] 02/06: fix #6752
Date: Sat, 13 Mar 2021 19:23:24 +0100

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

grothoff pushed a commit to branch master
in repository anastasis.

commit 893d5b8a2ed9c63566e0d116e29b38c2c5acb24b
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Mar 13 15:17:04 2021 +0100

    fix #6752
---
 src/backend/anastasis-httpd_policy_upload.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/backend/anastasis-httpd_policy_upload.c 
b/src/backend/anastasis-httpd_policy_upload.c
index 126a3a7..f0107b9 100644
--- a/src/backend/anastasis-httpd_policy_upload.c
+++ b/src/backend/anastasis-httpd_policy_upload.c
@@ -415,16 +415,32 @@ check_payment_cb (void *cls,
 
   /* refunds are not supported, verify */
   puc->cpo = NULL;
-  // FIXME: osr could be NULL! check hr first!
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Payment status checked: %s\n",
-              osr->status ? "paid" : "unpaid");
   GNUNET_CONTAINER_DLL_remove (puc_head,
                                puc_tail,
                                puc);
   MHD_resume_connection (puc->con);
   AH_trigger_daemon (NULL);
-
+  switch (hr->http_status)
+  {
+  case MHD_HTTP_OK:
+    GNUNET_assert (NULL != osr);
+    break; /* processed below */
+  case MHD_HTTP_UNAUTHORIZED:
+    puc->resp = TALER_MHD_make_error (
+      TALER_EC_ANASTASIS_GENERIC_PAYMENT_CHECK_UNAUTHORIZED,
+      NULL);
+    puc->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
+    return;
+  default:
+    puc->resp = TALER_MHD_make_error (
+      TALER_EC_ANASTASIS_GENERIC_BACKEND_ERROR,
+      "failed to initiate payment");
+    puc->response_code = MHD_HTTP_BAD_GATEWAY;
+    return;
+  }
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "Payment status checked: %s\n",
+              osr->status ? "paid" : "unpaid");
   switch (osr->status)
   {
   case TALER_MERCHANT_OSC_PAID:
@@ -434,7 +450,7 @@ check_payment_cb (void *cls,
       qs = db->increment_lifetime (db->cls,
                                    &puc->account,
                                    &puc->payment_identifier,
-                                   GNUNET_TIME_UNIT_YEARS); /* FIXME: always 
annual ?*/
+                                   GNUNET_TIME_UNIT_YEARS);
       if (0 <= qs)
         return; /* continue as planned */
       GNUNET_break (0);

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