merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 3c01b3c1d930b61b87053f623beff982042d0ad5
parent 5e1d3d01a3fdbff3d8583c6d3281bdd7171af1d2
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 26 May 2021 09:39:59 +0200

log exchange status code if operation fails with bad gateway

Diffstat:
Msrc/lib/merchant_api_post_transfers.c | 33+++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+), 0 deletions(-)

diff --git a/src/lib/merchant_api_post_transfers.c b/src/lib/merchant_api_post_transfers.c @@ -209,6 +209,39 @@ handle_post_transfers_finished (void *cls, hr.ec = TALER_JSON_get_error_code (json); hr.hint = TALER_JSON_get_error_hint (json); break; + case MHD_HTTP_BAD_GATEWAY: + /* Exchange had an issue; we should retry, but this API + leaves this to the application */ + hr.ec = TALER_JSON_get_error_code (json); + hr.hint = TALER_JSON_get_error_hint (json); + { + uint32_t eec; + uint32_t ehc; + struct GNUNET_JSON_Specification ispec[] = { + GNUNET_JSON_spec_uint32 ("exchange_code", + &eec), + GNUNET_JSON_spec_uint32 ("exchange_http_status", + &ehc), + GNUNET_JSON_spec_end () + }; + + if (GNUNET_OK != + GNUNET_JSON_parse (deposit_sum, + ispec, + NULL, NULL)) + { + GNUNET_break_op (0); + break; + } + else + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Exchange returned %u/%u\n", + (unsigned int) eec, + (unsigned int) ehc); + } + } + break; case MHD_HTTP_GATEWAY_TIMEOUT: /* Server had an internal issue; we should retry, but this API leaves this to the application */