merchant

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

commit 430a132c9b3c00c9d2149a0bfc8329ba703f28e2
parent fd58a6d9480ef2706139cad8bffb87fbd050075f
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 28 Sep 2025 22:16:27 +0200

-adapt to Donau API change

Diffstat:
Msrc/include/taler_merchant_testing_lib.h | 19++++++++-----------
Msrc/testing/test_merchant_api.c | 4----
Msrc/testing/testing_api_cmd_post_donau_charity_merchant.c | 64++++++++++++++++++++++++++++++++++------------------------------
3 files changed, 42 insertions(+), 45 deletions(-)

diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h @@ -1925,23 +1925,20 @@ TALER_TESTING_cmd_checkserver2 (const char *label, * @param name name of the charity * @param url url of the charity * @param max_per_year maximum amount of donations per year - * @param receipts_to_date amount of receipts to date - * @param current_year year * @param bearer * @param merchant_reference reference to fetch the merchant public key * @param expected_response_code expected HTTP response code * @return */ struct TALER_TESTING_Command -TALER_TESTING_cmd_charity_post_merchant (const char *label, - const char *name, - const char *url, - const char *max_per_year, - const char *receipts_to_date, - uint64_t current_year, - const struct DONAU_BearerToken *bearer, - const char *merchant_reference, - unsigned int expected_response_code); +TALER_TESTING_cmd_charity_post_merchant ( + const char *label, + const char *name, + const char *url, + const char *max_per_year, + const struct DONAU_BearerToken *bearer, + const char *merchant_reference, + unsigned int expected_response_code); #endif /* HAVE_DONAU_DONAU_SERVICE_H */ diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c @@ -1874,8 +1874,6 @@ run (void *cls, "example", "example.com", "EUR:50", // max_per_year - "EUR:0", // receipts_to_date - 2025, // current year &bearer, "create-another-order-with-input-and-output", // reusing the merchant_reference for merchant_pub @@ -1884,8 +1882,6 @@ run (void *cls, "example", "example.com", "EUR:50", // max_per_year - "EUR:0", // receipts_to_date - 2025, // current year &bearer, "create-another-order-with-input-and-output", // reusing the merchant_reference for merchant_pub diff --git a/src/testing/testing_api_cmd_post_donau_charity_merchant.c b/src/testing/testing_api_cmd_post_donau_charity_merchant.c @@ -44,9 +44,24 @@ struct StatusState struct DONAU_CharityPostHandle *cph; /** - * The charity POST request. + * name of the charity */ - struct DONAU_CharityRequest charity_req; + const char *charity_name; + + /** + * charity url + */ + const char *charity_url; + + /** + * public key of the charity + */ + struct DONAU_CharityPublicKeyP charity_pub; + + /** + * Max donation amount for this charitiy and @e current_year. + */ + struct TALER_Amount max_per_year; /** * The bearer token for authorization. @@ -91,7 +106,7 @@ charity_post_traits (void *cls, { struct StatusState *ss = cls; struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_charity_pub (&ss->charity_req.charity_pub), + TALER_TESTING_make_trait_charity_pub (&ss->charity_pub), TALER_TESTING_make_trait_charity_id (&ss->charity_id), TALER_TESTING_trait_end () }; @@ -164,13 +179,16 @@ charity_status_run (void *cls, TALER_TESTING_get_trait_merchant_pub (mc, &mpub)); - ss->charity_req.charity_pub.eddsa_pub = mpub->eddsa_pub; + ss->charity_pub.eddsa_pub = mpub->eddsa_pub; } ss->cph = DONAU_charity_post ( TALER_TESTING_interpreter_get_context (is), TALER_TESTING_get_donau_url (is), - &ss->charity_req, + ss->charity_name, + ss->charity_url, + &ss->max_per_year, + &ss->charity_pub, ss->bearer, &charity_status_cb, ss); @@ -203,27 +221,25 @@ cleanup (void *cls, struct TALER_TESTING_Command -TALER_TESTING_cmd_charity_post_merchant (const char *label, - const char *name, - const char *url, - const char *max_per_year, - const char *receipts_to_date, - uint64_t current_year, - const struct DONAU_BearerToken *bearer, - const char *merchant_reference, - unsigned int expected_response_code) +TALER_TESTING_cmd_charity_post_merchant ( + const char *label, + const char *name, + const char *url, + const char *max_per_year, + const struct DONAU_BearerToken *bearer, + const char *merchant_reference, + unsigned int expected_response_code) { struct StatusState *ss; ss = GNUNET_new (struct StatusState); - ss->merchant_reference = merchant_reference; - ss->charity_req.name = name; - ss->charity_req.charity_url = url; + ss->charity_name = name; + ss->charity_url = url; // parse string max_per_year to amount if (GNUNET_OK != TALER_string_to_amount (max_per_year, - &ss->charity_req.max_per_year)) + &ss->max_per_year)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to parse amount `%s' at %s\n", @@ -231,18 +247,6 @@ TALER_TESTING_cmd_charity_post_merchant (const char *label, label); GNUNET_assert (0); } - // parse string receipts_to_date to amount - if (GNUNET_OK != - TALER_string_to_amount (receipts_to_date, - &ss->charity_req.receipts_to_date)) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Failed to parse amount `%s' at %s\n", - receipts_to_date, - label); - GNUNET_assert (0); - } - ss->charity_req.current_year = current_year; ss->expected_response_code = expected_response_code; ss->bearer = bearer; {