From c98d960d1badd1eeb834bacbc133960e2f86d304 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 22 Aug 2023 23:15:08 +0200 Subject: add currency to amounts in merchant DB --- src/lib/merchant_api_get_instance.c | 37 +++++++++++++++++------------------ src/lib/merchant_api_patch_instance.c | 12 +++--------- src/lib/merchant_api_post_instances.c | 12 +++--------- 3 files changed, 24 insertions(+), 37 deletions(-) (limited to 'src/lib') diff --git a/src/lib/merchant_api_get_instance.c b/src/lib/merchant_api_get_instance.c index cf58f828..9cfbcf83 100644 --- a/src/lib/merchant_api_get_instance.c +++ b/src/lib/merchant_api_get_instance.c @@ -98,28 +98,27 @@ handle_get_instance_finished (void *cls, const json_t *address; const json_t *jurisdiction; struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_array_const ("accounts", - &accounts), - GNUNET_JSON_spec_string ("name", - &igr.details.ok.details.name), - GNUNET_JSON_spec_string ("user_type", - &uts), + GNUNET_JSON_spec_array_const ( + "accounts", + &accounts), + GNUNET_JSON_spec_string ( + "name", + &igr.details.ok.details.name), + GNUNET_JSON_spec_string ( + "user_type", + &uts), GNUNET_JSON_spec_fixed_auto ( "merchant_pub", &igr.details.ok.details.merchant_pub), - GNUNET_JSON_spec_object_const ("address", - &address), - GNUNET_JSON_spec_object_const ("jurisdiction", - &jurisdiction), - TALER_JSON_spec_amount_any ( - "default_max_wire_fee", - &igr.details.ok.details.default_max_wire_fee), - GNUNET_JSON_spec_uint32 ( - "default_wire_fee_amortization", - &igr.details.ok.details.default_wire_fee_amortization), - TALER_JSON_spec_amount_any ( - "default_max_deposit_fee", - &igr.details.ok.details.default_max_deposit_fee), + GNUNET_JSON_spec_object_const ( + "address", + &address), + GNUNET_JSON_spec_object_const ( + "jurisdiction", + &jurisdiction), + GNUNET_JSON_spec_bool ( + "use_stefan", + &igr.details.ok.details.use_stefan), GNUNET_JSON_spec_relative_time ( "default_wire_transfer_delay", &igr.details.ok.details.default_wire_transfer_delay), diff --git a/src/lib/merchant_api_patch_instance.c b/src/lib/merchant_api_patch_instance.c index 6a3c06c1..8b4b6205 100644 --- a/src/lib/merchant_api_patch_instance.c +++ b/src/lib/merchant_api_patch_instance.c @@ -164,9 +164,7 @@ TALER_MERCHANT_instance_patch ( enum TALER_KYCLOGIC_KycUserType ut, const json_t *address, const json_t *jurisdiction, - const struct TALER_Amount *default_max_wire_fee, - uint32_t default_wire_fee_amortization, - const struct TALER_Amount *default_max_deposit_fee, + bool use_stefan, struct GNUNET_TIME_Relative default_wire_transfer_delay, struct GNUNET_TIME_Relative default_pay_delay, TALER_MERCHANT_InstancePatchCallback cb, @@ -229,12 +227,8 @@ TALER_MERCHANT_instance_patch ( (json_t *) address), GNUNET_JSON_pack_object_incref ("jurisdiction", (json_t *) jurisdiction), - TALER_JSON_pack_amount ("default_max_wire_fee", - default_max_wire_fee), - GNUNET_JSON_pack_uint64 ("default_wire_fee_amortization", - default_wire_fee_amortization), - TALER_JSON_pack_amount ("default_max_deposit_fee", - default_max_deposit_fee), + GNUNET_JSON_pack_bool ("use_stefan", + use_stefan), GNUNET_JSON_pack_time_rel ("default_wire_transfer_delay", default_wire_transfer_delay), GNUNET_JSON_pack_time_rel ("default_pay_delay", diff --git a/src/lib/merchant_api_post_instances.c b/src/lib/merchant_api_post_instances.c index 77168e2a..77336187 100644 --- a/src/lib/merchant_api_post_instances.c +++ b/src/lib/merchant_api_post_instances.c @@ -170,9 +170,7 @@ TALER_MERCHANT_instances_post ( enum TALER_KYCLOGIC_KycUserType ut, const json_t *address, const json_t *jurisdiction, - const struct TALER_Amount *default_max_wire_fee, - uint32_t default_wire_fee_amortization, - const struct TALER_Amount *default_max_deposit_fee, + bool use_stefan, struct GNUNET_TIME_Relative default_wire_transfer_delay, struct GNUNET_TIME_Relative default_pay_delay, const char *auth_token, @@ -267,12 +265,8 @@ TALER_MERCHANT_instances_post ( (json_t *) address), GNUNET_JSON_pack_object_incref ("jurisdiction", (json_t *) jurisdiction), - TALER_JSON_pack_amount ("default_max_wire_fee", - default_max_wire_fee), - GNUNET_JSON_pack_uint64 ("default_wire_fee_amortization", - default_wire_fee_amortization), - TALER_JSON_pack_amount ("default_max_deposit_fee", - default_max_deposit_fee), + GNUNET_JSON_pack_bool ("use_stefan", + use_stefan), GNUNET_JSON_pack_time_rel ("default_wire_transfer_delay", default_wire_transfer_delay), GNUNET_JSON_pack_time_rel ("default_pay_delay", -- cgit v1.2.3