[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] branch master updated: fix #6674
From: |
gnunet |
Subject: |
[taler-merchant] branch master updated: fix #6674 |
Date: |
Thu, 07 Jan 2021 22:58:08 +0100 |
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 7de305af fix #6674
7de305af is described below
commit 7de305af405fa04da82684c1921fb3c636434a3b
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Jan 7 22:57:56 2021 +0100
fix #6674
---
src/testing/testing_api_cmd_merchant_get_order.c | 50 +++++++++++++++++-------
src/testing/testing_api_cmd_refund_order.c | 47 ++++++++++++++++------
src/testing/testing_api_cmd_wallet_get_order.c | 45 +++++++++++++++------
3 files changed, 104 insertions(+), 38 deletions(-)
diff --git a/src/testing/testing_api_cmd_merchant_get_order.c
b/src/testing/testing_api_cmd_merchant_get_order.c
index 2c6a3db5..6e408d89 100644
--- a/src/testing/testing_api_cmd_merchant_get_order.c
+++ b/src/testing/testing_api_cmd_merchant_get_order.c
@@ -485,21 +485,43 @@ merchant_get_order_cb (
0,
&claim_token))
TALER_TESTING_FAIL (gos->is);
-
- if ((0 != strcmp ("localhost:8080",
- pud.merchant_host)) ||
- (NULL != pud.merchant_prefix_path) ||
- (0 != strcmp (order_id,
- pud.order_id)) ||
- (NULL != pud.ssid))
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Order pay uri does not match, got %s/%s\n",
- pud.merchant_host,
- pud.order_id);
- TALER_TESTING_interpreter_fail (gos->is);
- TALER_MERCHANT_parse_pay_uri_free (&pud);
- return;
+ char *port;
+ char *host;
+
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (gos->is->cfg,
+ "merchant",
+ "PORT",
+ &port))
+ {
+ /* How did we get here without a configured port? */
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (gos->is);
+ TALER_MERCHANT_parse_pay_uri_free (&pud);
+ return;
+ }
+ GNUNET_asprintf (&host,
+ "localhost:%s",
+ port);
+ GNUNET_free (port);
+ if ((0 != strcmp (host,
+ pud.merchant_host)) ||
+ (NULL != pud.merchant_prefix_path) ||
+ (0 != strcmp (order_id,
+ pud.order_id)) ||
+ (NULL != pud.ssid))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Order pay uri does not match, got %s/%s\n",
+ pud.merchant_host,
+ pud.order_id);
+ TALER_TESTING_interpreter_fail (gos->is);
+ TALER_MERCHANT_parse_pay_uri_free (&pud);
+ GNUNET_free (host);
+ return;
+ }
+ GNUNET_free (host);
}
/* The claim token is not given in the pay uri if the order
has been claimed already. */
diff --git a/src/testing/testing_api_cmd_refund_order.c
b/src/testing/testing_api_cmd_refund_order.c
index c8927122..309c33a8 100644
--- a/src/testing/testing_api_cmd_refund_order.c
+++ b/src/testing/testing_api_cmd_refund_order.c
@@ -115,21 +115,42 @@ refund_cb (void *cls,
TALER_TESTING_interpreter_fail (ris->is);
return;
}
-
- if ((0 != strcmp ("localhost:8080",
- rud.merchant_host)) ||
- (NULL != rud.merchant_prefix_path) ||
- (0 != strcmp (ris->order_id,
- rud.order_id)) ||
- (NULL != rud.ssid))
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Taler refund uri does not match\n");
- TALER_TESTING_interpreter_fail (ris->is);
- TALER_MERCHANT_parse_refund_uri_free (&rud);
- return;
+ char *port;
+ char *host;
+
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (ris->is->cfg,
+ "merchant",
+ "PORT",
+ &port))
+ {
+ /* How did we get here without a configured port? */
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (ris->is);
+ TALER_MERCHANT_parse_refund_uri_free (&rud);
+ return;
+ }
+ GNUNET_asprintf (&host,
+ "localhost:%s",
+ port);
+ GNUNET_free (port);
+ if ((0 != strcmp (host,
+ rud.merchant_host)) ||
+ (NULL != rud.merchant_prefix_path) ||
+ (0 != strcmp (ris->order_id,
+ rud.order_id)) ||
+ (NULL != rud.ssid))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Taler refund uri does not match\n");
+ TALER_TESTING_interpreter_fail (ris->is);
+ TALER_MERCHANT_parse_refund_uri_free (&rud);
+ GNUNET_free (host);
+ return;
+ }
+ GNUNET_free (host);
}
-
TALER_MERCHANT_parse_refund_uri_free (&rud);
}
break;
diff --git a/src/testing/testing_api_cmd_wallet_get_order.c
b/src/testing/testing_api_cmd_wallet_get_order.c
index 406591a9..446c702a 100644
--- a/src/testing/testing_api_cmd_wallet_get_order.c
+++ b/src/testing/testing_api_cmd_wallet_get_order.c
@@ -183,18 +183,41 @@ wallet_get_order_cb (
&claim_token))
TALER_TESTING_FAIL (gos->is);
- if ((0 != strcmp ("localhost:8080",
- pud.merchant_host)) ||
- (NULL != pud.merchant_prefix_path) ||
- (0 != strcmp (order_id,
- pud.order_id)) ||
- (NULL != pud.ssid))
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Order pay uri does not match\n");
- TALER_TESTING_interpreter_fail (gos->is);
- TALER_MERCHANT_parse_pay_uri_free (&pud);
- return;
+ char *port;
+ char *host;
+
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (gos->is->cfg,
+ "merchant",
+ "PORT",
+ &port))
+ {
+ /* How did we get here without a configured port? */
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (gos->is);
+ TALER_MERCHANT_parse_pay_uri_free (&pud);
+ return;
+ }
+ GNUNET_asprintf (&host,
+ "localhost:%s",
+ port);
+ GNUNET_free (port);
+ if ((0 != strcmp (host,
+ pud.merchant_host)) ||
+ (NULL != pud.merchant_prefix_path) ||
+ (0 != strcmp (order_id,
+ pud.order_id)) ||
+ (NULL != pud.ssid))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Order pay uri does not match\n");
+ TALER_TESTING_interpreter_fail (gos->is);
+ TALER_MERCHANT_parse_pay_uri_free (&pud);
+ GNUNET_free (host);
+ return;
+ }
+ GNUNET_free (host);
}
/* The claim token is not given in the pay uri if the order
has been claimed already. */
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant] branch master updated: fix #6674,
gnunet <=