exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 887a01dc8c1ac7200413e2999a1f98c285284ecd
parent 3200ddc5e81a2bc0f08d254caf66d15b78dbcff6
Author: bohdan-potuzhnyi <bohdan.potuzhnyi@gmail.com>
Date:   Sun, 12 Jul 2026 19:54:21 +0200

update GANA DD96 mixed payments

Diffstat:
Msrc/include/taler/taler_error_codes.h | 57+++++++++++++++++++++++++++++++++++++++++++++++++--------
Msrc/util/taler_error_codes.c | 58+++++++++++++++++++++++++++++++++++++++++++++++++---------
2 files changed, 98 insertions(+), 17 deletions(-)

diff --git a/src/include/taler/taler_error_codes.h b/src/include/taler/taler_error_codes.h @@ -3446,8 +3446,8 @@ enum TALER_ErrorCode * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). * (A value of 0 indicates that the error is generated client-side). */ - TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_INSTANCE_CONFIGURATION_LACKS_WIRE = 2500 - , + TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_INSTANCE_CONFIGURATION_LACKS_WIRE = + 2500, /** @@ -3584,8 +3584,8 @@ enum TALER_ErrorCode * Returned with an HTTP status code of #MHD_HTTP_GONE (410). * (A value of 0 indicates that the error is generated client-side). */ - TALER_EC_MERCHANT_PRIVATE_GET_STATISTICS_REPORT_GRANULARITY_UNAVAILABLE = 2525 - , + TALER_EC_MERCHANT_PRIVATE_GET_STATISTICS_REPORT_GRANULARITY_UNAVAILABLE = + 2525, /** @@ -3609,8 +3609,8 @@ enum TALER_ErrorCode * Returned with an HTTP status code of #MHD_HTTP_FORBIDDEN (403). * (A value of 0 indicates that the error is generated client-side). */ - TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_NOT_ALLOWED_BY_CONTRACT = 2532 - , + TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_NOT_ALLOWED_BY_CONTRACT = + 2532, /** @@ -3630,6 +3630,39 @@ enum TALER_ErrorCode /** + * The order cannot be collected by the backend as it is not a genuinely free Taler payment: the Taler amount is not zero, or the selected choice has token inputs or outputs and thus requires a customer wallet. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ID_COLLECT_NOT_FREE = 2535, + + + /** + * The order cannot be collected by the backend as it was already claimed by a customer wallet. The wallet owns the order and must execute the free payment itself. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ID_COLLECT_ALREADY_CLAIMED = 2536, + + + /** + * The order provided to the backend could not be deleted as it has payments that were settled outside of Taler. Deletion requires an explicit force operation. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_MERCHANT_PRIVATE_DELETE_ORDERS_EXTERNALLY_PAID = 2537, + + + /** + * The external refund could not be recorded as the cumulative externally refunded amount would exceed the full order total minus the amount already refunded through Taler. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_EXTERNAL_INCONSISTENT_AMOUNT = + 2538, + + + /** * The exchange says it does not know this transfer. * Returned with an HTTP status code of #MHD_HTTP_BAD_GATEWAY (502). * (A value of 0 indicates that the error is generated client-side). @@ -4546,7 +4579,7 @@ enum TALER_ErrorCode /** * The provided signature is invalid. - * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * Returned with an HTTP status code of #MHD_HTTP_FORBIDDEN (403). * (A value of 0 indicates that the error is generated client-side). */ TALER_EC_BANK_BAD_SIGNATURE = 5160, @@ -5089,6 +5122,14 @@ enum TALER_ErrorCode /** + * The wallet's balance for paying a merchant is insufficient. + * Returned with an HTTP status code of #MHD_HTTP_UNINITIALIZED (0). + * (A value of 0 indicates that the error is generated client-side). + */ + TALER_EC_WALLET_PAY_MERCHANT_INSUFFICIENT_BALANCE = 7050, + + + /** * We encountered a timeout with our payment backend. * Returned with an HTTP status code of #MHD_HTTP_GATEWAY_TIMEOUT (504). * (A value of 0 indicates that the error is generated client-side). @@ -5730,7 +5771,7 @@ enum TALER_ErrorCode /** * The donation unit is not yet valid. The client should repeat the request in the future when it might succeed. - * Returned with an HTTP status code of #MHD_HTTP_TOO_MANY_REQUESTS (429). + * Returned with an HTTP status code of #MHD_HTTP_TOO_EARLY (425). * (A value of 0 indicates that the error is generated client-side). */ TALER_EC_DONAU_GENERIC_DONATION_UNIT_TOO_EARLY = 8620, diff --git a/src/util/taler_error_codes.c b/src/util/taler_error_codes.c @@ -2916,8 +2916,8 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { { /* 2166 */ - .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_WIRE_FEE_ADDITION_FAILED - , + .ec = + TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_WIRE_FEE_ADDITION_FAILED, .hint = "The exchange of the deposited coin charges a wire fee that could not be added to the total (total amount too high).", .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR @@ -3133,8 +3133,8 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { { /* 2254 */ - .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_ABORT_REFUND_REFUSED_PAYMENT_COMPLETE - , + .ec = + TALER_EC_MERCHANT_POST_ORDERS_ID_ABORT_REFUND_REFUSED_PAYMENT_COMPLETE, .hint = "The payment was already completed and thus cannot be aborted anymore.", .http_code = MHD_HTTP_PRECONDITION_FAILED @@ -3401,8 +3401,8 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { { /* 2510 */ - .ec = TALER_EC_MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_SYNTAX_INCORRECT - , + .ec = + TALER_EC_MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_SYNTAX_INCORRECT, .hint = "One of the paths to forget is malformed.", .http_code = MHD_HTTP_BAD_REQUEST }, @@ -3506,6 +3506,39 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { }, { + /* 2535 */ + .ec = TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ID_COLLECT_NOT_FREE, + .hint = + "The order cannot be collected by the backend as it is not a genuinely free Taler payment: the Taler amount is not zero, or the selected choice has token inputs or outputs and thus requires a customer wallet.", + .http_code = MHD_HTTP_CONFLICT + }, + + { + /* 2536 */ + .ec = TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ID_COLLECT_ALREADY_CLAIMED, + .hint = + "The order cannot be collected by the backend as it was already claimed by a customer wallet. The wallet owns the order and must execute the free payment itself.", + .http_code = MHD_HTTP_CONFLICT + }, + + { + /* 2537 */ + .ec = TALER_EC_MERCHANT_PRIVATE_DELETE_ORDERS_EXTERNALLY_PAID, + .hint = + "The order provided to the backend could not be deleted as it has payments that were settled outside of Taler. Deletion requires an explicit force operation.", + .http_code = MHD_HTTP_CONFLICT + }, + + { + /* 2538 */ + .ec = + TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_EXTERNAL_INCONSISTENT_AMOUNT, + .hint = + "The external refund could not be recorded as the cumulative externally refunded amount would exceed the full order total minus the amount already refunded through Taler.", + .http_code = MHD_HTTP_CONFLICT + }, + + { /* 2550 */ .ec = TALER_EC_MERCHANT_PRIVATE_POST_TRANSFERS_EXCHANGE_UNKNOWN, .hint = "The exchange says it does not know this transfer.", @@ -4381,7 +4414,7 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { /* 5160 */ .ec = TALER_EC_BANK_BAD_SIGNATURE, .hint = "The provided signature is invalid.", - .http_code = MHD_HTTP_CONFLICT + .http_code = MHD_HTTP_FORBIDDEN }, { @@ -4895,6 +4928,13 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { }, { + /* 7050 */ + .ec = TALER_EC_WALLET_PAY_MERCHANT_INSUFFICIENT_BALANCE, + .hint = "The wallet's balance for paying a merchant is insufficient.", + .http_code = MHD_HTTP_UNINITIALIZED + }, + + { /* 8000 */ .ec = TALER_EC_ANASTASIS_GENERIC_BACKEND_TIMEOUT, .hint = "We encountered a timeout with our payment backend.", @@ -5492,7 +5532,7 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { .ec = TALER_EC_DONAU_GENERIC_DONATION_UNIT_TOO_EARLY, .hint = "The donation unit is not yet valid. The client should repeat the request in the future when it might succeed.", - .http_code = MHD_HTTP_TOO_MANY_REQUESTS + .http_code = MHD_HTTP_TOO_EARLY }, { @@ -5713,7 +5753,7 @@ static const struct ErrorCodeAndHint code_hint_pairs[] = { /** * The length of @e code_hint_pairs. */ -static const unsigned int code_hint_pairs_length = 738; +static const unsigned int code_hint_pairs_length = 743; const char *