aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_purse_create_with_merge.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/exchange_api_purse_create_with_merge.c')
-rw-r--r--src/lib/exchange_api_purse_create_with_merge.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/exchange_api_purse_create_with_merge.c b/src/lib/exchange_api_purse_create_with_merge.c
index 03accce10..dac0eaf5d 100644
--- a/src/lib/exchange_api_purse_create_with_merge.c
+++ b/src/lib/exchange_api_purse_create_with_merge.c
@@ -297,6 +297,31 @@ TALER_EXCHANGE_purse_create_with_merge (
&contract_pub.ecdhe_pub);
// FIXME: extract min_age from contract_terms!
+ {
+ // FIXME: extract amount from contract
+ // or pass explicitly? what about other
+ // args, like the purse expiration time?
+ struct GNUNET_JSON_Specification spec[] = {
+ TALER_JSON_spec_amount_any ("amount",
+ &pcm->purse_value_after_fees),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_uint32 ("minimum_age",
+ &min_age),
+ NULL),
+ GNUNET_JSON_spec_end ()
+ };
+
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (contract_terms,
+ spec,
+ NULL, NULL))
+ {
+ GNUNET_break (0);
+ GNUNET_free (pcm);
+ return NULL;
+ }
+ }
+
GNUNET_assert (GNUNET_YES ==
TEAH_handle_is_ready (exchange));