diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-post-orders.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-post-orders.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c index 13a21270..fd9c8ce3 100644 --- a/src/backend/taler-merchant-httpd_private-post-orders.c +++ b/src/backend/taler-merchant-httpd_private-post-orders.c @@ -382,7 +382,7 @@ execute_order (struct MHD_Connection *connection, connection, MHD_HTTP_BAD_REQUEST, TALER_EC_PROPOSAL_ORDER_BAD_CURRENCY, - "Total amount must be in currency supported by backend"); + TMH_currency); } if (wire_transfer_deadline.abs_value_us < @@ -453,19 +453,14 @@ execute_order (struct MHD_Connection *connection, else { /* This request is not idempotent */ - MHD_RESULT rv; - char *msg; - - GNUNET_asprintf (&msg, - "order ID `%s' already exists, and the request was not idempotent", - order_id); - rv = TALER_MHD_reply_with_error (connection, - MHD_HTTP_BAD_REQUEST, /* or conflict? */ - TALER_EC_PROPOSAL_STORE_DB_ERROR_ALREADY_EXISTS, - msg); - GNUNET_free (msg); + MHD_RESULT ret; + + ret = TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, /* or conflict? */ + TALER_EC_PROPOSAL_STORE_DB_ERROR_ALREADY_EXISTS, + order_id); GNUNET_JSON_parse_free (spec); - return rv; + return ret; } } } @@ -498,7 +493,7 @@ execute_order (struct MHD_Connection *connection, return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_PROPOSAL_STORE_DB_ERROR_SOFT, - "serialization error, maybe try again?"); + NULL); } /* If we have a product that has insufficient quantities, @@ -536,7 +531,7 @@ execute_order (struct MHD_Connection *connection, connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_PROPOSAL_STORE_DB_ERROR_HARD, - "Failed to store the order in the DB"); + NULL); } /* DB transaction succeeded, generate positive response */ { @@ -604,11 +599,11 @@ patch_order (struct MHD_Connection *connection, tm_info = localtime (&timer); if (NULL == tm_info) { - return TALER_MHD_reply_with_error - (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_PROPOSAL_NO_LOCALTIME, - "failed to determine local time"); + return TALER_MHD_reply_with_error ( + connection, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_PROPOSAL_NO_LOCALTIME, + NULL); } off = strftime (buf, sizeof (buf), @@ -926,7 +921,7 @@ add_payment_details (struct MHD_Connection *connection, return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, TALER_EC_PROPOSAL_INSTANCE_CONFIGURATION_LACKS_WIRE, - "No wire method configured for instance"); + payment_target); } GNUNET_assert (0 == json_object_set_new (order, |