handle error code returned by TALER_amount_subtract in new error case TALER_EC_PAYBACK_COIN_BALANCE_NEGATIVE
This commit is contained in:
parent
46c7647b27
commit
e6d09d2568
@ -2402,9 +2402,19 @@ TEH_DB_execute_payback (struct MHD_Connection *connection,
|
||||
return TEH_RESPONSE_reply_internal_db_error (connection,
|
||||
TALER_EC_PAYBACK_HISTORY_DB_ERROR);
|
||||
}
|
||||
if (GNUNET_SYSERR ==
|
||||
TALER_amount_subtract (&amount,
|
||||
value,
|
||||
&spent);
|
||||
&spent))
|
||||
{
|
||||
GNUNET_break (0);
|
||||
TEH_plugin->rollback (TEH_plugin->cls,
|
||||
session);
|
||||
TEH_plugin->free_coin_transaction_list (TEH_plugin->cls,
|
||||
tl);
|
||||
return TEH_RESPONSE_reply_internal_db_error (connection,
|
||||
TALER_EC_PAYBACK_COIN_BALANCE_NEGATIVE);
|
||||
}
|
||||
if ( (0 == amount.fraction) &&
|
||||
(0 == amount.value) )
|
||||
{
|
||||
|
@ -896,6 +896,13 @@ enum TALER_ErrorCode
|
||||
*/
|
||||
TALER_EC_PAYBACK_BLINDING_FAILED = 1858,
|
||||
|
||||
/**
|
||||
* The coin's remaining balance is zero. The request is denied.
|
||||
* This response is provided with an HTTP status code of
|
||||
* MHD_HTTP_INTERNAL_SERVER_ERROR
|
||||
*/
|
||||
TALER_EC_PAYBACK_COIN_BALANCE_NEGATIVE = 1857,
|
||||
|
||||
|
||||
|
||||
/* *********** Merchant backend error codes ********* */
|
||||
|
Loading…
Reference in New Issue
Block a user