gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] 02/05: small change


From: gnunet
Subject: [taler-merchant] 02/05: small change
Date: Fri, 15 Nov 2024 13:51:42 +0100

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

grothoff pushed a commit to branch master
in repository merchant.

commit c3bb01e7360d218d3fbf60ef83be094a834be57c
Author: Bohdan Potuzhnyi <potub1@bfh.ch>
AuthorDate: Mon Nov 4 20:52:37 2024 +0000

    small change
---
 .../taler-merchant-httpd_private-post-orders.c     | 69 +++++++++++-----------
 1 file changed, 34 insertions(+), 35 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c 
b/src/backend/taler-merchant-httpd_private-post-orders.c
index 3d8b89df..498c51f7 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -885,6 +885,40 @@ execute_transaction (struct OrderContext *oc)
     return qs;
   }
 
+  {
+    enum GNUNET_DB_QueryStatus qs;
+    json_t *jhook;
+
+    jhook = GNUNET_JSON_PACK(
+      GNUNET_JSON_pack_string("order_id",
+                              oc->parse_order.order_id),
+      GNUNET_JSON_pack_object_incref("contract",
+                                     oc->serialize_order.contract),
+      GNUNET_JSON_pack_string("instance_id",
+                              oc->hc->instance->settings.id)
+    );
+    GNUNET_assert(NULL != jhook);
+
+    qs = TMH_trigger_webhook(oc->hc->instance->settings.id,
+                                     "order_created",
+                                     jhook);
+
+    json_decref(jhook);
+
+    if (0 >= qs)
+    {
+      TMH_db->rollback (TMH_db->cls);
+      if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
+        return qs;
+      GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs);
+      reply_with_error (oc,
+                        MHD_HTTP_INTERNAL_SERVER_ERROR,
+                        TALER_EC_GENERIC_DB_STORE_FAILED,
+                        "failed to trigger webhooks");
+      return qs;
+    }
+  }
+
   TMH_notify_order_change (oc->hc->instance,
                            TMH_OSF_NONE,
                            timestamp,
@@ -1079,41 +1113,6 @@ execute_order (struct OrderContext *oc)
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Order creation succeeded\n");
 
-  {
-    enum GNUNET_DB_QueryStatus qs;
-    json_t *jhook;
-
-    jhook = GNUNET_JSON_PACK(
-      GNUNET_JSON_pack_string("order_id",
-                              oc->parse_order.order_id),
-      GNUNET_JSON_pack_object_incref("contract",
-                                     oc->serialize_order.contract),
-      GNUNET_JSON_pack_string("instance_id",
-                              oc->hc->instance->settings.id)
-    );
-    GNUNET_assert(NULL != jhook);
-
-//    webhook_qs = TMH_trigger_webhook(oc->hc->instance->settings.id,
-//                                     "order_created",
-//                                     jhook);
-
-//    json_decref(jhook);
-//
-//    if (0 >= webhook_qs)
-//    {
-//      TMH_db->rollback (TMH_db->cls);
-//      if (GNUNET_DB_STATUS_SOFT_ERROR == webhook_qs)
-//        return webhook_qs; /* do it again */
-//      /* Always report on hard error as well to enable diagnostics */
-//      GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == webhook_qs);
-//      reply_with_error (oc,
-//                        MHD_HTTP_INTERNAL_SERVER_ERROR,
-//                        TALER_EC_GENERIC_DB_STORE_FAILED,
-//                        "failed to trigger webhooks");
-//      return webhook_qs;
-//    }
-  }
-
   {
     MHD_RESULT ret;
 

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