From df653e582dc9995f6ee5a0a237533f7255fb8806 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 26 Jun 2019 21:39:03 +0200 Subject: check payment logic: allow session_id without session_sig_str --- src/backend/taler-merchant-httpd_check-payment.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/backend/taler-merchant-httpd_check-payment.c b/src/backend/taler-merchant-httpd_check-payment.c index 3c5909d9..6542c717 100644 --- a/src/backend/taler-merchant-httpd_check-payment.c +++ b/src/backend/taler-merchant-httpd_check-payment.c @@ -257,21 +257,11 @@ MH_handler_check_payment (struct TMH_RequestHandler *rh, session_sig_str = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "session_sig"); - if (NULL != session_id) + if ((NULL != session_id) && (NULL != session_sig_str)) { struct GNUNET_CRYPTO_EddsaSignature sig; struct TALER_MerchantPaySessionSigPS mps; - /* If the session id is given, the frontend wants us - to verify the session signature. */ - if (NULL == session_sig_str) - { - /* pay session signature required but missing */ - GNUNET_break_op (0); - GNUNET_free (final_contract_url); - return TMH_RESPONSE_reply_bad_request (connection, - TALER_EC_PARAMETER_MISSING, - "session_sig required if session_id given"); - } + if (GNUNET_OK != GNUNET_STRINGS_string_to_data (session_sig_str, strlen (session_sig_str), -- cgit v1.2.3 From d96acf11339effcba7568985de317c362195cb07 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 26 Jun 2019 22:09:53 +0200 Subject: disable useless GCC warning about pointer alignment --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 01ff7adc..e0e3ef32 100644 --- a/configure.ac +++ b/configure.ac @@ -41,7 +41,7 @@ AS_IF([test "x$doc_only" != xyes],[ AC_PROG_CC AC_PROG_CC_C99 -CFLAGS="-Wall $CFLAGS" +CFLAGS="-Wall $CFLAGS -Wno-address-of-packed-member" # Checks for header files. AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h]) -- cgit v1.2.3 From 2b8042c61a5089bc5bc9ee5789b42e143d4efd9b Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 26 Jun 2019 22:11:26 +0200 Subject: fix order of CFLAGS --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e0e3ef32..a5bb3be4 100644 --- a/configure.ac +++ b/configure.ac @@ -41,7 +41,7 @@ AS_IF([test "x$doc_only" != xyes],[ AC_PROG_CC AC_PROG_CC_C99 -CFLAGS="-Wall $CFLAGS -Wno-address-of-packed-member" +CFLAGS="-Wall -Wno-address-of-packed-member $CFLAGS" # Checks for header files. AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h]) -- cgit v1.2.3 From abd06943d8fe2825f40fb7f6defc6c7f0ab5694c Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Thu, 27 Jun 2019 10:09:03 +0200 Subject: adapt to new wire-details signature object --- src/lib/test_merchant_api_home/.config/taler/exchange/account-2.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/test_merchant_api_home/.config/taler/exchange/account-2.json b/src/lib/test_merchant_api_home/.config/taler/exchange/account-2.json index e8a000bf..0666f544 100644 --- a/src/lib/test_merchant_api_home/.config/taler/exchange/account-2.json +++ b/src/lib/test_merchant_api_home/.config/taler/exchange/account-2.json @@ -1,4 +1,5 @@ { "url": "payto://x-taler-bank/localhost:8082/2", - "master_sig": "RDPWNT0CDATHWRY99W7G3E2Y1GYAABTE25J8GHKPGXV07TM89W1502BG5Q82FQY0JR4HSABJC6RG92PA93QGTKWM85W64TE9CCVW63R" -} \ No newline at end of file + "master_sig": "RDPWNT0CDATHWRY99W7G3E2Y1GYAABTE25J8GHKPGXV07TM89W1502BG5Q82FQY0JR4HSABJC6RG92PA93QGTKWM85W64TE9CCVW63R", + "master_pub": "T1VVFQZZARQ1CMF4BN58EE7SKTW5AV2BS18S87ZEGYS4S29J6DNG" +} -- cgit v1.2.3 From b201c2d63f92aaa0d068d442e3de3d1e1870acee Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Thu, 27 Jun 2019 15:06:20 +0200 Subject: moving Doxyfile --- Doxyfile | 247 ------------------------------------------------------- contrib/Doxyfile | 247 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 247 insertions(+), 247 deletions(-) delete mode 100644 Doxyfile create mode 100644 contrib/Doxyfile diff --git a/Doxyfile b/Doxyfile deleted file mode 100644 index 3c068dbe..00000000 --- a/Doxyfile +++ /dev/null @@ -1,247 +0,0 @@ -# Doxyfile 1.5.5 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = "GNU Taler: Merchant" -PROJECT_NUMBER = 0.3 -OUTPUT_DIRECTORY = doxygen-doc/ -CREATE_SUBDIRS = YES -OUTPUT_LANGUAGE = English -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = . -STRIP_FROM_INC_PATH = src/include -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -QT_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -INHERIT_DOCS = NO -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO -OPTIMIZE_FOR_FORTRAN = NO -OPTIMIZE_OUTPUT_VHDL = NO -BUILTIN_STL_SUPPORT = NO -CPP_CLI_SUPPORT = NO -SIP_SUPPORT = NO -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -TYPEDEF_HIDES_STRUCT = NO -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = NO -EXTRACT_LOCAL_METHODS = YES -EXTRACT_ANON_NSPACES = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_GROUP_NAMES = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = NO -GENERATE_TESTLIST = NO -GENERATE_BUGLIST = NO -GENERATE_DEPRECATEDLIST= NO -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = YES -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = YES -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = src/ -INPUT_ENCODING = UTF-8 -FILE_PATTERNS = *.c \ - *.h -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = */test_* */.git/* */perf_* */tls_test_* taler_config.h -EXCLUDE_SYMBOLS = GNUNET_* JSON_* -EXAMPLE_PATH = -EXAMPLE_PATTERNS = * -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = YES -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -REFERENCES_LINK_SOURCE = YES -USE_HTAGS = NO -VERBATIM_HEADERS = NO -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = TALER_ -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -#GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -GENERATE_HTMLHELP = NO -GENERATE_DOCSET = NO -DOCSET_FEEDNAME = "Doxygen generated docs" -DOCSET_BUNDLE_ID = org.doxygen.Project -HTML_DYNAMIC_SECTIONS = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -#GENERATE_LATEX = YES -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = YES -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = YES -USE_PDFLATEX = YES -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -#GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = YES -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -#GENERATE_XML = NO -XML_OUTPUT = xml -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = contrib/gnunet.tag \ - contrib/microhttpd.tag \ - contrib/taler-exchange.tag -GENERATE_TAGFILE = contrib/taler-merchant.tag -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = NO -MSCGEN_PATH = -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = YES -CLASS_GRAPH = NO -COLLABORATION_GRAPH = NO -GROUP_GRAPHS = NO -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = YES -CALLER_GRAPH = YES -GRAPHICAL_HIERARCHY = NO -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -DOT_GRAPH_MAX_NODES = 100 -MAX_DOT_GRAPH_DEPTH = 2 -DOT_TRANSPARENT = YES -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = YES diff --git a/contrib/Doxyfile b/contrib/Doxyfile new file mode 100644 index 00000000..3c068dbe --- /dev/null +++ b/contrib/Doxyfile @@ -0,0 +1,247 @@ +# Doxyfile 1.5.5 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "GNU Taler: Merchant" +PROJECT_NUMBER = 0.3 +OUTPUT_DIRECTORY = doxygen-doc/ +CREATE_SUBDIRS = YES +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = . +STRIP_FROM_INC_PATH = src/include +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = NO +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +TYPEDEF_HIDES_STRUCT = NO +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = YES +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = NO +GENERATE_DEPRECATEDLIST= NO +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = src/ +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.c \ + *.h +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = */test_* */.git/* */perf_* */tls_test_* taler_config.h +EXCLUDE_SYMBOLS = GNUNET_* JSON_* +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = NO +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = TALER_ +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +#GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +GENERATE_HTMLHELP = NO +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +HTML_DYNAMIC_SECTIONS = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +#GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = YES +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +#GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = YES +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +#GENERATE_XML = NO +XML_OUTPUT = xml +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = contrib/gnunet.tag \ + contrib/microhttpd.tag \ + contrib/taler-exchange.tag +GENERATE_TAGFILE = contrib/taler-merchant.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +CLASS_GRAPH = NO +COLLABORATION_GRAPH = NO +GROUP_GRAPHS = NO +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = YES +CALLER_GRAPH = YES +GRAPHICAL_HIERARCHY = NO +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 100 +MAX_DOT_GRAPH_DEPTH = 2 +DOT_TRANSPARENT = YES +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = YES -- cgit v1.2.3 From 781414d7db750b0f450b66eefc5ad17ba5c14774 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Fri, 28 Jun 2019 18:36:36 +0200 Subject: #5784 --- src/backend/taler-merchant-httpd.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c index a1397ed3..4b2f3499 100644 --- a/src/backend/taler-merchant-httpd.c +++ b/src/backend/taler-merchant-httpd.c @@ -850,6 +850,20 @@ wireformat_iterator_cb (void *cls, "url", payto, "salt", salt_str); GNUNET_free (salt_str); + + /* Make sure every path component exists. */ + if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn)) + { + GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, + "mkdir", + fn); + GNUNET_free (fn); + GNUNET_free (payto); + json_decref (j); + iic->ret = GNUNET_SYSERR; + return; + } + if (0 != json_dump_file (j, fn, JSON_COMPACT | JSON_SORT_KEYS)) -- cgit v1.2.3 From bda627a43ae3fccb706e52a6fb03594316ace495 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 1 Aug 2019 22:18:25 +0200 Subject: check payment logic: send contract_url for unpaid contracts --- src/backend/taler-merchant-httpd_check-payment.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/taler-merchant-httpd_check-payment.c b/src/backend/taler-merchant-httpd_check-payment.c index 6542c717..121b2649 100644 --- a/src/backend/taler-merchant-httpd_check-payment.c +++ b/src/backend/taler-merchant-httpd_check-payment.c @@ -93,9 +93,11 @@ send_pay_request (struct MHD_Connection *connection, GNUNET_assert (NULL != url); ret = TMH_RESPONSE_reply_json_pack (connection, MHD_HTTP_OK, - "{s:s, s:b}", + "{s:s, s:s, s:b, s:b}", "payment_redirect_url", url, + "contract_url", + final_contract_url, "paid", 0); GNUNET_free (url); -- cgit v1.2.3 From 844982007393694c52a4d6d47417630a76fa5b94 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 1 Aug 2019 22:24:37 +0200 Subject: check payment logic: remove additional JSON format placeholder --- src/backend/taler-merchant-httpd_check-payment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/taler-merchant-httpd_check-payment.c b/src/backend/taler-merchant-httpd_check-payment.c index 121b2649..2e6cea91 100644 --- a/src/backend/taler-merchant-httpd_check-payment.c +++ b/src/backend/taler-merchant-httpd_check-payment.c @@ -93,7 +93,7 @@ send_pay_request (struct MHD_Connection *connection, GNUNET_assert (NULL != url); ret = TMH_RESPONSE_reply_json_pack (connection, MHD_HTTP_OK, - "{s:s, s:s, s:b, s:b}", + "{s:s, s:s, s:b}", "payment_redirect_url", url, "contract_url", -- cgit v1.2.3 From fa2a82779f457e6fcf593ee457472153b4388a5c Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sat, 17 Aug 2019 18:36:14 +0200 Subject: implement /config to query e.g. currency --- src/backend/Makefile.am | 3 +- src/backend/taler-merchant-httpd.c | 4 ++ src/backend/taler-merchant-httpd_config.c | 61 +++++++++++++++++++++++++++++++ src/backend/taler-merchant-httpd_config.h | 43 ++++++++++++++++++++++ 4 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 src/backend/taler-merchant-httpd_config.c create mode 100644 src/backend/taler-merchant-httpd_config.h diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am index 67ba825b..f5476df0 100644 --- a/src/backend/Makefile.am +++ b/src/backend/Makefile.am @@ -30,7 +30,8 @@ taler_merchant_httpd_SOURCES = \ 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_trigger-pay.c taler-merchant-httpd_trigger-pay.h + taler-merchant-httpd_trigger-pay.c taler-merchant-httpd_trigger-pay.h \ + taler-merchant-httpd_config.c taler-merchant-httpd_config.h taler_merchant_httpd_LDADD = \ diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c index 4b2f3499..9cc198e5 100644 --- a/src/backend/taler-merchant-httpd.c +++ b/src/backend/taler-merchant-httpd.c @@ -48,6 +48,7 @@ #include "taler-merchant-httpd_refund.h" #include "taler-merchant-httpd_check-payment.h" #include "taler-merchant-httpd_trigger-pay.h" +#include "taler-merchant-httpd_config.h" /** * Backlog for listen operation on unix-domain sockets. @@ -291,6 +292,9 @@ url_handler (void *cls, { "/public/trigger-pay", MHD_HTTP_METHOD_GET, "text/plain", NULL, 0, &MH_handler_trigger_pay, MHD_HTTP_OK}, + { "/config", MHD_HTTP_METHOD_GET, "text/plain", + NULL, 0, + &MH_handler_config, MHD_HTTP_OK}, {NULL, NULL, NULL, NULL, 0, 0 } }; static struct TMH_RequestHandler h404 = diff --git a/src/backend/taler-merchant-httpd_config.c b/src/backend/taler-merchant-httpd_config.c new file mode 100644 index 00000000..931270f1 --- /dev/null +++ b/src/backend/taler-merchant-httpd_config.c @@ -0,0 +1,61 @@ +/* + This file is part of TALER + (C) 2019 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU Affero 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 +*/ +/** + * @file backend/taler-merchant-httpd_config.c + * @brief implement API for querying configuration data of the backend + * @author Florian Dold + */ +#include "platform.h" +#include +#include +#include +#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_tip-query.h" +#include "taler-merchant-httpd_tip-reserve-helper.h" + + +/** + * Handle a "/config" request. + * + * @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_config (struct TMH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size) +{ + int ret; + ret = TMH_RESPONSE_reply_json_pack (connection, + MHD_HTTP_OK, + "{s:s}", + "currency", TMH_currency); + + + return ret; +} + +/* end of taler-merchant-httpd_config.c */ diff --git a/src/backend/taler-merchant-httpd_config.h b/src/backend/taler-merchant-httpd_config.h new file mode 100644 index 00000000..cff766eb --- /dev/null +++ b/src/backend/taler-merchant-httpd_config.h @@ -0,0 +1,43 @@ +/* + This file is part of TALER + (C) 2019 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 +*/ +/** + * @file backend/taler-merchant-httpd_config.h + * @brief headers for /config handler + * @author Florian Dold + */ +#ifndef TALER_MERCHANT_HTTPD_CONFIG_H +#define TALER_MERCHANT_HTTPD_CONFIG_H +#include +#include "taler-merchant-httpd.h" + +/** + * Manages a /config call. + * + * @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_config (struct TMH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size); + +#endif -- cgit v1.2.3