diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-03-26 11:24:01 +0200 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-03-26 11:24:01 +0200 |
commit | f73cf1fbd129c25370ed123e0e09042f4d95648d (patch) | |
tree | 48ee543a9f4f6b2a01d1f4bed586ec7bf6d6382b /src/lib/test_merchant_api_twisted.c | |
parent | a54daf35f13591a17a07da9f63479ac7fea27225 (diff) | |
download | merchant-f73cf1fbd129c25370ed123e0e09042f4d95648d.tar.gz merchant-f73cf1fbd129c25370ed123e0e09042f4d95648d.tar.bz2 merchant-f73cf1fbd129c25370ed123e0e09042f4d95648d.zip |
test non 200 response code from /check-payment.
Diffstat (limited to 'src/lib/test_merchant_api_twisted.c')
-rw-r--r-- | src/lib/test_merchant_api_twisted.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/lib/test_merchant_api_twisted.c b/src/lib/test_merchant_api_twisted.c index 8bb9d075..14476669 100644 --- a/src/lib/test_merchant_api_twisted.c +++ b/src/lib/test_merchant_api_twisted.c @@ -182,6 +182,45 @@ run (void *cls, struct TALER_TESTING_Command commands[] = { + /**** Covering /check-payment ****/ + + TALER_TESTING_cmd_proposal + ("proposal-for-check-payment", + twister_merchant_url, + is->ctx, + MHD_HTTP_OK, + "{\"max_fee\":\ + {\"currency\":\"EUR\",\ + \"value\":0,\ + \"fraction\":50000000},\ + \"order_id\":\"fail-check-payment-1\",\ + \"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:3}\"} ] }", + NULL), + + /* Need any response code != 200. */ + TALER_TESTING_cmd_hack_response_code + ("non-200-response-code", + PROXY_MERCHANT_CONFIG_FILE, + MHD_HTTP_MULTIPLE_CHOICES), + + TALER_TESTING_cmd_check_payment + ("check-payment-fail", + twister_merchant_url, + is->ctx, + MHD_HTTP_MULTIPLE_CHOICES, + "proposal-for-check-payment", + GNUNET_SYSERR), // any response != 200 gives "syserr" + + TALER_TESTING_cmd_end (), /**** Covering /proposal lib ****/ @@ -398,6 +437,8 @@ run (void *cls, 10), // nrows + /***** Test transactions tracking *****/ + /** * Move money to the exchange's bank account. */ |