[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: add /trigger-pay sk
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: add /trigger-pay skeleton |
Date: |
Thu, 04 Jan 2018 18:01:50 +0100 |
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 0db5194 add /trigger-pay skeleton
0db5194 is described below
commit 0db5194eefeb3aa2d89e7073cf31793af1bca504
Author: Florian Dold <address@hidden>
AuthorDate: Thu Jan 4 18:01:47 2018 +0100
add /trigger-pay skeleton
---
src/backend/Makefile.am | 3 +-
src/backend/taler-merchant-httpd_check-payment.c | 2 +-
src/backend/taler-merchant-httpd_trigger-pay.c | 55 ++++++++++++++++++++++++
src/backend/taler-merchant-httpd_trigger-pay.h | 45 +++++++++++++++++++
4 files changed, 103 insertions(+), 2 deletions(-)
diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am
index 0f305eb..648f2af 100644
--- a/src/backend/Makefile.am
+++ b/src/backend/Makefile.am
@@ -29,7 +29,8 @@ taler_merchant_httpd_SOURCES = \
taler-merchant-httpd_track-transaction.c
taler-merchant-httpd_track-transaction.h \
taler-merchant-httpd_track-transfer.c taler-merchant-httpd_track-transfer.h \
taler-merchant-httpd_refund.c taler-merchant-httpd_refund.h \
- taler-merchant-httpd_check-payment.c taler-merchant-httpd_check-payment.h
+ taler-merchant-httpd_check-payment.c taler-merchant-httpd_check-payment.h \
+ taler-merchant-httpd_trigger-pay.c taler-merchant-httpd_trigger-pay.h
taler_merchant_httpd_LDADD = \
diff --git a/src/backend/taler-merchant-httpd_check-payment.c
b/src/backend/taler-merchant-httpd_check-payment.c
index af5eee1..129f7bc 100644
--- a/src/backend/taler-merchant-httpd_check-payment.c
+++ b/src/backend/taler-merchant-httpd_check-payment.c
@@ -297,7 +297,7 @@ MH_handler_check_payment (struct TMH_RequestHandler *rh,
do_pay:
{
- char *url = make_absolute_backend_url (connection, "show-contract",
"contract_url", contract_url, "session_id", session_id, NULL);
+ char *url = make_absolute_backend_url (connection, "trigger-pay",
"contract_url", contract_url, "session_id", session_id, NULL);
int ret = TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:s}",
diff --git a/src/backend/taler-merchant-httpd_trigger-pay.c
b/src/backend/taler-merchant-httpd_trigger-pay.c
new file mode 100644
index 0000000..971fc50
--- /dev/null
+++ b/src/backend/taler-merchant-httpd_trigger-pay.c
@@ -0,0 +1,55 @@
+/*
+ This file is part of TALER
+ (C) 2017 Taler Systems SA
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+*/
+/**
+ * @file backend/taler-merchant-httpd_check-payment.c
+ * @brief implementation of /check-payment handler
+ * @author Florian Dold
+ */
+#include "platform.h"
+#include <string.h>
+#include <microhttpd.h>
+#include <jansson.h>
+#include <taler/taler_json_lib.h>
+#include <taler/taler_signatures.h>
+#include "taler-merchant-httpd.h"
+#include "taler-merchant-httpd_mhd.h"
+#include "taler-merchant-httpd_parsing.h"
+#include "taler-merchant-httpd_exchanges.h"
+#include "taler-merchant-httpd_responses.h"
+#include "taler-merchant-httpd_trigger-pay.h"
+
+
+/**
+ * Serves a request to browsers to trigger a payment.
+ * Contains all the logic to handle different platforms, so that the frontend
+ * does not have to handle that.
+ *
+ * @param rh context of the handler
+ * @param connection the MHD connection to handle
+ * @param[in,out] connection_cls the connection's closure (can be updated)
+ * @param upload_data upload data
+ * @param[in,out] upload_data_size number of bytes (left) in @a upload_data
+ * @return MHD result code
+ */
+int
+MH_handler_trigger_pay (struct TMH_RequestHandler *rh,
+ struct MHD_Connection *connection,
+ void **connection_cls,
+ const char *upload_data,
+ size_t *upload_data_size)
+{
+ return 0;
+}
diff --git a/src/backend/taler-merchant-httpd_trigger-pay.h
b/src/backend/taler-merchant-httpd_trigger-pay.h
new file mode 100644
index 0000000..b395772
--- /dev/null
+++ b/src/backend/taler-merchant-httpd_trigger-pay.h
@@ -0,0 +1,45 @@
+/*
+ This file is part of TALER
+ (C) 2018 Taler Systems SA
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+*/
+/**
+ * @file backend/taler-merchant-httpd_trigger-pay.h
+ * @brief headers for /trigger-pay handler
+ * @author Florian Dold
+ */
+#ifndef TALER_MERCHANT_HTTPD_TRIGGER_PAY_H
+#define TALER_MERCHANT_HTTPD_TRIGGER_PAY_H
+#include <microhttpd.h>
+#include "taler-merchant-httpd.h"
+
+/**
+ * Serves a request to browsers to trigger a payment.
+ * Contains all the logic to handle different platforms, so that the frontend
+ * does not have to handle that.
+ *
+ * @param rh context of the handler
+ * @param connection the MHD connection to handle
+ * @param[in,out] connection_cls the connection's closure (can be updated)
+ * @param upload_data upload data
+ * @param[in,out] upload_data_size number of bytes (left) in @a upload_data
+ * @return MHD result code
+ */
+int
+MH_handler_trigger_pay (struct TMH_RequestHandler *rh,
+ struct MHD_Connection *connection,
+ void **connection_cls,
+ const char *upload_data,
+ size_t *upload_data_size);
+
+#endif
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: add /trigger-pay skeleton,
gnunet <=