diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_contract.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_contract.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/backend/taler-merchant-httpd_contract.c b/src/backend/taler-merchant-httpd_contract.c index 14acda2d..6072a7d1 100644 --- a/src/backend/taler-merchant-httpd_contract.c +++ b/src/backend/taler-merchant-httpd_contract.c @@ -21,6 +21,7 @@ #include "platform.h" #include <jansson.h> #include <taler/taler_signatures.h> +#include <taler/taler_json_lib.h> #include "taler-merchant-httpd.h" #include "taler-merchant-httpd_parsing.h" #include "taler-merchant-httpd_auditors.h" @@ -63,11 +64,11 @@ MH_handler_contract (struct TMH_RequestHandler *rh, struct TALER_Amount total; struct TALER_Amount max_fee; uint64_t transaction_id; - struct TMH_PARSE_FieldSpecification spec[] = { - TMH_PARSE_member_amount ("amount", &total), - TMH_PARSE_member_amount ("max_fee", &max_fee), - TMH_PARSE_member_uint64 ("transaction_id", &transaction_id), - TMH_PARSE_MEMBER_END + struct GNUNET_JSON_Specification spec[] = { + TALER_JSON_spec_amount ("amount", &total), + TALER_JSON_spec_amount ("max_fee", &max_fee), + GNUNET_JSON_spec_uint64 ("transaction_id", &transaction_id), + GNUNET_JSON_spec_end() }; if (NULL == *connection_cls) @@ -118,16 +119,16 @@ MH_handler_contract (struct TMH_RequestHandler *rh, j_auditors); json_object_set_new (jcontract, "H_wire", - TALER_json_from_data (&h_wire, + GNUNET_JSON_from_data (&h_wire, sizeof (h_wire))); json_object_set_new (jcontract, "merchant_pub", - TALER_json_from_data (&pubkey, + GNUNET_JSON_from_data (&pubkey, sizeof (pubkey))); /* create contract signature */ GNUNET_assert (GNUNET_OK == - TALER_hash_json (jcontract, + TALER_JSON_hash (jcontract, &contract.h_contract)); contract.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_CONTRACT); contract.purpose.size = htonl (sizeof (contract)); @@ -145,9 +146,9 @@ MH_handler_contract (struct TMH_RequestHandler *rh, MHD_HTTP_OK, "{s:O, s:O, s:O}", "contract", jcontract, - "merchant_sig", TALER_json_from_data (&contract_sig, + "merchant_sig", GNUNET_JSON_from_data (&contract_sig, sizeof (contract_sig)), - "H_contract", TALER_json_from_data (&contract.h_contract, + "H_contract", GNUNET_JSON_from_data (&contract.h_contract, sizeof (contract.h_contract))); json_decref (root); return res; |