summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-07-04 23:21:29 +0200
committerChristian Grothoff <christian@grothoff.org>2023-07-04 23:21:29 +0200
commit207bd07fcd3ab356116c2059f2c019a7d9a4f3b6 (patch)
treeae147ecc22fb1eb2917499fe0105b18968dbdbfb /src/lib
parentae0a2ee80040bb71fd4cc5d6b41d9899b423bc54 (diff)
downloadmerchant-207bd07fcd3ab356116c2059f2c019a7d9a4f3b6.tar.gz
merchant-207bd07fcd3ab356116c2059f2c019a7d9a4f3b6.tar.bz2
merchant-207bd07fcd3ab356116c2059f2c019a7d9a4f3b6.zip
adaptations to latest exchange API
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/merchant_api_post_order_pay.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/lib/merchant_api_post_order_pay.c b/src/lib/merchant_api_post_order_pay.c
index 886d9bd6..e48b7cd3 100644
--- a/src/lib/merchant_api_post_order_pay.c
+++ b/src/lib/merchant_api_post_order_pay.c
@@ -112,7 +112,7 @@ struct TALER_MERCHANT_OrderPayHandle
* Handle to the exchange that issued a problematic
* coin (if any).
*/
- struct TALER_EXCHANGE_Handle *exchange;
+ struct TALER_EXCHANGE_GetKeysHandle *exchange;
/**
* Number of @e coins we are paying with.
@@ -191,16 +191,20 @@ check_conflict (struct TALER_MERCHANT_OrderPayHandle *oph,
*
* @param cls a `struct TALER_MERCHANT_OrderPayHandle`
* @param kr reply from the exchange
+ * @param keys keys of the exchange
*/
static void
cert_cb (void *cls,
- const struct TALER_EXCHANGE_KeysResponse *kr)
+ const struct TALER_EXCHANGE_KeysResponse *kr,
+ struct TALER_EXCHANGE_Keys *keys)
{
struct TALER_MERCHANT_OrderPayHandle *oph = cls;
const struct TALER_EXCHANGE_HttpResponse *ehr = &kr->hr;
+ oph->exchange = NULL;
if ( (MHD_HTTP_OK != ehr->http_status) ||
- (NULL == kr->details.ok.keys) )
+ (NULL == kr->details.ok.keys) ||
+ (NULL == keys) )
{
struct TALER_MERCHANT_PayResponse pr = {
.hr.http_status = MHD_HTTP_CONFLICT,
@@ -230,6 +234,7 @@ cert_cb (void *cls,
oph->pay_cb (oph->pay_cb_cls,
&pr);
TALER_MERCHANT_order_pay_cancel (oph);
+ TALER_EXCHANGE_keys_decref (keys);
return;
}
@@ -246,6 +251,7 @@ cert_cb (void *cls,
oph->pay_cb (oph->pay_cb_cls,
&pr);
TALER_MERCHANT_order_pay_cancel (oph);
+ TALER_EXCHANGE_keys_decref (keys);
return;
}
@@ -259,6 +265,7 @@ cert_cb (void *cls,
oph->pay_cb (oph->pay_cb_cls,
&pr);
TALER_MERCHANT_order_pay_cancel (oph);
+ TALER_EXCHANGE_keys_decref (keys);
}
}
@@ -350,11 +357,11 @@ parse_conflict (struct TALER_MERCHANT_OrderPayHandle *oph,
{
oph->error_pc = &oph->coins[i];
oph->full_reply = json_incref ((json_t *) json);
- oph->exchange = TALER_EXCHANGE_connect (oph->ctx,
- oph->error_pc->exchange_url,
- &cert_cb,
- oph,
- TALER_EXCHANGE_OPTION_END);
+ oph->exchange = TALER_EXCHANGE_get_keys (oph->ctx,
+ oph->error_pc->exchange_url,
+ NULL,
+ &cert_cb,
+ oph);
return GNUNET_NO;
}
}
@@ -814,7 +821,7 @@ TALER_MERCHANT_order_pay_cancel (struct TALER_MERCHANT_OrderPayHandle *oph)
}
if (NULL != oph->exchange)
{
- TALER_EXCHANGE_disconnect (oph->exchange);
+ TALER_EXCHANGE_get_keys_cancel (oph->exchange);
oph->exchange = NULL;
}
TALER_curl_easy_post_finished (&oph->post_ctx);