summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-06-28 11:42:05 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2018-06-28 11:42:05 +0200
commitcbd2ca3f1e75b84758bc5bd4275e49702e2844c1 (patch)
tree51757a2a2358648329f6fa94c6b9f5c0e2653a30
parent8330ab85d6143787187948e6b7a617659a9706e3 (diff)
downloadmerchant-cbd2ca3f1e75b84758bc5bd4275e49702e2844c1.tar.gz
merchant-cbd2ca3f1e75b84758bc5bd4275e49702e2844c1.tar.bz2
merchant-cbd2ca3f1e75b84758bc5bd4275e49702e2844c1.zip
Reproducing #5366 within test cases.
-rw-r--r--src/lib/test_merchant_api_new.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/lib/test_merchant_api_new.c b/src/lib/test_merchant_api_new.c
index 17fcd5bb..9912b19e 100644
--- a/src/lib/test_merchant_api_new.c
+++ b/src/lib/test_merchant_api_new.c
@@ -335,6 +335,76 @@ run (void *cls,
TALER_TESTING_cmd_end ()
};
+ /**
+ * This block tests whether a refund_deadline and/or
+ * wire_transfer_deadline very far in the future do NOT
+ * result in any wire transfer from the aggregator (#5366).
+ */
+ struct TALER_TESTING_Command unaggregation[] = {
+
+ CMD_TRANSFER_TO_EXCHANGE
+ ("create-reserve-unaggregation",
+ "EUR:5.01"),
+
+ CMD_EXEC_WIREWATCH
+ ("wirewatch-unaggregation"),
+
+ TALER_TESTING_cmd_check_bank_transfer
+ ("check_bank_transfer-unaggregation",
+ EXCHANGE_URL,
+ "EUR:5.01",
+ USER_ACCOUNT_NO,
+ EXCHANGE_ACCOUNT_NO),
+
+ TALER_TESTING_cmd_withdraw_amount
+ ("withdraw-coin-unaggregation",
+ is->exchange,
+ "create-reserve-unaggregation",
+ "EUR:5",
+ MHD_HTTP_OK),
+
+ TALER_TESTING_cmd_proposal
+ ("create-proposal-unaggregation",
+ merchant_url,
+ is->ctx,
+ MHD_HTTP_OK,
+ "{\"max_fee\":\
+ {\"currency\":\"EUR\",\
+ \"value\":0,\
+ \"fraction\":50000000},\
+ \"refund_deadline\":\"\\/Date(2)\\/\",\
+ \"pay_deadline\":\"\\/Date(1)\\/\",\
+ \"wire_transfer_delay\":\"\\/Delay(3)\\/\",\
+ \"amount\":\
+ {\"currency\":\"EUR\",\
+ \"value\":5,\
+ \"fraction\":0},\
+ \"summary\": \"unaggregated product\",\
+ \"fulfillment_url\": \"https://example.com/\",\
+ \"products\": [ {\"description\":\"unaggregated cream\",\
+ \"value\":\"{EUR:5}\"} ] }",
+ NULL),
+
+ TALER_TESTING_cmd_pay
+ ("pay-unaggregation",
+ merchant_url,
+ is->ctx,
+ MHD_HTTP_OK,
+ "create-proposal-unaggregation",
+ "withdraw-coin-unaggregation",
+ "EUR:5", // amount + fee
+ "EUR:4.99", // amount - fee
+ "EUR:0.01"), // refund fee
+
+ CMD_EXEC_AGGREGATOR
+ ("aggregation-attempt"),
+
+ TALER_TESTING_cmd_check_bank_empty
+ ("check_bank_unaggregated"),
+
+ TALER_TESTING_cmd_end ()
+ };
+
struct TALER_TESTING_Command track[] = {
TALER_TESTING_cmd_merchant_track_transaction
@@ -1050,6 +1120,9 @@ run (void *cls,
TALER_TESTING_cmd_batch ("double-spending",
double_spending),
+ TALER_TESTING_cmd_batch ("unaggregation",
+ unaggregation),
+
TALER_TESTING_cmd_batch ("track",
track),