gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] 01/02: add /refund route


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 01/02: add /refund route
Date: Wed, 14 Jun 2017 15:29:07 +0200

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

marcello pushed a commit to branch master
in repository merchant.

commit e486247621e71d4f7586b9439fc98f6dbc8b6fd2
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Jun 14 10:21:28 2017 +0200

    add /refund route
---
 src/backend/taler-merchant-httpd.c     | 18 +++++++++++++-----
 src/backend/taler-merchant-httpd_mhd.c |  8 ++++----
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/backend/taler-merchant-httpd.c 
b/src/backend/taler-merchant-httpd.c
index 8930c10..44831cc 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -175,9 +175,6 @@ url_handler (void *cls,
       { "/", MHD_HTTP_METHOD_GET, "text/plain",
         "Hello, I'm a merchant's Taler backend. This HTTP server is not for 
humans.\n", 0,
         &TMH_MHD_handler_static_response, MHD_HTTP_OK },
-      { "/proposal", MHD_HTTP_METHOD_POST, "application/json",
-        NULL, 0,
-        &MH_handler_proposal_put, MHD_HTTP_OK },
       { "/pay", MHD_HTTP_METHOD_POST, "application/json",
         NULL, 0,
         &MH_handler_pay, MHD_HTTP_OK },
@@ -199,13 +196,24 @@ url_handler (void *cls,
       { "/history", MHD_HTTP_METHOD_GET, "text/plain",
         "Only GET is allowed", 0,
         &MH_handler_history, MHD_HTTP_OK},
+      { "/proposal", MHD_HTTP_METHOD_POST, "application/json",
+        NULL, 0,
+        &MH_handler_proposal_put, MHD_HTTP_OK },
       { "/proposal", MHD_HTTP_METHOD_GET, "text/plain",
-        "Only GET is allowed", 0,
+        NULL, 0,
         &MH_handler_proposal_lookup, MHD_HTTP_OK},
       { "/proposal", NULL, "text/plain",
         "Only GET/POST are allowed", 0,
         &TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
-
+      { "/refund", MHD_HTTP_METHOD_POST, "application/json",
+        NULL, 0,
+        &MH_handler_refund_increase, MHD_HTTP_OK},
+      { "/refund", MHD_HTTP_METHOD_GET, "text/plain",
+        NULL, 0,
+        &MH_handler_refund_lookup, MHD_HTTP_OK},
+      { "/refund", NULL, "application/json",
+        "Only POST/GET are allowed", 0,
+        &TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED},
       {NULL, NULL, NULL, NULL, 0, 0 }
     };
   static struct TMH_RequestHandler h404 =
diff --git a/src/backend/taler-merchant-httpd_mhd.c 
b/src/backend/taler-merchant-httpd_mhd.c
index 9debb67..e4e5329 100644
--- a/src/backend/taler-merchant-httpd_mhd.c
+++ b/src/backend/taler-merchant-httpd_mhd.c
@@ -146,10 +146,10 @@ TMH_MHD_handler_send_json_pack_error (struct 
TMH_RequestHandler *rh,
                                          size_t *upload_data_size)
 {
   return TMH_RESPONSE_reply_json_pack (connection,
-                                     rh->response_code,
-                                     "{s:s}",
-                                     "error",
-                                     rh->data);
+                                       rh->response_code,
+                                       "{s:s}",
+                                       "error",
+                                       rh->data);
 }
 
 

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



reply via email to

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