diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-09-11 15:32:48 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-09-11 15:32:48 +0200 |
commit | e002253231d1179332e725a2694fdbd8676203ae (patch) | |
tree | 654d9d0b3c3193222532ea7e0c000b8be5ef47a5 /src/lib | |
parent | 2547740f84390e7ecf9fe6db01f843b2feb1c421 (diff) | |
download | merchant-e002253231d1179332e725a2694fdbd8676203ae.tar.gz merchant-e002253231d1179332e725a2694fdbd8676203ae.tar.bz2 merchant-e002253231d1179332e725a2694fdbd8676203ae.zip |
add wallet_data support to merchant
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/merchant_api_post_order_paid.c | 4 | ||||
-rw-r--r-- | src/lib/merchant_api_post_order_pay.c | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/merchant_api_post_order_paid.c b/src/lib/merchant_api_post_order_paid.c index a483ba41..785d956f 100644 --- a/src/lib/merchant_api_post_order_paid.c +++ b/src/lib/merchant_api_post_order_paid.c @@ -188,6 +188,7 @@ TALER_MERCHANT_order_paid ( const char *order_id, const char *session_id, const struct TALER_PrivateContractHashP *h_contract_terms, + const struct GNUNET_HashCode *wallet_data_hash, const struct TALER_MerchantSignatureP *merchant_sig, TALER_MERCHANT_OrderPaidCallback paid_cb, void *paid_cb_cls) @@ -200,6 +201,9 @@ TALER_MERCHANT_order_paid ( merchant_sig), GNUNET_JSON_pack_data_auto ("h_contract", h_contract_terms), + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_data_auto ("wallet_data_hash", + wallet_data_hash)), GNUNET_JSON_pack_string ("session_id", session_id)); oph = GNUNET_new (struct TALER_MERCHANT_OrderPaidHandle); diff --git a/src/lib/merchant_api_post_order_pay.c b/src/lib/merchant_api_post_order_pay.c index 24c1cf61..fc2e9a29 100644 --- a/src/lib/merchant_api_post_order_pay.c +++ b/src/lib/merchant_api_post_order_pay.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2021 Taler Systems SA + Copyright (C) 2014-2023 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -576,6 +576,7 @@ TALER_MERCHANT_order_pay_frontend ( const char *merchant_url, const char *order_id, const char *session_id, + const json_t *wallet_data, unsigned int num_coins, const struct TALER_MERCHANT_PaidCoin coins[static num_coins], TALER_MERCHANT_OrderPayCallback pay_cb, @@ -666,6 +667,9 @@ TALER_MERCHANT_order_pay_frontend ( GNUNET_JSON_pack_array_steal ("coins", j_coins), GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_object_incref ("wallet_data", + (json_t *) wallet_data)), + GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_string ("session_id", session_id))); @@ -728,6 +732,7 @@ TALER_MERCHANT_order_pay ( const char *merchant_url, const char *session_id, const struct TALER_PrivateContractHashP *h_contract_terms, + const json_t *wallet_data, const struct TALER_Amount *amount, const struct TALER_Amount *max_fee, const struct TALER_MerchantPublicKeyP *merchant_pub, @@ -776,6 +781,7 @@ TALER_MERCHANT_order_pay ( &fee, h_wire, h_contract_terms, + NULL /* FIXME: compute using wallet_data */, coin->h_age_commitment, NULL /* h_extensions! */, &h_denom_pub, @@ -800,6 +806,7 @@ TALER_MERCHANT_order_pay ( merchant_url, order_id, session_id, + wallet_data, num_coins, pc, pay_cb, |