summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-post-orders.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-post-orders.c')
-rw-r--r--src/backend/taler-merchant-httpd_private-post-orders.c56
1 files changed, 9 insertions, 47 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c
index 63eff40e..8a0ca347 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -335,6 +335,7 @@ execute_order (struct MHD_Connection *connection,
struct GNUNET_TIME_Absolute pay_deadline;
struct GNUNET_JSON_Specification spec[] = {
TALER_JSON_spec_amount ("amount",
+ TMH_currency,
&total),
GNUNET_JSON_spec_string ("order_id",
&order_id),
@@ -375,18 +376,6 @@ execute_order (struct MHD_Connection *connection,
: MHD_NO;
}
}
- if (0 !=
- strcasecmp (total.currency,
- TMH_currency))
- {
- GNUNET_break_op (0);
- GNUNET_JSON_parse_free (spec);
- return TALER_MHD_reply_with_error (
- connection,
- MHD_HTTP_CONFLICT,
- TALER_EC_GENERIC_CURRENCY_MISMATCH,
- TMH_currency);
- }
/* check product list in contract is well-formed */
if (GNUNET_OK != check_products (products))
@@ -671,9 +660,11 @@ patch_order (struct MHD_Connection *connection,
&wire_deadline)),
GNUNET_JSON_spec_mark_optional (
TALER_JSON_spec_amount ("max_fee",
+ TMH_currency,
&max_fee)),
GNUNET_JSON_spec_mark_optional (
TALER_JSON_spec_amount ("max_wire_fee",
+ TMH_currency,
&max_wire_fee)),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_uint32 ("wire_fee_amortization",
@@ -888,24 +879,10 @@ patch_order (struct MHD_Connection *connection,
TALER_amount_is_valid (&max_wire_fee))
{
GNUNET_assert (0 ==
- json_object_set_new (order,
- "max_wire_fee",
- TALER_JSON_from_amount
- (&settings->default_max_wire_fee)));
- }
- else
- {
- if (0 !=
- strcasecmp (max_wire_fee.currency,
- TMH_currency))
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (
- connection,
- MHD_HTTP_CONFLICT,
- TALER_EC_GENERIC_CURRENCY_MISMATCH,
- TMH_currency);
- }
+ json_object_set_new (
+ order,
+ "max_wire_fee",
+ TALER_JSON_from_amount (&settings->default_max_wire_fee)));
}
if (GNUNET_OK !=
@@ -918,29 +895,14 @@ patch_order (struct MHD_Connection *connection,
TALER_JSON_from_amount
(&settings->default_max_deposit_fee)));
}
- else
- {
- if (0 !=
- strcasecmp (max_fee.currency,
- TMH_currency))
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (
- connection,
- MHD_HTTP_CONFLICT,
- TALER_EC_GENERIC_CURRENCY_MISMATCH,
- TMH_currency);
- }
- }
-
if (0 == wire_fee_amortization)
{
GNUNET_assert (0 ==
json_object_set_new (
order,
"wire_fee_amortization",
- json_integer
- ((json_int_t) settings->default_wire_fee_amortization)));
+ json_integer (
+ (json_int_t) settings->default_wire_fee_amortization)));
}
if (NULL == merchant_base_url)
{