diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-01-06 15:58:12 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-01-06 15:58:12 +0100 |
commit | 59971311ab1440dde3fda023ebf2c1281f8e9efe (patch) | |
tree | 8ad3670745d4cdc7094d73ef6249ca233fd75705 /src | |
parent | e961d5cdb3ca139361a47e626ddef8dba109a195 (diff) | |
parent | 78ca59fd71dbf50165ce120a2d4fd333a2a4fe7d (diff) |
Merge branch 'master' of git+ssh://git.taler.net/merchant
Diffstat (limited to 'src')
48 files changed, 80 insertions, 91 deletions
diff --git a/src/backend/taler-merchant-httpd_post-using-templates.h b/src/backend/taler-merchant-httpd_post-using-templates.h index 7d875bc6..5087da67 100644 --- a/src/backend/taler-merchant-httpd_post-using-templates.h +++ b/src/backend/taler-merchant-httpd_post-using-templates.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2014, 2015, 2019 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-delete-templates-ID.c b/src/backend/taler-merchant-httpd_private-delete-templates-ID.c index 94667567..0c2570fa 100644 --- a/src/backend/taler-merchant-httpd_private-delete-templates-ID.c +++ b/src/backend/taler-merchant-httpd_private-delete-templates-ID.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-delete-templates-ID.h b/src/backend/taler-merchant-httpd_private-delete-templates-ID.h index ec90a90d..aa7adc4b 100644 --- a/src/backend/taler-merchant-httpd_private-delete-templates-ID.h +++ b/src/backend/taler-merchant-httpd_private-delete-templates-ID.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2019, 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-delete-webhooks-ID.c b/src/backend/taler-merchant-httpd_private-delete-webhooks-ID.c index adf34ad8..e8e2d283 100644 --- a/src/backend/taler-merchant-httpd_private-delete-webhooks-ID.c +++ b/src/backend/taler-merchant-httpd_private-delete-webhooks-ID.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-delete-webhooks-ID.h b/src/backend/taler-merchant-httpd_private-delete-webhooks-ID.h index ba77fb7a..caf7caba 100644 --- a/src/backend/taler-merchant-httpd_private-delete-webhooks-ID.h +++ b/src/backend/taler-merchant-httpd_private-delete-webhooks-ID.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2019, 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-get-templates-ID.c b/src/backend/taler-merchant-httpd_private-get-templates-ID.c index be5359f8..953582ca 100644 --- a/src/backend/taler-merchant-httpd_private-get-templates-ID.c +++ b/src/backend/taler-merchant-httpd_private-get-templates-ID.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2019, 2020, 2021 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-get-templates-ID.h b/src/backend/taler-merchant-httpd_private-get-templates-ID.h index b16207d5..cf5e4d83 100644 --- a/src/backend/taler-merchant-httpd_private-get-templates-ID.h +++ b/src/backend/taler-merchant-httpd_private-get-templates-ID.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2019, 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-get-templates.c b/src/backend/taler-merchant-httpd_private-get-templates.c index 86237f07..43af09a2 100644 --- a/src/backend/taler-merchant-httpd_private-get-templates.c +++ b/src/backend/taler-merchant-httpd_private-get-templates.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2019, 2020, 2021 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-get-templates.h b/src/backend/taler-merchant-httpd_private-get-templates.h index 3194d1c7..b5b5f025 100644 --- a/src/backend/taler-merchant-httpd_private-get-templates.h +++ b/src/backend/taler-merchant-httpd_private-get-templates.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2019, 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-get-webhooks-ID.c b/src/backend/taler-merchant-httpd_private-get-webhooks-ID.c index 2780d145..94371e9e 100644 --- a/src/backend/taler-merchant-httpd_private-get-webhooks-ID.c +++ b/src/backend/taler-merchant-httpd_private-get-webhooks-ID.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2019, 2020, 2021 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-get-webhooks-ID.h b/src/backend/taler-merchant-httpd_private-get-webhooks-ID.h index 261edb41..7b876c57 100644 --- a/src/backend/taler-merchant-httpd_private-get-webhooks-ID.h +++ b/src/backend/taler-merchant-httpd_private-get-webhooks-ID.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2019, 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-get-webhooks.c b/src/backend/taler-merchant-httpd_private-get-webhooks.c index cda4eda9..dad39efb 100644 --- a/src/backend/taler-merchant-httpd_private-get-webhooks.c +++ b/src/backend/taler-merchant-httpd_private-get-webhooks.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2019, 2020, 2021 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-get-webhooks.h b/src/backend/taler-merchant-httpd_private-get-webhooks.h index 297e5ace..196891d5 100644 --- a/src/backend/taler-merchant-httpd_private-get-webhooks.h +++ b/src/backend/taler-merchant-httpd_private-get-webhooks.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2019, 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/backend/taler-merchant-httpd_private-patch-templates-ID.c b/src/backend/taler-merchant-httpd_private-patch-templates-ID.c index 9494d506..6cd060f0 100644 --- a/src/backend/taler-merchant-httpd_private-patch-templates-ID.c +++ b/src/backend/taler-merchant-httpd_private-patch-templates-ID.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -116,10 +116,8 @@ TMH_private_patch_templates_ID (const struct TMH_RequestHandler *rh, GNUNET_JSON_spec_string ("image", (const char **) &tp.image), NULL), - GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_json ("template_contract", - &tp.template_contract), - NULL), + GNUNET_JSON_spec_json ("template_contract", + &tp.template_contract), GNUNET_JSON_spec_end () }; @@ -148,8 +146,6 @@ TMH_private_patch_templates_ID (const struct TMH_RequestHandler *rh, } - if (NULL == tp.image) - tp.image = ""; if (! TMH_image_data_url_valid (tp.image)) { GNUNET_break_op (0); diff --git a/src/backend/taler-merchant-httpd_private-patch-templates-ID.h b/src/backend/taler-merchant-httpd_private-patch-templates-ID.h index 80347cf8..29cf4830 100644 --- a/src/backend/taler-merchant-httpd_private-patch-templates-ID.h +++ b/src/backend/taler-merchant-httpd_private-patch-templates-ID.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.c b/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.c index 3144687b..d84a888c 100644 --- a/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.c +++ b/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.h b/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.h index c393b284..38404012 100644 --- a/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.h +++ b/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/backend/taler-merchant-httpd_private-post-templates.c b/src/backend/taler-merchant-httpd_private-post-templates.c index 136f0891..8377b034 100644 --- a/src/backend/taler-merchant-httpd_private-post-templates.c +++ b/src/backend/taler-merchant-httpd_private-post-templates.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/backend/taler-merchant-httpd_private-post-templates.h b/src/backend/taler-merchant-httpd_private-post-templates.h index fc946e46..c3a7f741 100644 --- a/src/backend/taler-merchant-httpd_private-post-templates.h +++ b/src/backend/taler-merchant-httpd_private-post-templates.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/backend/taler-merchant-httpd_private-post-webhooks.c b/src/backend/taler-merchant-httpd_private-post-webhooks.c index 57fa3a65..48f6e7fb 100644 --- a/src/backend/taler-merchant-httpd_private-post-webhooks.c +++ b/src/backend/taler-merchant-httpd_private-post-webhooks.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/backend/taler-merchant-httpd_private-post-webhooks.h b/src/backend/taler-merchant-httpd_private-post-webhooks.h index 24a7ccd4..fd73c9e7 100644 --- a/src/backend/taler-merchant-httpd_private-post-webhooks.h +++ b/src/backend/taler-merchant-httpd_private-post-webhooks.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2020 Taler Systems SA + (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/backenddb/merchant-0004.sql b/src/backenddb/merchant-0004.sql index cd7ecece..93a03dae 100644 --- a/src/backenddb/merchant-0004.sql +++ b/src/backenddb/merchant-0004.sql @@ -1,6 +1,6 @@ -- -- This file is part of TALER --- Copyright (C) 2021 Taler Systems SA +-- Copyright (C) 2022-2023 Taler Systems SA -- -- TALER is free software; you can redistribute it and/or modify it under the -- terms of the GNU General Public License as published by the Free Software @@ -46,22 +46,7 @@ COMMENT ON COLUMN merchant_template.image IS 'NOT NULL, but can be 0 bytes; must contain an ImageDataUrl'; COMMENT ON COLUMN merchant_template.template_contract IS 'The template contract will contains some additional information.'; - -/* -CREATE TABLE IF NOT EXISTS merchant_using_template - (template_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY - ,merchant_serial BIGINT NOT NULL - REFERENCES merchant_instances (nerchant_serial) ON DELETE CASCADE - ,summary VERCHAR NOT - ,amount_val INT8 NOT NULL - ,amount_frac INT4 NOT NULL - ,UNIQUE (merchant_serial, template_id) - COMMENT ON TABLE merchant_using_template - IS 'template used by the curstomer (may be incomplete, frontend can override)'; - COMMENT ON COLUMN merchant_usign_template.summary - IS 'Human-readable summary'; -COMMENT ON COLUMN merchant_using_template.amount_val - IS 'Overall amoount that need to pay';*/ + CREATE TABLE IF NOT EXISTS merchant_webhook (webhook_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY @@ -99,8 +84,8 @@ CREATE TABLE IF NOT EXISTS merchant_pending_webhooks ,next_attempt INT8 NOT NULL DEFAULT(0) ,url VARCHAR NOT NULL ,http_method VARCHAR NOT NULL - ,header VARCHAR - ,body VARCHAR + ,header VARCHAR + ,body VARCHAR ,UNIQUE (merchant_serial, webhook_pending_serial) ); COMMENT ON TABLE merchant_pending_webhooks diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c index b1f2942a..b52f058b 100644 --- a/src/backenddb/plugin_merchantdb_postgres.c +++ b/src/backenddb/plugin_merchantdb_postgres.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2014--2021 Taler Systems SA + (C) 2014--2023 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h index b5dae98f..37c7f56e 100644 --- a/src/include/taler_merchant_service.h +++ b/src/include/taler_merchant_service.h @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2021 Taler Systems SA + Copyright (C) 2014-2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h index baaa4c1a..c805afba 100644 --- a/src/include/taler_merchant_testing_lib.h +++ b/src/include/taler_merchant_testing_lib.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2018-2021 Taler Systems SA + (C) 2018-2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as diff --git a/src/lib/merchant_api_common.c b/src/lib/merchant_api_common.c index 9060d05c..7c0918f9 100644 --- a/src/lib/merchant_api_common.c +++ b/src/lib/merchant_api_common.c @@ -378,9 +378,10 @@ TALER_MERCHANT_parse_refund_uri_free ( * Function called when we're done processing the * HTTP POST /using-template request to create an order. * - * @param cls the `struct TALER_MERCHANT_PostOrdersHandle or TALER_MERCHANT_UsingTemplatesPostHandle` + * @param cb_cls closure + * @param cb callback * @param response_code HTTP response code, 0 on error - * @param response response body, NULL if not JSON + * @param json for reply */ void TALER_MERCHANT_handle_post_using_templates_create_order (void *cb_cls, diff --git a/src/lib/merchant_api_delete_template.c b/src/lib/merchant_api_delete_template.c index cf49eb4b..0a5924aa 100644 --- a/src/lib/merchant_api_delete_template.c +++ b/src/lib/merchant_api_delete_template.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2018, 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software diff --git a/src/lib/merchant_api_delete_webhook.c b/src/lib/merchant_api_delete_webhook.c index c0b83798..14ecdcd1 100644 --- a/src/lib/merchant_api_delete_webhook.c +++ b/src/lib/merchant_api_delete_webhook.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2018, 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software diff --git a/src/lib/merchant_api_get_template.c b/src/lib/merchant_api_get_template.c index bced4097..920333b6 100644 --- a/src/lib/merchant_api_get_template.c +++ b/src/lib/merchant_api_get_template.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2018, 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software @@ -93,7 +93,7 @@ handle_get_template_finished (void *cls, case MHD_HTTP_OK: { const char *template_description; - const char *image = NULL; + const char *image; json_t *template_contract; bool rst_ok = true; struct GNUNET_JSON_Specification spec[] = { diff --git a/src/lib/merchant_api_get_templates.c b/src/lib/merchant_api_get_templates.c index 2dca928f..cff408e4 100644 --- a/src/lib/merchant_api_get_templates.c +++ b/src/lib/merchant_api_get_templates.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2018, 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software diff --git a/src/lib/merchant_api_get_webhook.c b/src/lib/merchant_api_get_webhook.c index 84df5211..0e9abc6f 100644 --- a/src/lib/merchant_api_get_webhook.c +++ b/src/lib/merchant_api_get_webhook.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2018, 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software diff --git a/src/lib/merchant_api_get_webhooks.c b/src/lib/merchant_api_get_webhooks.c index f5c211cf..f5ba6f41 100644 --- a/src/lib/merchant_api_get_webhooks.c +++ b/src/lib/merchant_api_get_webhooks.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2018, 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software diff --git a/src/lib/merchant_api_patch_template.c b/src/lib/merchant_api_patch_template.c index da3af08b..3f5027c8 100644 --- a/src/lib/merchant_api_patch_template.c +++ b/src/lib/merchant_api_patch_template.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020, 2021 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -172,8 +172,9 @@ TALER_MERCHANT_template_patch ( req_obj = GNUNET_JSON_PACK ( GNUNET_JSON_pack_string ("template_description", template_description), - GNUNET_JSON_pack_string ("image", - image), + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_string ("image", + image)), GNUNET_JSON_pack_object_incref ("template_contract", (json_t *) template_contract)); tph = GNUNET_new (struct TALER_MERCHANT_TemplatePatchHandle); diff --git a/src/lib/merchant_api_patch_webhook.c b/src/lib/merchant_api_patch_webhook.c index 279a536f..9bb17cc0 100644 --- a/src/lib/merchant_api_patch_webhook.c +++ b/src/lib/merchant_api_patch_webhook.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020, 2021 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/src/lib/merchant_api_post_templates.c b/src/lib/merchant_api_post_templates.c index eb6c0d20..87b252f1 100644 --- a/src/lib/merchant_api_post_templates.c +++ b/src/lib/merchant_api_post_templates.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020-2021 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/src/lib/merchant_api_post_webhooks.c b/src/lib/merchant_api_post_webhooks.c index d2d4b09d..2a31006c 100644 --- a/src/lib/merchant_api_post_webhooks.c +++ b/src/lib/merchant_api_post_webhooks.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020-2021 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c index 591a2c8f..a04bbe57 100644 --- a/src/testing/test_merchant_api.c +++ b/src/testing/test_merchant_api.c @@ -1334,9 +1334,10 @@ run (void *cls, "template-2", "another template", "data:image/jpeg;base64,RAWDATA", - json_pack ("{s:s}", - "summary", - "my new summary"), + GNUNET_JSON_PACK ( + GNUNET_JSON_pack_uint64 ("minimum_age", 0), + GNUNET_JSON_pack_time_rel ("pay_duration", + GNUNET_TIME_UNIT_MINUTES)), MHD_HTTP_NO_CONTENT), TALER_TESTING_cmd_merchant_get_template ("get-template-t2", merchant_url, @@ -1354,9 +1355,10 @@ run (void *cls, "template-3", "updated template", "data:image/jpeg;base64,RAWDATA", - json_pack ("{s:s}", - "summary", - "my new summary"), + GNUNET_JSON_PACK ( + GNUNET_JSON_pack_uint64 ("minimum_age", 0), + GNUNET_JSON_pack_time_rel ("pay_duration", + GNUNET_TIME_UNIT_MINUTES)), MHD_HTTP_NOT_FOUND), TALER_TESTING_cmd_merchant_post_templates2 ( "post-templates-t3-amount", @@ -1364,41 +1366,44 @@ run (void *cls, "template-amount", "a different template with an amount", NULL, - json_pack ("{s:s}", - "amount", - "EUR:4"), + GNUNET_JSON_PACK ( + GNUNET_JSON_pack_uint64 ("minimum_age", 0), + GNUNET_JSON_pack_time_rel ("pay_duration", + GNUNET_TIME_UNIT_MINUTES), + GNUNET_JSON_pack_string ("amount", + "EUR:4")), MHD_HTTP_NO_CONTENT), TALER_TESTING_cmd_merchant_post_using_templates ( "using-templates-t1", - "template-1", + "post-templates-t1", merchant_url, "summary-1", "EUR:10", MHD_HTTP_OK), TALER_TESTING_cmd_merchant_post_using_templates ( "using-templates-t1-amount-missing", - "template-1", + "post-templates-t1", merchant_url, "summary-1", NULL, MHD_HTTP_CONFLICT), TALER_TESTING_cmd_merchant_post_using_templates ( "using-templates-t1-summary-missing", - "template-1", + "post-templates-t1", merchant_url, NULL, "EUR:10", MHD_HTTP_CONFLICT), TALER_TESTING_cmd_merchant_post_using_templates ( "using-templates-t1-amount-conflict", - "template-amount", + "post-templates-t3-amount", merchant_url, "summary-1", "EUR:10", MHD_HTTP_CONFLICT), TALER_TESTING_cmd_merchant_post_using_templates ( "using-templates-t1-amount-duplicate", - "template-amount", + "post-templates-t3-amount", merchant_url, "summary-1", "EUR:4", diff --git a/src/testing/testing_api_cmd_delete_template.c b/src/testing/testing_api_cmd_delete_template.c index a9f94557..dd2d38c8 100644 --- a/src/testing/testing_api_cmd_delete_template.c +++ b/src/testing/testing_api_cmd_delete_template.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as diff --git a/src/testing/testing_api_cmd_delete_webhook.c b/src/testing/testing_api_cmd_delete_webhook.c index d8711598..d1060226 100644 --- a/src/testing/testing_api_cmd_delete_webhook.c +++ b/src/testing/testing_api_cmd_delete_webhook.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as diff --git a/src/testing/testing_api_cmd_get_template.c b/src/testing/testing_api_cmd_get_template.c index 2f0f882a..bd9afff3 100644 --- a/src/testing/testing_api_cmd_get_template.c +++ b/src/testing/testing_api_cmd_get_template.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -133,7 +133,9 @@ get_template_cb (void *cls, *expected_image)) ) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Template image does not match\n"); + "Template image `%s' does not match `%s'\n", + image, + *expected_image); TALER_TESTING_interpreter_fail (gis->is); return; } diff --git a/src/testing/testing_api_cmd_get_templates.c b/src/testing/testing_api_cmd_get_templates.c index ed10d63a..3e9d59c6 100644 --- a/src/testing/testing_api_cmd_get_templates.c +++ b/src/testing/testing_api_cmd_get_templates.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as diff --git a/src/testing/testing_api_cmd_get_webhook.c b/src/testing/testing_api_cmd_get_webhook.c index 9a5648db..7acc344e 100644 --- a/src/testing/testing_api_cmd_get_webhook.c +++ b/src/testing/testing_api_cmd_get_webhook.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as diff --git a/src/testing/testing_api_cmd_get_webhooks.c b/src/testing/testing_api_cmd_get_webhooks.c index 6fca66e2..536512aa 100644 --- a/src/testing/testing_api_cmd_get_webhooks.c +++ b/src/testing/testing_api_cmd_get_webhooks.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as diff --git a/src/testing/testing_api_cmd_patch_template.c b/src/testing/testing_api_cmd_patch_template.c index 68b5cbaa..a2a75b89 100644 --- a/src/testing/testing_api_cmd_patch_template.c +++ b/src/testing/testing_api_cmd_patch_template.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -224,7 +224,7 @@ TALER_TESTING_cmd_merchant_patch_template ( pis->template_id = template_id; pis->http_status = http_status; pis->template_description = template_description; - pis->image = GNUNET_strdup (image); + pis->image = (NULL == image) ? NULL : GNUNET_strdup (image); pis->template_contract = template_contract; /* ownership taken */ { struct TALER_TESTING_Command cmd = { diff --git a/src/testing/testing_api_cmd_patch_webhook.c b/src/testing/testing_api_cmd_patch_webhook.c index c11c7fd0..a2fea433 100644 --- a/src/testing/testing_api_cmd_patch_webhook.c +++ b/src/testing/testing_api_cmd_patch_webhook.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as diff --git a/src/testing/testing_api_cmd_post_templates.c b/src/testing/testing_api_cmd_post_templates.c index b7b79b5b..32b8d627 100644 --- a/src/testing/testing_api_cmd_post_templates.c +++ b/src/testing/testing_api_cmd_post_templates.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as diff --git a/src/testing/testing_api_cmd_post_using_templates.c b/src/testing/testing_api_cmd_post_using_templates.c index 026d460a..55065e34 100644 --- a/src/testing/testing_api_cmd_post_using_templates.c +++ b/src/testing/testing_api_cmd_post_using_templates.c @@ -97,7 +97,6 @@ post_using_templates_cb (void *cls, switch (hr->http_status) { case MHD_HTTP_OK: - // FIXME: check reply! break; case MHD_HTTP_CONFLICT: break; diff --git a/src/testing/testing_api_cmd_post_webhooks.c b/src/testing/testing_api_cmd_post_webhooks.c index 83dafa58..d1628429 100644 --- a/src/testing/testing_api_cmd_post_webhooks.c +++ b/src/testing/testing_api_cmd_post_webhooks.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020 Taler Systems SA + Copyright (C) 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as |