gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] 04/05: paid webhook


From: gnunet
Subject: [taler-merchant] 04/05: paid webhook
Date: Fri, 15 Nov 2024 13:51:44 +0100

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

grothoff pushed a commit to branch master
in repository merchant.

commit fdbabd1a9bfdd84d35717569509ebfc28e9942ba
Author: bohdan-potuzhnyi <bohdan.potuzhnyi@gmail.com>
AuthorDate: Wed Nov 6 11:37:49 2024 +0100

    paid webhook
---
 .../taler-merchant-httpd_post-orders-ID-paid.c     | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-paid.c 
b/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
index 4eb7280f..39b2ae8f 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
@@ -27,6 +27,7 @@
 #include <taler/taler_signatures.h>
 #include <taler/taler_json_lib.h>
 #include <taler/taler_exchange_service.h>
+#include "taler-merchant-httpd_helper.h"
 #include "taler-merchant-httpd_post-orders-ID-paid.h"
 
 
@@ -219,6 +220,33 @@ TMH_post_orders_ID_paid (const struct TMH_RequestHandler 
*rh,
     trigger_session_notification (hc,
                                   session_id,
                                   fulfillment_url);
+
+  /*Trigger webhook */
+  {
+    enum GNUNET_DB_QueryStatus qs;
+    json_t *jhook;
+
+    jhook = GNUNET_JSON_PACK (
+      GNUNET_JSON_pack_object_incref ("contract_terms",
+                                      contract_terms),
+      GNUNET_JSON_pack_string ("order_id",
+                               order_id)
+    );
+    GNUNET_assert (NULL != jhook);
+    qs = TMH_trigger_webhook (hc->instance->settings.id,
+                              "paid",
+                              jhook);
+    json_decref (jhook);
+    if (qs < 0)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  "Failed to init the webhook for contract %s with %s/%s as 
paid\n",
+                  order_id,
+                  session_id,
+                  fulfillment_url);
+    }
+  }
+
   /* fulfillment_url is part of the contract_terms */
   {
     bool refunded = false;

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