From 119de8db9e317e46ebe800524b806809d2b435b0 Mon Sep 17 00:00:00 2001 From: Jonathan Buchanan Date: Sun, 9 Aug 2020 23:28:56 -0400 Subject: implement parser for taler_pay_uri --- src/testing/testing_api_cmd_merchant_get_order.c | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/testing/testing_api_cmd_merchant_get_order.c') diff --git a/src/testing/testing_api_cmd_merchant_get_order.c b/src/testing/testing_api_cmd_merchant_get_order.c index 4ae459a3..1da6b7b6 100644 --- a/src/testing/testing_api_cmd_merchant_get_order.c +++ b/src/testing/testing_api_cmd_merchant_get_order.c @@ -441,6 +441,31 @@ merchant_get_order_cb ( return; } } + else + { + /* FIXME: Check all of the members of `pud` */ + struct TALER_MERCHANT_PayUriData pud; + if (GNUNET_OK != + TALER_MERCHANT_parse_pay_uri (osr->details.unpaid.taler_pay_uri, + &pud)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Taler pay uri is malformed\n"); + TALER_TESTING_interpreter_fail (gos->is); + return; + } + + if ((0 != strcmp ("localhost:8080", + pud.merchant_host)) || + (NULL != pud.merchant_prefix_path)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Taler pay uri is incorrect\n"); + TALER_TESTING_interpreter_fail (gos->is); + TALER_MERCHANT_parse_pay_uri_free (&pud); + return; + } + } break; default: GNUNET_log (GNUNET_ERROR_TYPE_WARNING, -- cgit v1.2.3