diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-post-orders.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-post-orders.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c index 5473dec4..704c3823 100644 --- a/src/backend/taler-merchant-httpd_private-post-orders.c +++ b/src/backend/taler-merchant-httpd_private-post-orders.c @@ -1608,11 +1608,11 @@ set_token_family (struct OrderContext *oc, } family->slug = slug; + family->name = key_details.token_family.name; family->description = key_details.token_family.description; family->description_i18n = key_details.token_family.description_i18n; GNUNET_free (key_details.token_family.slug); - GNUNET_free (key_details.token_family.name); switch (key_details.token_family.kind) { case TALER_MERCHANTDB_TFK_Subscription: @@ -1647,7 +1647,7 @@ serialize_order (struct OrderContext *oc) const struct TALER_MERCHANTDB_InstanceSettings *settings = &oc->hc->instance->settings; json_t *merchant; - json_t *token_types = json_object (); + json_t *token_families = json_object (); json_t *choices = json_array (); merchant = GNUNET_JSON_PACK ( @@ -1697,13 +1697,11 @@ serialize_order (struct OrderContext *oc) for (unsigned int i = 0; i<oc->parse_choices.token_families_len; i++) { json_t *keys = json_array(); - enum GNUNET_CRYPTO_BlindSignatureAlgorithm cipher = GNUNET_CRYPTO_BSA_INVALID; struct TALER_MerchantContractTokenFamily *family = &oc->parse_choices.token_families[i]; for (unsigned int j = 0; j<family->keys_len; j++) { struct TALER_MerchantContractTokenFamilyKey key = family->keys[j]; - cipher = key.pub.public_key->cipher; json_t *jkey = GNUNET_JSON_PACK ( GNUNET_JSON_pack_data_auto ("h_pub", @@ -1713,7 +1711,9 @@ serialize_order (struct OrderContext *oc) key.pub.public_key->details.rsa_public_key)), // GNUNET_JSON_pack_allow_null( // GNUNET_JSON_pack_data_auto ("cs_pub", - // &key.pub.public_key.details.cs_public_key)), + // &key.pub.public_key->details.cs_public_key)), + GNUNET_JSON_pack_int64 ("cipher", + key.pub.public_key->cipher), GNUNET_JSON_pack_timestamp ("valid_after", key.valid_after), GNUNET_JSON_pack_timestamp ("valid_before", @@ -1723,22 +1723,24 @@ serialize_order (struct OrderContext *oc) GNUNET_assert (0 == json_array_append_new (keys, jkey)); } + /* TODO: Add 'details' field. */ json_t *jfamily = GNUNET_JSON_PACK ( + GNUNET_JSON_pack_string ("name", + family->name), GNUNET_JSON_pack_string ("description", family->description), - GNUNET_JSON_pack_int64 ("cipher", - cipher), GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_object_incref ("description_i18n", family->description_i18n)), GNUNET_JSON_pack_array_steal ("keys", - keys) + keys), + GNUNET_JSON_pack_bool ("critical", + family->critical) ); - GNUNET_assert (0 == - json_object_set_new (token_types, - family->slug, - jfamily)); + GNUNET_assert (0 == json_object_set_new (token_families, + family->slug, + jfamily)); } for (unsigned int i = 0; i<oc->parse_choices.choices_len; i++) @@ -1860,8 +1862,8 @@ serialize_order (struct OrderContext *oc) choices) ), GNUNET_JSON_pack_allow_null ( - GNUNET_JSON_pack_object_incref ("token_types", - token_types) + GNUNET_JSON_pack_object_incref ("token_families", + token_families) ), GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_object_incref ("extra", |