diff options
author | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-07-23 20:00:13 -0400 |
---|---|---|
committer | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-07-23 20:00:13 -0400 |
commit | 94f8e779a3a8706d5ade4f1871607132acb9e026 (patch) | |
tree | 05845de6881a6880e5ee2f45cb0d0d9516a41fbd /src/testing | |
parent | 280b0a6c5aa4917d85b0e480f9e08ce59b4588d9 (diff) | |
download | merchant-94f8e779a3a8706d5ade4f1871607132acb9e026.tar.gz merchant-94f8e779a3a8706d5ade4f1871607132acb9e026.tar.bz2 merchant-94f8e779a3a8706d5ade4f1871607132acb9e026.zip |
test pay with NULL session_id
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/test_merchant_api.c | 30 | ||||
-rw-r--r-- | src/testing/test_merchant_api_twisted.c | 12 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_pay_order.c | 12 |
3 files changed, 38 insertions, 16 deletions
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c index 41fa321a..268f4142 100644 --- a/src/testing/test_merchant_api.c +++ b/src/testing/test_merchant_api.c @@ -328,7 +328,8 @@ run (void *cls, "create-proposal-1", "withdraw-coin-1", "EUR:5", - "EUR:4.99"), + "EUR:4.99", + "session-0"), TALER_TESTING_cmd_poll_order_conclude ("poll-order-merchant-1-conclude", MHD_HTTP_OK, "poll-order-merchant-1-start"), @@ -350,7 +351,8 @@ run (void *cls, "create-proposal-1", "withdraw-coin-1", "EUR:5", - "EUR:4.99"), + "EUR:4.99", + "session-0"), TALER_TESTING_cmd_check_bank_empty ("check_bank_empty-1"), CMD_EXEC_AGGREGATOR ("run-aggregator"), TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-498c", @@ -556,7 +558,8 @@ run (void *cls, "create-proposal-2", "withdraw-coin-1", "EUR:5", - "EUR:4.99"), + "EUR:4.99", + NULL), #if 0 TALER_TESTING_cmd_history ("history-0", merchant_url, @@ -621,7 +624,8 @@ run (void *cls, "create-proposal-1r", "withdraw-coin-1r", "EUR:5", - "EUR:4.99"), + "EUR:4.99", + NULL), #if 0 TALER_TESTING_cmd_poll_payment_start ("poll-payment-refund-1", merchant_url, @@ -739,7 +743,8 @@ run (void *cls, "create-proposal-unincreased-refund", "withdraw-coin-unincreased-refund", "EUR:5", - "EUR:4.99"), + "EUR:4.99", + NULL), CMD_EXEC_AGGREGATOR ("run-aggregator-unincreased-refund"), TALER_TESTING_cmd_check_bank_transfer ( "check_bank_transfer-paid-unincreased-refund", @@ -965,7 +970,8 @@ run (void *cls, "create-proposal-tip-1", "pickup-tip-1", "EUR:5", // amount + fee - "EUR:4.99"), // amount - fee + "EUR:4.99", + NULL), // amount - fee CMD_EXEC_AGGREGATOR ("aggregator-tip-1"), TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-tip-498c", EXCHANGE_URL, @@ -1011,14 +1017,16 @@ run (void *cls, "create-proposal-10", "withdraw-coin-10a;withdraw-coin-1", "EUR:5", - "EUR:4.99"), + "EUR:4.99", + NULL), TALER_TESTING_cmd_merchant_pay_order ("pay-again-10", merchant_url, MHD_HTTP_OK, "create-proposal-10", "withdraw-coin-10a;withdraw-coin-10b", "EUR:5", - "EUR:4.99"), + "EUR:4.99", + NULL), CMD_EXEC_AGGREGATOR ("run-aggregator-10"), TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-9.97-10", EXCHANGE_URL, @@ -1063,14 +1071,16 @@ run (void *cls, "create-proposal-11", "withdraw-coin-11a", "EUR:5", - "EUR:4.99"), + "EUR:4.99", + NULL), TALER_TESTING_cmd_merchant_pay_order ("pay-fail-partial-double-11-bad", merchant_url, MHD_HTTP_CONFLICT, "create-proposal-11", "withdraw-coin-1", "EUR:5", - "EUR:4.99"), + "EUR:4.99", + NULL), TALER_TESTING_cmd_merchant_order_abort ("pay-abort-11", merchant_url, "pay-fail-partial-double-11-good", diff --git a/src/testing/test_merchant_api_twisted.c b/src/testing/test_merchant_api_twisted.c index 282d18ef..3304f4d5 100644 --- a/src/testing/test_merchant_api_twisted.c +++ b/src/testing/test_merchant_api_twisted.c @@ -234,7 +234,8 @@ run (void *cls, "create-proposal-abort-1", "withdraw-coin-abort-1", "EUR:1.01", - "EUR:1.00"), // no sense now + "EUR:1.00", + NULL), // no sense now TALER_TESTING_cmd_delete_object ("hack-abort-1", PROXY_MERCHANT_CONFIG_FILE, "merchant_pub"), @@ -300,7 +301,8 @@ run (void *cls, "create-proposal-double-spend", "withdraw-coin-double-spend", "EUR:1.01", - "EUR:1.00"), // no sense now + "EUR:1.00", + NULL), // no sense now TALER_TESTING_cmd_flip_download ("hack-coin-history", PROXY_MERCHANT_CONFIG_FILE, "history.0.coin_sig"), @@ -312,7 +314,8 @@ run (void *cls, "create-proposal-double-spend-1", "withdraw-coin-double-spend", "EUR:1.01", - "EUR:1.00"), // no sense now + "EUR:1.00", + NULL), // no sense now /* max uint64 number: 9223372036854775807; try to overflow! */ TALER_TESTING_cmd_end () }; @@ -364,7 +367,8 @@ run (void *cls, "create-proposal-1", "withdraw-coin-1", "EUR:5", - "EUR:4.99"), + "EUR:4.99", + NULL), TALER_TESTING_cmd_malform_response ("malform-abort-merchant-exchange", PROXY_EXCHANGE_CONFIG_FILE), TALER_TESTING_cmd_merchant_order_abort ("pay-abort-1", diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c index dca44377..6848e6a3 100644 --- a/src/testing/testing_api_cmd_pay_order.c +++ b/src/testing/testing_api_cmd_pay_order.c @@ -86,6 +86,11 @@ struct PayState * Signature from the merchant, set on success. */ struct TALER_MerchantSignatureP merchant_sig; + + /** + * The session for which the payment is made. + */ + const char *session_id; }; @@ -357,7 +362,7 @@ pay_run (void *cls, ps->h_contract_terms = *h_proposal; ps->oph = TALER_MERCHANT_order_pay (is->ctx, ps->merchant_url, - "", /* session ID */ + ps->session_id, h_proposal, &total_amount, &max_fee, @@ -487,6 +492,7 @@ pay_traits (void *cls, * @param amount_with_fee amount to pay, including the deposit * fee * @param amount_without_fee amount to pay, no fees included. + * @param session_id the session id to use for the payment (can be NULL). * @return the command */ struct TALER_TESTING_Command @@ -496,7 +502,8 @@ TALER_TESTING_cmd_merchant_pay_order (const char *label, const char *proposal_reference, const char *coin_reference, const char *amount_with_fee, - const char *amount_without_fee) + const char *amount_without_fee, + const char *session_id) { struct PayState *ps; @@ -507,6 +514,7 @@ TALER_TESTING_cmd_merchant_pay_order (const char *label, ps->merchant_url = merchant_url; ps->amount_with_fee = amount_with_fee; ps->amount_without_fee = amount_without_fee; + ps->session_id = session_id; { struct TALER_TESTING_Command cmd = { .cls = ps, |