summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-07-26 14:55:59 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2018-07-26 14:55:59 +0200
commitc993c0d650ae8fe603f38e6993f6f0966611f6dc (patch)
treea7092ceac8aea63707ce5aa84b62af4e924276ed
parentae677d18082a1f817ead046209f2a1518185897b (diff)
downloadmerchant-c993c0d650ae8fe603f38e6993f6f0966611f6dc.tar.gz
merchant-c993c0d650ae8fe603f38e6993f6f0966611f6dc.tar.bz2
merchant-c993c0d650ae8fe603f38e6993f6f0966611f6dc.zip
Addressing #5383 led to discover that..
.. merchant-lib used to give a hard error for a 424 response on /track/transfer; fixed by just passing the control to the caller.
-rw-r--r--src/lib/merchant_api_track_transfer.c3
-rw-r--r--src/lib/test_merchant_api_twisted.c85
2 files changed, 88 insertions, 0 deletions
diff --git a/src/lib/merchant_api_track_transfer.c b/src/lib/merchant_api_track_transfer.c
index 7c78532f..5766a57c 100644
--- a/src/lib/merchant_api_track_transfer.c
+++ b/src/lib/merchant_api_track_transfer.c
@@ -179,6 +179,9 @@ handle_track_transfer_finished (void *cls,
GNUNET_break_op (0);
response_code = 0;
break;
+ case MHD_HTTP_FAILED_DEPENDENCY:
+ /* Not a reason to break execution. */
+ break;
case MHD_HTTP_NOT_FOUND:
/* Nothing really to verify, this should never
happen, we should pass the JSON reply to the application */
diff --git a/src/lib/test_merchant_api_twisted.c b/src/lib/test_merchant_api_twisted.c
index 2193a468..b8ab4c14 100644
--- a/src/lib/test_merchant_api_twisted.c
+++ b/src/lib/test_merchant_api_twisted.c
@@ -551,6 +551,88 @@ run (void *cls,
TALER_TESTING_cmd_end ()
};
+ /***** Test #5383 *****/
+ struct TALER_TESTING_Command track_5383[] = {
+ CMD_TRANSFER_TO_EXCHANGE ("create-reserve-5383",
+ "EUR:2.02"),
+ CMD_EXEC_WIREWATCH ("wirewatch-5383"),
+ TALER_TESTING_cmd_check_bank_transfer
+ ("check_bank_transfer-5383",
+ EXCHANGE_URL,
+ "EUR:2.02",
+ USER_ACCOUNT_NO,
+ EXCHANGE_ACCOUNT_NO),
+ TALER_TESTING_cmd_withdraw_amount
+ ("withdraw-coin-5383a",
+ is->exchange,
+ "create-reserve-5383",
+ "EUR:1",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount
+ ("withdraw-coin-5383b",
+ is->exchange,
+ "create-reserve-5383",
+ "EUR:1",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_proposal
+ ("create-proposal-5383",
+ twister_merchant_url,
+ is->ctx,
+ MHD_HTTP_OK,
+ "{\"max_fee\":\
+ {\"currency\":\"EUR\",\
+ \"value\":0,\
+ \"fraction\":50000000},\
+ \"order_id\":\"5383\",\
+ \"refund_deadline\":\"\\/Date(0)\\/\",\
+ \"pay_deadline\":\"\\/Date(99999999999)\\/\",\
+ \"fulfillment_url\": \"https://example.com/\",\
+ \"amount\":\
+ {\"currency\":\"EUR\",\
+ \"value\":2,\
+ \"fraction\":0},\
+ \"summary\": \"merchant-lib testcase\",\
+ \"products\": [ {\"description\":\"ice cream\",\
+ \"value\":\"{EUR:2}\"} ] }",
+ NULL),
+ TALER_TESTING_cmd_pay ("deposit-simple-5383",
+ twister_merchant_url,
+ is->ctx,
+ MHD_HTTP_OK,
+ "create-proposal-5383",
+ "withdraw-coin-5383a;" \
+ "withdraw-coin-5383b",
+ "EUR:2",
+ "EUR:1.99", // no sense now
+ "EUR:0.01"), // no sense now
+ CMD_EXEC_AGGREGATOR ("run-aggregator-5383"),
+ TALER_TESTING_cmd_check_bank_transfer
+ ("check_aggregation_transfer-5383",
+ twister_exchange_url, /* has the 8888-port thing. */
+ /* paid, 1.97 =
+ brutto 2.00 -
+ deposit fee 0.01 * 2 -
+ wire fee 0.01
+ */
+ "EUR:1.97",
+ EXCHANGE_ACCOUNT_NO,
+ MERCHANT_ACCOUNT_NO),
+ TALER_TESTING_cmd_modify_object_dl
+ ("hack-5383",
+ PROXY_EXCHANGE_CONFIG_FILE,
+ "total",
+ "EUR:0.98"),
+ TALER_TESTING_cmd_merchant_track_transfer
+ ("track-5383",
+ twister_merchant_url,
+ is->ctx,
+ MHD_HTTP_FAILED_DEPENDENCY,
+ "check_aggregation_transfer-5383"),
+
+ TALER_TESTING_cmd_end ()
+ };
+
+
/***** Test transactions tracking *****/
struct TALER_TESTING_Command track[] = {
@@ -900,6 +982,9 @@ run (void *cls,
TALER_TESTING_cmd_batch ("track",
track),
+ TALER_TESTING_cmd_batch ("track-5383",
+ track_5383),
+
TALER_TESTING_cmd_batch ("pay",
pay),