merchant

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

commit 2bf5a099d305a03952ee53f28fca3d44046a06d2
parent 76736ce2cc1c9b3939b670703804b496c98b1fbf
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Fri, 23 Mar 2018 11:50:46 +0100

putting tip-authorize into tests.

Diffstat:
Msrc/include/taler_merchant_testing_lib.h | 37+++++++++++++++++++++++++++++++++++++
Msrc/lib/test_merchant_api_new.c | 25+++++++++++++++++++++++++
Msrc/lib/testing_api_cmd_tip.c | 2++
3 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h @@ -497,4 +497,41 @@ TALER_TESTING_get_trait_refund_entry unsigned int index, const struct TALER_MERCHANT_RefundEntry **refund_entry); +/** + * FIXME + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_tip_authorize (const char *label, + const char *merchant_url, + const char *exchange_url, + struct GNUNET_CURL_Context *ctx, + unsigned int http_status, + const char *instance, + const char *justification, + const char *amount); + +/** + * FIXME + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_tip_query (const char *label, + const char *merchant_url, + struct GNUNET_CURL_Context *ctx, + unsigned int http_status, + const char *instance); + +/** + * FIXME + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_tip_pickup + (const char *label, + const char *merchant_url, + struct GNUNET_CURL_Context *ctx, + unsigned int http_status, + const char *authorize_reference, + const char **amounts, + struct TALER_EXCHANGE_Handle *exchange); + + #endif diff --git a/src/lib/test_merchant_api_new.c b/src/lib/test_merchant_api_new.c @@ -464,7 +464,32 @@ run (void *cls, "1"), /* Test tipping. */ + TALER_TESTING_cmd_fakebank_transfer_with_instance + ("create-reserve-tip-1", + "EUR:20.04", + fakebank_url, + USER_ACCOUNT_NO, + EXCHANGE_ACCOUNT_NO, + USER_LOGIN_NAME, + USER_LOGIN_PASS, + "tip", + EXCHANGE_URL, + CONFIG_FILE), + + CMD_EXEC_WIREWATCH ("wirewatch-11"), + + TALER_TESTING_cmd_tip_authorize ("authorize-tip-1", + merchant_url, + exchange_url, + is->ctx, + MHD_HTTP_OK, + "tip", + "tip 1", + "EUR:5.01"), + /* Will fail here until all new + * transfers have not been checked. I.e., + * there is now a 20.04 euro "pending" transfer. */ /* pay again logic. */ TALER_TESTING_cmd_fakebank_transfer diff --git a/src/lib/testing_api_cmd_tip.c b/src/lib/testing_api_cmd_tip.c @@ -258,6 +258,7 @@ tip_authorize_cleanup (void *cls, struct TALER_TESTING_Command TALER_TESTING_cmd_tip_authorize (const char *label, const char *merchant_url, + const char *exchange_url, struct GNUNET_CURL_Context *ctx, unsigned int http_status, const char *instance, @@ -269,6 +270,7 @@ TALER_TESTING_cmd_tip_authorize (const char *label, tas = GNUNET_new (struct TipAuthorizeState); tas->merchant_url = merchant_url; + tas->exchange_url = exchange_url; tas->ctx = ctx; tas->instance = instance; tas->justification = justification;