gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated (6afa631 -> 4e099d5)


From: gnunet
Subject: [taler-merchant] branch master updated (6afa631 -> 4e099d5)
Date: Tue, 29 Sep 2020 14:51:51 +0200

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

dold pushed a change to branch master
in repository merchant.

    from 6afa631  only complain when neither order nor contract is found
     new b8a8138  Revert "only complain when neither order nor contract is 
found"
     new 4e099d5  Revert "look up claim token and include it in claimed but 
unpaid order URLs to avoid redirect loop"

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:
 .../taler-merchant-httpd_private-get-orders-ID.c   | 65 ++++++----------------
 1 file changed, 16 insertions(+), 49 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c 
b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
index 74f38b3..1f47a47 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -834,6 +834,15 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler 
*rh,
                                       &gorc->order_serial);
   if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
   {
+    struct GNUNET_HashCode unused;
+
+    /* We don't have contract terms, but the order may still exist. */
+    qs = TMH_db->lookup_order (TMH_db->cls,
+                               hc->instance->settings.id,
+                               hc->infix,
+                               &claim_token,
+                               &unused,
+                               &gorc->contract_terms);
     order_only = true;
   }
   if (0 > qs)
@@ -848,47 +857,12 @@ TMH_private_get_orders_ID (const struct 
TMH_RequestHandler *rh,
                                        
TALER_EC_GET_ORDERS_DB_FETCH_CONTRACT_TERMS_ERROR,
                                        NULL);
   }
-
+  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
   {
-    struct GNUNET_HashCode unused;
-    json_t *ct = NULL;
-
-    /* We need the order for two cases:  Either when the contract doesn't 
exist yet,
-     * or when the order is claimed but unpaid, and we need the claim token. */
-    qs = TMH_db->lookup_order (TMH_db->cls,
-                               hc->instance->settings.id,
-                               hc->infix,
-                               &claim_token,
-                               &unused,
-                               &ct);
-
-    if (0 > qs)
-    {
-      /* single, read-only SQL statements should never cause
-         serialization problems */
-      GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR != qs);
-      /* Always report on hard error as well to enable diagnostics */
-      GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs);
-      return TALER_MHD_reply_with_error (connection,
-                                         MHD_HTTP_INTERNAL_SERVER_ERROR,
-                                         
TALER_EC_GET_ORDERS_DB_FETCH_CONTRACT_TERMS_ERROR,
-                                         NULL);
-    }
-    if (order_only && (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) )
-    {
-      return TALER_MHD_reply_with_error (connection,
-                                         MHD_HTTP_NOT_FOUND,
-                                         TALER_EC_GET_ORDERS_ORDER_NOT_FOUND,
-                                         hc->infix);
-    }
-    if (order_only)
-    {
-      gorc->contract_terms = ct;
-    }
-    else if (NULL != ct)
-    {
-      json_decref (ct);
-    }
+    return TALER_MHD_reply_with_error (connection,
+                                       MHD_HTTP_NOT_FOUND,
+                                       TALER_EC_GET_ORDERS_ORDER_NOT_FOUND,
+                                       hc->infix);
   }
   /* extract the fulfillment URL and total amount from the contract terms! */
   {
@@ -1095,24 +1069,17 @@ TMH_private_get_orders_ID (const struct 
TMH_RequestHandler *rh,
     char *taler_pay_uri;
     char *order_status_url;
     MHD_RESULT ret;
-    struct TALER_ClaimTokenP *ct = NULL;
-
-    /* Already claimed, so we include the claim token so that
-     * the order status page will show the QR code and won't run
-     * into a redirect loop. */
-    if (! order_only)
-      ct = &claim_token;
 
     taler_pay_uri = TMH_make_taler_pay_uri (connection,
                                             hc->infix,
                                             gorc->session_id,
                                             hc->instance->settings.id,
-                                            ct);
+                                            &claim_token);
     order_status_url = TMH_make_order_status_url (connection,
                                                   hc->infix,
                                                   gorc->session_id,
                                                   hc->instance->settings.id,
-                                                  ct,
+                                                  &claim_token,
                                                   NULL);
     ret = TALER_MHD_reply_json_pack (connection,
                                      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]