merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit ff6fba5d6336ae0002b47cebbf56c5f9f3d0a2f9
parent b97d4e7b475a0e637c24f3f3ea17d79f572d9067
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Fri, 23 Mar 2018 12:07:42 +0100

putting query with amounts under test.

Diffstat:
Msrc/include/taler_merchant_testing_lib.h | 14++++++++++++++
Msrc/lib/test_merchant_api_new.c | 8++++++++
Msrc/lib/testing_api_cmd_tip.c | 35+++++++++++++++++++++++++++++++++++
3 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h @@ -524,6 +524,20 @@ TALER_TESTING_cmd_tip_query (const char *label, * FIXME */ struct TALER_TESTING_Command +TALER_TESTING_cmd_tip_query_with_amounts + (const char *label, + const char *merchant_url, + struct GNUNET_CURL_Context *ctx, + unsigned int http_status, + const char *instance, + const char *expected_amount_picked_up, + const char *expected_amount_authorized, + const char *expected_amount_available); + +/** + * FIXME + */ +struct TALER_TESTING_Command TALER_TESTING_cmd_tip_pickup (const char *label, const char *merchant_url, diff --git a/src/lib/test_merchant_api_new.c b/src/lib/test_merchant_api_new.c @@ -503,6 +503,14 @@ run (void *cls, MHD_HTTP_OK, "tip"), + TALER_TESTING_cmd_tip_query_with_amounts ("query-1", + merchant_url, + is->ctx, + MHD_HTTP_OK, + "tip", + "EUR:0.0", // picked + "EUR:10.02", // auth + "EUR:20.04"),// ava /* Will fail here until all new * transfers have not been checked. I.e., * there is now a 20.04 euro "pending" transfer. */ diff --git a/src/lib/testing_api_cmd_tip.c b/src/lib/testing_api_cmd_tip.c @@ -399,6 +399,41 @@ tip_query_run (void *cls, * FIXME */ struct TALER_TESTING_Command +TALER_TESTING_cmd_tip_query_with_amounts + (const char *label, + const char *merchant_url, + struct GNUNET_CURL_Context *ctx, + unsigned int http_status, + const char *instance, + const char *expected_amount_picked_up, + const char *expected_amount_authorized, + const char *expected_amount_available) +{ + struct TipQueryState *tqs; + struct TALER_TESTING_Command cmd; + + tqs = GNUNET_new (struct TipQueryState); + tqs->merchant_url = merchant_url; + tqs->ctx = ctx; + tqs->instance = instance; + tqs->http_status = http_status; + tqs->expected_amount_picked_up = expected_amount_picked_up; + tqs->expected_amount_authorized = expected_amount_authorized; + tqs->expected_amount_available = expected_amount_available; + + cmd.cls = tqs; + cmd.label = label; + cmd.run = &tip_query_run; + cmd.cleanup = &tip_query_cleanup; + + return cmd; +} + + +/** + * FIXME + */ +struct TALER_TESTING_Command TALER_TESTING_cmd_tip_query (const char *label, const char *merchant_url, struct GNUNET_CURL_Context *ctx,