diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-12 16:02:00 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-12 16:02:00 +0200 |
commit | a0dd3ef13d1dc5bca5af600eec7ed928526e2bf4 (patch) | |
tree | f4540f54bac463e03e0781fa0f6e77d65ee532e1 /src/backend/taler-merchant-httpd_pay.c | |
parent | 4f02377b85e748b2c6e73834cda554e92f95e993 (diff) | |
download | merchant-a0dd3ef13d1dc5bca5af600eec7ed928526e2bf4.tar.gz merchant-a0dd3ef13d1dc5bca5af600eec7ed928526e2bf4.tar.bz2 merchant-a0dd3ef13d1dc5bca5af600eec7ed928526e2bf4.zip |
fix tip pickup MHD suspend/resume handling, code cleanup: use struct TALER_EXCHANGE_HttpResponse where appropriate
Diffstat (limited to 'src/backend/taler-merchant-httpd_pay.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_pay.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/backend/taler-merchant-httpd_pay.c b/src/backend/taler-merchant-httpd_pay.c index 446320b3..7a1b7fd8 100644 --- a/src/backend/taler-merchant-httpd_pay.c +++ b/src/backend/taler-merchant-httpd_pay.c @@ -1078,31 +1078,26 @@ deposit_cb (void *cls, * Function called with the result of our exchange lookup. * * @param cls the `struct PayContext` + * @param hr HTTP response details * @param mh NULL if exchange was not found to be acceptable * @param wire_fee current applicable fee for dealing with @a mh, * NULL if not available * @param exchange_trusted #GNUNET_YES if this exchange is * trusted by config - * @param ec error code, #TALER_EC_NONE on success - * @param http_status the HTTP status we got from the exchange - * @param error_reply the full reply from the exchange, NULL if - * the response was NOT in JSON or on success */ static void process_pay_with_exchange (void *cls, + const struct TALER_EXCHANGE_HttpResponse *hr, struct TALER_EXCHANGE_Handle *mh, const struct TALER_Amount *wire_fee, - int exchange_trusted, - enum TALER_ErrorCode ec, - unsigned int http_status, - const json_t *error_reply) + int exchange_trusted) { struct PayContext *pc = cls; const struct TALER_EXCHANGE_Keys *keys; pc->fo = NULL; GNUNET_assert (GNUNET_YES == pc->suspended); - if (MHD_HTTP_OK != http_status) + if (MHD_HTTP_OK != hr->http_status) { /* The request failed somehow */ GNUNET_break_op (0); @@ -1110,7 +1105,7 @@ process_pay_with_exchange (void *cls, pc, MHD_HTTP_FAILED_DEPENDENCY, TALER_MHD_make_json_pack ( - (NULL != error_reply) + (NULL != hr->reply) ? "{s:s, s:I, s:I, s:I, s:O}" : "{s:s, s:I, s:I, s:I}", "hint", @@ -1118,11 +1113,11 @@ process_pay_with_exchange (void *cls, "code", (json_int_t) TALER_EC_PAY_EXCHANGE_KEYS_FAILURE, "exchange_http_status", - (json_int_t) http_status, + (json_int_t) hr->http_status, "exchange_code", - (json_int_t) ec, + (json_int_t) hr->ec, "exchange_reply", - error_reply)); + hr->reply)); return; } pc->mh = mh; |