gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated: add non-X variants


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: add non-X variants to payment trigger to provide future-compatibility
Date: Sat, 06 Apr 2019 16:08:25 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 64be1fe  add non-X variants to payment trigger to provide 
future-compatibility
64be1fe is described below

commit 64be1fe4863900091a085e20630a8049d1ee37c0
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Apr 6 16:08:23 2019 +0200

    add non-X variants to payment trigger to provide future-compatibility
---
 src/backend/taler-merchant-httpd_trigger-pay.c | 74 +++++++++++++++++++++-----
 1 file changed, 60 insertions(+), 14 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_trigger-pay.c 
b/src/backend/taler-merchant-httpd_trigger-pay.c
index 2187acb..47c6815 100644
--- a/src/backend/taler-merchant-httpd_trigger-pay.c
+++ b/src/backend/taler-merchant-httpd_trigger-pay.c
@@ -42,8 +42,10 @@
  * @param header_name name of the header to set
  */
 static void
-add_header_from_arg (struct MHD_Connection *connection, const char *arg_name,
-                     struct MHD_Response *response, const char *header_name)
+add_header_from_arg (struct MHD_Connection *connection,
+                     const char *arg_name,
+                     struct MHD_Response *response,
+                     const char *header_name)
 {
   const char *arg = MHD_lookup_connection_value (connection,
                                                  MHD_GET_ARGUMENT_KIND,
@@ -75,22 +77,66 @@ MH_handler_trigger_pay (struct TMH_RequestHandler *rh,
                         size_t *upload_data_size)
 {
   struct MHD_Response *response;
-
-
   // FIXME: Taler wallet detection!
   char *data = "<html><body><p>Processing payment ...</p></body></html>";
 
-  response = MHD_create_response_from_buffer (strlen (data), data, 
MHD_RESPMEM_PERSISTENT);
+  response = MHD_create_response_from_buffer (strlen (data),
+                                              data,
+                                              MHD_RESPMEM_PERSISTENT);
+  add_header_from_arg (connection,
+                       "session_id",
+                       response,
+                       "Taler-Session-Id");
+  add_header_from_arg (connection,
+                       "contract_url",
+                       response,
+                       "Taler-Contract-Url");
+  add_header_from_arg (connection,
+                       "h_contract_terms",
+                       response,
+                       "Taler-Contract-Hash");
+  add_header_from_arg (connection,
+                       "tip_token",
+                       response,
+                       "Taler-Tip");
+  add_header_from_arg (connection,
+                       "refund_url",
+                       response,
+                       "Taler-Refund-Url");
+  add_header_from_arg (connection,
+                       "resource_url",
+                       response,
+                       "Taler-Resource-Url");
+  /* FIXME: the X- variants should go away in the future, for now
+     preserved for backwards-compatibility only! */
+  add_header_from_arg (connection,
+                       "session_id",
+                       response,
+                       "X-Taler-Session-Id");
+  add_header_from_arg (connection,
+                       "contract_url",
+                       response,
+                       "X-Taler-Contract-Url");
+  add_header_from_arg (connection,
+                       "h_contract_terms",
+                       response,
+                       "X-Taler-Contract-Hash");
+  add_header_from_arg (connection,
+                       "tip_token",
+                       response,
+                       "X-Taler-Tip");
+  add_header_from_arg (connection,
+                       "refund_url",
+                       response,
+                       "X-Taler-Refund-Url");
+  add_header_from_arg (connection,
+                       "resource_url",
+                       response,
+                       "X-Taler-Resource-Url");
 
-  add_header_from_arg (connection, "session_id", response, 
"X-Taler-Session-Id");
-  add_header_from_arg (connection, "contract_url", response, 
"X-Taler-Contract-Url");
-  add_header_from_arg (connection, "h_contract_terms", response, 
"X-Taler-Contract-Hash");
-  add_header_from_arg (connection, "tip_token", response, "X-Taler-Tip");
-  add_header_from_arg (connection, "refund_url", response, 
"X-Taler-Refund-Url");
-  add_header_from_arg (connection, "resource_url", response, 
"X-Taler-Resource-Url");
-
-  MHD_queue_response (connection, 402, response);
+  MHD_queue_response (connection,
+                      MHD_HTTP_PAYMENT_REQUIRED,
+                      response);
   MHD_destroy_response (response);
-
   return MHD_YES;
 }

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]