summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-06-25 19:10:35 +0200
committerChristian Grothoff <christian@grothoff.org>2023-06-25 19:10:35 +0200
commit53fa3aeb17b60ed130d9095f977660efb223a297 (patch)
tree5afac0aa94b1e49b8121260c19fe872c130f6ff1 /src/backend/taler-merchant-httpd_post-orders-ID-abort.c
parent0d8aeec575f6e12bb06a5eedeabf70436058595a (diff)
downloadmerchant-53fa3aeb17b60ed130d9095f977660efb223a297.tar.gz
merchant-53fa3aeb17b60ed130d9095f977660efb223a297.tar.bz2
merchant-53fa3aeb17b60ed130d9095f977660efb223a297.zip
adapt to latest exchange API changes
Diffstat (limited to 'src/backend/taler-merchant-httpd_post-orders-ID-abort.c')
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-abort.c52
1 files changed, 18 insertions, 34 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-abort.c b/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
index 5361496d..f5d76436 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
@@ -176,7 +176,7 @@ struct AbortContext
* the exchange used for this transaction; NULL if no operation is
* pending.
*/
- struct TMH_EXCHANGES_FindOperation *fo;
+ struct TMH_EXCHANGES_Find2Operation *fo;
/**
* URL of the exchange used for the last @e fo.
@@ -438,7 +438,7 @@ abort_context_cleanup (void *cls)
GNUNET_free (ac->rd);
if (NULL != ac->fo)
{
- TMH_EXCHANGES_find_exchange_cancel (ac->fo);
+ TMH_EXCHANGES_keys4exchange_cancel (ac->fo);
ac->fo = NULL;
}
if (NULL != ac->response)
@@ -496,22 +496,17 @@ refund_cb (void *cls,
* Function called with the result of our exchange lookup.
*
* @param cls the `struct AbortContext`
- * @param hr HTTP response details
- * @param exchange_handle NULL if exchange was not found to be acceptable
- * @param ih internal handle to the exchange
+ * @param keys keys of the exchange
*/
static void
process_abort_with_exchange (void *cls,
- const struct TALER_EXCHANGE_HttpResponse *hr,
- struct TALER_EXCHANGE_Handle *exchange_handle,
- struct TMH_Exchange *ih)
+ struct TALER_EXCHANGE_Keys *keys)
{
struct AbortContext *ac = cls;
- (void) ih;
ac->fo = NULL;
GNUNET_assert (GNUNET_YES == ac->suspended);
- if (NULL == hr)
+ if (NULL == keys)
{
resume_abort_with_response (
ac,
@@ -521,19 +516,6 @@ process_abort_with_exchange (void *cls,
NULL));
return;
}
- if (NULL == exchange_handle)
- {
- /* The request failed somehow */
- GNUNET_break_op (0);
- resume_abort_with_response (
- ac,
- MHD_HTTP_BAD_GATEWAY,
- TALER_MHD_MAKE_JSON_PACK (
- TALER_JSON_pack_ec (
- TALER_EC_MERCHANT_GENERIC_EXCHANGE_CONNECT_FAILURE),
- TMH_pack_exchange_reply (hr)));
- return;
- }
/* Initiate refund operation for all coins of
the current exchange (!) */
GNUNET_assert (0 == ac->pending_at_ce);
@@ -549,14 +531,17 @@ process_abort_with_exchange (void *cls,
continue;
rdi->processed = true;
ac->pending--;
- rdi->rh = TALER_EXCHANGE_refund (exchange_handle,
- &rdi->amount_with_fee,
- &ac->h_contract_terms,
- &rdi->coin_pub,
- 0, /* rtransaction_id */
- &ac->hc->instance->merchant_priv,
- &refund_cb,
- rdi);
+ rdi->rh = TALER_EXCHANGE_refund (
+ merchant_curl_ctx,
+ ac->current_exchange,
+ keys,
+ &rdi->amount_with_fee,
+ &ac->h_contract_terms,
+ &rdi->coin_pub,
+ 0, /* rtransaction_id */
+ &ac->hc->instance->merchant_priv,
+ &refund_cb,
+ rdi);
if (NULL == rdi->rh)
{
GNUNET_break_op (0);
@@ -598,8 +583,7 @@ find_next_exchange (struct AbortContext *ac)
if (! rdi->processed)
{
ac->current_exchange = rdi->exchange_url;
- ac->fo = TMH_EXCHANGES_find_exchange (ac->current_exchange,
- false,
+ ac->fo = TMH_EXCHANGES_keys4exchange (ac->current_exchange,
&process_abort_with_exchange,
ac);
if (NULL == ac->fo)
@@ -944,7 +928,7 @@ handle_abort_timeout (void *cls)
"Resuming abort with error after timeout\n");
if (NULL != ac->fo)
{
- TMH_EXCHANGES_find_exchange_cancel (ac->fo);
+ TMH_EXCHANGES_keys4exchange_cancel (ac->fo);
ac->fo = NULL;
}
resume_abort_with_error (ac,