summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_refund_order.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_refund_order.c')
-rw-r--r--src/testing/testing_api_cmd_refund_order.c47
1 files changed, 34 insertions, 13 deletions
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;