gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: pass current session ID to order


From: gnunet
Subject: [taler-merchant] branch master updated: pass current session ID to order status URL
Date: Wed, 12 Aug 2020 20:11:47 +0200

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

dold pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 7031acf  pass current session ID to order status URL
7031acf is described below

commit 7031acff3354875128eb240a5a2201cb1428364c
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Wed Aug 12 23:41:41 2020 +0530

    pass current session ID to order status URL
---
 src/backend/taler-merchant-httpd_get-orders-ID.c       | 18 ++++++++++++++++++
 src/backend/taler-merchant-httpd_get-orders-ID.h       |  2 ++
 .../taler-merchant-httpd_private-get-orders-ID.c       |  3 +++
 3 files changed, 23 insertions(+)

diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c 
b/src/backend/taler-merchant-httpd_get-orders-ID.c
index ffc9ac0..8532c98 100644
--- a/src/backend/taler-merchant-httpd_get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_get-orders-ID.c
@@ -376,6 +376,7 @@ make_taler_refund_uri (struct MHD_Connection *con,
  *
  * @param con HTTP connection
  * @param order_id the order id
+ * @param session_id the session id
  * @param instance_id instance, may be "default"
  * @param claim_token claim token for the order, may be NULL
  * @return corresponding http(s):// URL, or NULL on missing "host"
@@ -383,6 +384,7 @@ make_taler_refund_uri (struct MHD_Connection *con,
 char *
 TMH_make_order_status_url (struct MHD_Connection *con,
                            const char *order_id,
+                           const char *session_id,
                            const char *instance_id,
                            struct TALER_ClaimTokenP *claim_token)
 {
@@ -390,6 +392,7 @@ TMH_make_order_status_url (struct MHD_Connection *con,
   const char *forwarded_host;
   const char *uri_path;
   struct GNUNET_Buffer buf = { 0 };
+  bool have_claim_token = false;
 
   host = MHD_lookup_connection_value (con,
                                       MHD_HEADER_KIND,
@@ -445,6 +448,20 @@ TMH_make_order_status_url (struct MHD_Connection *con,
     GNUNET_buffer_write_data_encoded (&buf,
                                       (char *) claim_token,
                                       sizeof (struct TALER_ClaimTokenP));
+    have_claim_token = true;
+  }
+
+  if (NULL != session_id)
+  {
+    if (have_claim_token)
+      GNUNET_buffer_write_str (&buf,
+                               "?session_id=");
+    else
+      GNUNET_buffer_write_str (&buf,
+                               "&session_id=");
+    GNUNET_buffer_write_str (&buf,
+                             session_id);
+
   }
 
   return GNUNET_buffer_reap_str (&buf);
@@ -572,6 +589,7 @@ send_pay_request (struct GetOrderData *god,
                                           &god->claim_token);
   order_status_url = TMH_make_order_status_url (god->sc.con,
                                                 god->order_id,
+                                                god->session_id,
                                                 god->hc->instance->settings.id,
                                                 &god->claim_token);
   if (god->generate_html)
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.h 
b/src/backend/taler-merchant-httpd_get-orders-ID.h
index d5d33fa..83a991b 100644
--- a/src/backend/taler-merchant-httpd_get-orders-ID.h
+++ b/src/backend/taler-merchant-httpd_get-orders-ID.h
@@ -48,6 +48,7 @@ TMH_make_taler_pay_uri (struct MHD_Connection *con,
  *
  * @param con HTTP connection
  * @param order_id the order id
+ * @param session_id session, may be NULL
  * @param instance_id instance, may be "default"
  * @param claim_token claim token for the order, may be NULL
  * @return corresponding http(s):// URL, or NULL on missing "host"
@@ -55,6 +56,7 @@ TMH_make_taler_pay_uri (struct MHD_Connection *con,
 char *
 TMH_make_order_status_url (struct MHD_Connection *con,
                            const char *order_id,
+                           const char *session_id,
                            const char *instance_id,
                            struct TALER_ClaimTokenP *claim_token);
 
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 230a240..bc2a2d0 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -976,6 +976,7 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler 
*rh,
                                               &claim_token);
       order_status_url = TMH_make_order_status_url (connection,
                                                     hc->infix,
+                                                    gorc->session_id,
                                                     hc->instance->settings.id,
                                                     &claim_token);
       ret = TALER_MHD_reply_json_pack (connection,
@@ -1051,6 +1052,7 @@ TMH_private_get_orders_ID (const struct 
TMH_RequestHandler *rh,
                                             &claim_token);
     order_status_url = TMH_make_order_status_url (connection,
                                                   hc->infix,
+                                                  gorc->session_id,
                                                   hc->instance->settings.id,
                                                   &claim_token);
     ret = TALER_MHD_reply_json_pack (connection,
@@ -1185,6 +1187,7 @@ TMH_private_get_orders_ID (const struct 
TMH_RequestHandler *rh,
 
     order_status_url = TMH_make_order_status_url (connection,
                                                   hc->infix,
+                                                  gorc->session_id,
                                                   hc->instance->settings.id,
                                                   &claim_token);
 

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