merchant

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

commit a5b0b6d3de37d2d5940e82c7623486079980f8b9
parent c75ed08b4dbeb70959e10861a7eeb78c545a2fc8
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat,  3 Jun 2023 23:46:30 +0200

address more FIXMEs

Diffstat:
Msrc/backend/taler-merchant-httpd_private-post-orders.c | 42++++--------------------------------------
1 file changed, 4 insertions(+), 38 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c @@ -415,8 +415,6 @@ execute_order (struct OrderContext *oc) const char *fulfillment_msg = NULL; const json_t *products; const json_t *merchant; - const json_t *summary_i18n = NULL; - const json_t *fulfillment_i18n = NULL; struct GNUNET_TIME_Timestamp timestamp; struct GNUNET_TIME_Timestamp refund_deadline = { 0 }; struct GNUNET_TIME_Timestamp wire_transfer_deadline; @@ -426,8 +424,8 @@ execute_order (struct OrderContext *oc) &total), GNUNET_JSON_spec_string ("order_id", &oc->order_id), - GNUNET_JSON_spec_string ("summary", - &summary), + TALER_JSON_spec_i18n_str ("summary", + &summary), /** * The following entries we don't actually need, * except to check that the order is well-formed */ @@ -436,16 +434,8 @@ execute_order (struct OrderContext *oc) GNUNET_JSON_spec_object_const ("merchant", &merchant), GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_object_const ("summary_i18n", - &summary_i18n), - NULL), - GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_string ("fulfillment_message", - &fulfillment_msg), - NULL), - GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_object_const ("fulfillment_message_i18n", - &fulfillment_i18n), + TALER_JSON_spec_i18n_str ("fulfillment_message", + &fulfillment_msg), NULL), GNUNET_JSON_spec_timestamp ("timestamp", &timestamp), @@ -488,30 +478,6 @@ execute_order (struct OrderContext *oc) return; } - // FIXME: we can do this better now... - if ( (NULL != fulfillment_i18n) && - (! TALER_JSON_check_i18n (fulfillment_i18n)) ) - { - GNUNET_break_op (0); - GNUNET_JSON_parse_free (spec); - reply_with_error (oc, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - "order:fulfillment_message_i18n"); - return; - } - if ( (NULL != summary_i18n) && - (! TALER_JSON_check_i18n (summary_i18n)) ) - { - GNUNET_break_op (0); - GNUNET_JSON_parse_free (spec); - reply_with_error (oc, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - "order:summary_i18n"); - return; - } - /* Test if we already have an order with this id */ { struct TALER_ClaimTokenP token;