aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_deposit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/exchange_api_deposit.c')
-rw-r--r--src/lib/exchange_api_deposit.c57
1 files changed, 24 insertions, 33 deletions
diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c
index 792920c17..f22ae0df7 100644
--- a/src/lib/exchange_api_deposit.c
+++ b/src/lib/exchange_api_deposit.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of TALER 2 This file is part of TALER
3 Copyright (C) 2014-2020 Taler Systems SA 3 Copyright (C) 2014-2021 Taler Systems SA
4 4
5 TALER is free software; you can redistribute it and/or modify it under the 5 TALER is free software; you can redistribute it and/or modify it under the
6 terms of the GNU General Public License as published by the Free Software 6 terms of the GNU General Public License as published by the Free Software
@@ -663,38 +663,29 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
663 return NULL; 663 return NULL;
664 } 664 }
665 665
666 deposit_obj = json_pack ("{s:o, s:O," /* f/wire */ 666 deposit_obj = GNUNET_JSON_PACK (
667 " s:o, s:o," /* h_wire, h_contract_terms */ 667 TALER_JSON_pack_amount ("contribution",
668 " s:o," /* denom_pub */ 668 amount),
669 " s:o, s:o," /* ub_sig, timestamp */ 669 GNUNET_JSON_pack_object_incref ("wire",
670 " s:o," /* merchant_pub */ 670 wire_details),
671 " s:o, s:o," /* refund_deadline, wire_deadline */ 671 GNUNET_JSON_pack_data_auto ("h_wire",
672 " s:o}", /* coin_sig */ 672 &h_wire),
673 "contribution", TALER_JSON_from_amount (amount), 673 GNUNET_JSON_pack_data_auto ("h_contract_terms",
674 "wire", wire_details, 674 h_contract_terms),
675 "h_wire", GNUNET_JSON_from_data_auto (&h_wire), 675 GNUNET_JSON_pack_data_auto ("denom_pub_hash",
676 "h_contract_terms", GNUNET_JSON_from_data_auto ( 676 &denom_pub_hash),
677 h_contract_terms), 677 TALER_JSON_pack_denomination_signature ("ub_sig",
678 "denom_pub_hash", GNUNET_JSON_from_data_auto ( 678 denom_sig),
679 &denom_pub_hash), 679 GNUNET_JSON_pack_time_abs ("timestamp",
680 "ub_sig", GNUNET_JSON_from_rsa_signature ( 680 timestamp),
681 denom_sig->rsa_signature), 681 GNUNET_JSON_pack_data_auto ("merchant_pub",
682 "timestamp", GNUNET_JSON_from_time_abs (timestamp), 682 merchant_pub),
683 "merchant_pub", GNUNET_JSON_from_data_auto ( 683 GNUNET_JSON_pack_time_abs ("refund_deadline",
684 merchant_pub), 684 refund_deadline),
685 "refund_deadline", GNUNET_JSON_from_time_abs ( 685 GNUNET_JSON_pack_time_abs ("wire_transfer_deadline",
686 refund_deadline), 686 wire_deadline),
687 "wire_transfer_deadline", GNUNET_JSON_from_time_abs ( 687 GNUNET_JSON_pack_data_auto ("coin_sig",
688 wire_deadline), 688 coin_sig));
689 "coin_sig", GNUNET_JSON_from_data_auto (coin_sig)
690 );
691 if (NULL == deposit_obj)
692 {
693 *ec = TALER_EC_GENERIC_JSON_ALLOCATION_FAILURE;
694 GNUNET_break (0);
695 return NULL;
696 }
697
698 dh = GNUNET_new (struct TALER_EXCHANGE_DepositHandle); 689 dh = GNUNET_new (struct TALER_EXCHANGE_DepositHandle);
699 dh->auditor_chance = AUDITOR_CHANCE; 690 dh->auditor_chance = AUDITOR_CHANCE;
700 dh->exchange = exchange; 691 dh->exchange = exchange;