diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-30 21:23:40 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-30 21:23:40 +0200 |
commit | 577e344b018cf186e179edf8fa56101659e25307 (patch) | |
tree | 5dec709ed9dbdb48346499d64c41d78a447fc48e /src/backend/taler-merchant-httpd_post-orders-ID-pay.c | |
parent | 3f5bc6fa636e278d54f8a17c6f4d4b15cc63608f (diff) |
work on /pay and /abort processing
Diffstat (limited to 'src/backend/taler-merchant-httpd_post-orders-ID-pay.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_post-orders-ID-pay.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c index 8afa41cf..f11154e7 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c @@ -421,6 +421,7 @@ resume_pay_with_response (struct PayContext *pc, unsigned int response_code, struct MHD_Response *response) { + abort_deposit (pc); pc->response_code = response_code; pc->response = response; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -558,9 +559,7 @@ deposit_cb (void *cls, "Deposit operation failed with HTTP code %u/%d\n", hr->http_status, (int) hr->ec); - /* Transaction failed; stop all other ongoing deposits */ - abort_deposit (pc); - + /* Transaction failed */ if (5 == hr->http_status / 100) { /* internal server error at exchange */ @@ -867,7 +866,6 @@ find_next_exchange (struct PayContext *pc) if (! dc->found_in_db) { - TMH_db->preflight (TMH_db->cls); pc->current_exchange = dc->exchange_url; pc->fo = TMH_EXCHANGES_find_exchange (pc->current_exchange, pc->wm->wire_method, @@ -887,7 +885,6 @@ find_next_exchange (struct PayContext *pc) } } pc->current_exchange = NULL; - TMH_db->preflight (TMH_db->cls); /* We are done with all the HTTP requests, go back and try the 'big' database transaction! (It should work now!) */ GNUNET_assert (0 == pc->pending); @@ -1776,14 +1773,12 @@ handle_pay_timeout (void *cls) * @return MHD result code */ MHD_RESULT -MH_handler_pay (struct TMH_RequestHandler *rh, - struct MHD_Connection *connection, - struct TMH_HandlerContext *hc) +TMH_post_orders_ID_pay (const struct TMH_RequestHandler *rh, + struct MHD_Connection *connection, + struct TMH_HandlerContext *hc) { struct PayContext *pc = hc->ctx; - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "In handler for /pay.\n"); if (NULL == pc) { pc = GNUNET_new (struct PayContext); |