From b93fba2cc1fca4cb1d0bfd1954b324c99e8ec23a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 12 Apr 2020 20:46:33 +0200 Subject: API updates and new error codes for merchant implementation of #6173 --- src/include/taler_error_codes.h | 34 ++++++++++++++++++++++++++-------- src/lib/exchange_api_withdraw.c | 2 +- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/include/taler_error_codes.h b/src/include/taler_error_codes.h index 2134e68d5..10ad555a3 100644 --- a/src/include/taler_error_codes.h +++ b/src/include/taler_error_codes.h @@ -1792,6 +1792,12 @@ enum TALER_ErrorCode */ TALER_EC_TIP_QUERY_INSTANCE_DOES_NOT_TIP = 2719, + /** + * The tip id is unknown. This could happen if the tip id is wrong or + * the tip authorization expired. + */ + TALER_EC_TIP_QUERY_TIP_ID_UNKNOWN = 2720, + /** * The backend had trouble accessing the database to persist * information about enabling tips. Returned with an HTTP status code @@ -1834,14 +1840,14 @@ enum TALER_ErrorCode /** * We failed to contact the exchange to obtain the denomination keys. - * Returned with a response code "failed dependency" (424). + * Returned with a response code #MHD_HTTP_FAILED_DEPENDENCY. */ TALER_EC_TIP_PICKUP_EXCHANGE_DOWN = 2805, /** * We contacted the exchange to obtain any denomination keys, but got - * no valid keys. Returned with a response code "failed dependency" - * (424). + * no valid keys. Returned with a response code + * #MHD_HTTP_FAILED_DEPENDENCY. */ TALER_EC_TIP_PICKUP_EXCHANGE_LACKED_KEYS = 2806, @@ -1854,21 +1860,33 @@ enum TALER_ErrorCode /** * We encountered an arithmetic issue totaling up the amount to - * withdraw. Returned with a response code of "bad request". + * withdraw. Returned with a response code of #MHD_HTTP_BAD_REQUEST. */ TALER_EC_TIP_PICKUP_EXCHANGE_AMOUNT_OVERFLOW = 2808, /** * The number of planchets specified exceeded the limit. Returned with - * a response code of "bad request". + * a response code of #MHD_HTTP_BAD_REQUEST. */ TALER_EC_TIP_PICKUP_EXCHANGE_TOO_MANY_PLANCHETS = 2809, /** - * The tip id is unknown. This could happen if the tip id is wrong or - * the tip authorization expired. + * The merchant failed to initialize the withdraw operaiton. Returned + * with a response code of #MHD_HTTP_INTERNAL_SERVER_ERROR. + */ + TALER_EC_TIP_PICKUP_WITHDRAW_FAILED = 2810, + + /** + * The merchant failed to initialize the withdraw operaiton. Returned + * with a response code of #MHD_HTTP_FAILED_DEPENDENCY. + */ + TALER_EC_TIP_PICKUP_WITHDRAW_FAILED_AT_EXCHANGE = 2811, + + /** + * The client failed to unblind the signature returned by the + * merchant. Generated client-side. */ - TALER_EC_TIP_QUERY_TIP_ID_UNKNOWN = 2810, + TALER_EC_TIP_PICKUP_UNBLIND_FAILURE = 2812, /** * We failed to contract terms from our merchant database. The diff --git a/src/lib/exchange_api_withdraw.c b/src/lib/exchange_api_withdraw.c index 6b20fb84f..88b0b1f63 100644 --- a/src/lib/exchange_api_withdraw.c +++ b/src/lib/exchange_api_withdraw.c @@ -175,7 +175,7 @@ TALER_EXCHANGE_withdraw ( &wh->c_hash, &pd)) { - GNUNET_break_op (0); + GNUNET_break (0); GNUNET_free (wh); return NULL; } -- cgit v1.2.3