diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2022-03-29 15:21:49 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2022-03-29 15:21:49 +0200 |
commit | 074ea7502e93b290f9300974f5a349a8de4f4753 (patch) | |
tree | a37f6f2c3125cc828de8fb4bc5d09100df49148e /src/exchange/taler-exchange-httpd_refund.c | |
parent | 3249687b2a25c728b3b86ffc099c682bfed9c145 (diff) | |
download | exchange-074ea7502e93b290f9300974f5a349a8de4f4753.tar.gz exchange-074ea7502e93b290f9300974f5a349a8de4f4753.tar.bz2 exchange-074ea7502e93b290f9300974f5a349a8de4f4753.zip |
centralize exchange online signature logic
Diffstat (limited to 'src/exchange/taler-exchange-httpd_refund.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_refund.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/exchange/taler-exchange-httpd_refund.c b/src/exchange/taler-exchange-httpd_refund.c index 84b60bcdb..3718fdedf 100644 --- a/src/exchange/taler-exchange-httpd_refund.c +++ b/src/exchange/taler-exchange-httpd_refund.c @@ -50,22 +50,18 @@ reply_refund_success (struct MHD_Connection *connection, { struct TALER_ExchangePublicKeyP pub; struct TALER_ExchangeSignatureP sig; - struct TALER_RefundConfirmationPS rc = { - .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND), - .purpose.size = htonl (sizeof (rc)), - .h_contract_terms = refund->h_contract_terms, - .coin_pub = *coin_pub, - .merchant = refund->merchant_pub, - .rtransaction_id = GNUNET_htonll (refund->rtransaction_id) - }; enum TALER_ErrorCode ec; - TALER_amount_hton (&rc.refund_amount, - &refund->refund_amount); if (TALER_EC_NONE != - (ec = TEH_keys_exchange_sign (&rc, - &pub, - &sig))) + (ec = TALER_exchange_online_refund_confirmation_sign ( + &TEH_keys_exchange_sign_, + &refund->h_contract_terms, + coin_pub, + &refund->merchant_pub, + refund->rtransaction_id, + &refund->refund_amount, + &pub, + &sig))) { return TALER_MHD_reply_with_ec (connection, ec, |