diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_post-orders-ID-pay.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_post-orders-ID-pay.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c index a709b3e3..4626e3d2 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c @@ -576,7 +576,8 @@ deposit_cb (void *cls, TALER_MHD_make_json_pack ( "{s:s, s:I, s:I, s:I}", "hint", - "exchange had an internal server error", + TALER_ErrorCode_get_hint ( + TALER_EC_PAY_EXCHANGE_FAILED), "code", (json_int_t) TALER_EC_PAY_EXCHANGE_FAILED, "exchange_code", @@ -593,7 +594,8 @@ deposit_cb (void *cls, TALER_MHD_make_json_pack ( "{s:s, s:I, s:I, s:I}", "hint", - "exchange failed, response body not even in JSON", + TALER_ErrorCode_get_hint ( + TALER_EC_PAY_EXCHANGE_REPLY_MALFORMED), "code", (json_int_t) TALER_EC_PAY_EXCHANGE_REPLY_MALFORMED, "exchange_code", @@ -611,7 +613,8 @@ deposit_cb (void *cls, MHD_HTTP_CONFLICT, TALER_MHD_make_json_pack ("{s:s, s:I, s:I, s:I, s:o, s:O}", "hint", - "exchange failed on deposit of a coin", + TALER_ErrorCode_get_hint ( + TALER_EC_PAY_INSUFFICIENT_FUNDS), "code", (json_int_t) TALER_EC_PAY_INSUFFICIENT_FUNDS, "exchange_code", @@ -628,7 +631,8 @@ deposit_cb (void *cls, MHD_HTTP_FAILED_DEPENDENCY, TALER_MHD_make_json_pack ("{s:s, s:I, s:I, s:I, s:o, s:O}", "hint", - "exchange failed on deposit of a coin", + TALER_ErrorCode_get_hint ( + TALER_EC_PAY_EXCHANGE_FAILED), "code", (json_int_t) TALER_EC_PAY_EXCHANGE_FAILED, "exchange_code", @@ -729,7 +733,8 @@ process_pay_with_exchange (void *cls, ? "{s:s, s:I, s:I, s:I, s:O}" : "{s:s, s:I, s:I, s:I}", "hint", - "failed to obtain meta-data from exchange", + TALER_ErrorCode_get_hint ( + TALER_EC_PAY_EXCHANGE_KEYS_FAILURE), "code", (json_int_t) TALER_EC_PAY_EXCHANGE_KEYS_FAILURE, "exchange_http_status", @@ -793,7 +798,9 @@ process_pay_with_exchange (void *cls, MHD_HTTP_FAILED_DEPENDENCY, TALER_MHD_make_json_pack ( "{s:s, s:I, s:o, s:o}", - "hint", "coin's denomination not found", + "hint", + TALER_ErrorCode_get_hint ( + TALER_EC_PAY_DENOMINATION_KEY_NOT_FOUND), "code", TALER_EC_PAY_DENOMINATION_KEY_NOT_FOUND, "h_denom_pub", GNUNET_JSON_from_data_auto (&dc->h_denom), "exchange_keys", TALER_EXCHANGE_get_keys_raw (exchange_handle))); @@ -812,7 +819,7 @@ process_pay_with_exchange (void *cls, TALER_MHD_make_json_pack ( "{s:s, s:I, s:o}", "hint", - "denomination not accepted", + TALER_ErrorCode_get_hint (ec), "code", (json_int_t) ec, "h_denom_pub", @@ -851,7 +858,8 @@ process_pay_with_exchange (void *cls, MHD_HTTP_FORBIDDEN, TALER_MHD_make_json_pack ( "{s:s, s:I, s:i}", - "hint", "deposit signature invalid", + "hint", + TALER_ErrorCode_get_hint (TALER_EC_PAY_COIN_SIGNATURE_INVALID), "code", (json_int_t) TALER_EC_PAY_COIN_SIGNATURE_INVALID, "coin_idx", i)); return; @@ -1631,7 +1639,7 @@ parse_pay (struct MHD_Connection *connection, TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_PAY_DB_FETCH_PAY_ERROR, - "Failed to obtain contract terms from DB")) + NULL)) ? GNUNET_NO : GNUNET_SYSERR; } @@ -1641,7 +1649,7 @@ parse_pay (struct MHD_Connection *connection, TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, TALER_EC_PAY_PROPOSAL_NOT_FOUND, - "Proposal not found")) + pc->order_id)) ? GNUNET_NO : GNUNET_SYSERR; } @@ -1657,7 +1665,7 @@ parse_pay (struct MHD_Connection *connection, TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_PAY_FAILED_COMPUTE_PROPOSAL_HASH, - "Failed to hash contract terms")) + NULL)) ? GNUNET_NO : GNUNET_SYSERR; } @@ -1677,7 +1685,7 @@ parse_pay (struct MHD_Connection *connection, TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_PAY_MERCHANT_FIELD_MISSING, - "No merchant field in proposal")) + NULL)) ? GNUNET_NO : GNUNET_SYSERR; } @@ -1726,7 +1734,7 @@ parse_pay (struct MHD_Connection *connection, return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_PAY_REFUND_DEADLINE_PAST_WIRE_TRANSFER_DEADLINE, - "refund deadline after wire transfer deadline"); + NULL); } if (pc->pay_deadline.abs_value_us < @@ -1737,7 +1745,7 @@ parse_pay (struct MHD_Connection *connection, TALER_MHD_reply_with_error (connection, MHD_HTTP_GONE, TALER_EC_PAY_OFFER_EXPIRED, - "We are past the payment deadline")) + NULL)) ? GNUNET_NO : GNUNET_SYSERR; } @@ -1757,7 +1765,7 @@ parse_pay (struct MHD_Connection *connection, return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_PAY_WIRE_HASH_UNKNOWN, - "Did not find matching wire details"); + NULL); } pc->wm = wm; } |