diff options
Diffstat (limited to 'src/backend')
3 files changed, 55 insertions, 48 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-claim.c b/src/backend/taler-merchant-httpd_post-orders-ID-claim.c index c806390a..91a16814 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-claim.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-claim.c @@ -172,8 +172,9 @@ claim_order (const char *instance_id, qs = TMH_db->insert_contract_terms (TMH_db->cls, instance_id, order_id, - *contract_terms); - if (0 > qs) + *contract_terms, + &order_serial); + if (0 >= qs) { TMH_db->rollback (TMH_db->cls); json_decref (*contract_terms); diff --git a/src/backend/taler-merchant-httpd_private-patch-instances-ID.c b/src/backend/taler-merchant-httpd_private-patch-instances-ID.c index 24f7c097..188a3ee6 100644 --- a/src/backend/taler-merchant-httpd_private-patch-instances-ID.c +++ b/src/backend/taler-merchant-httpd_private-patch-instances-ID.c @@ -71,17 +71,17 @@ patch_instances_ID (struct TMH_MerchantInstance *mi, &payto_uris), GNUNET_JSON_spec_string ("name", &name), - GNUNET_JSON_spec_mark_optional( + GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("website", (const char **) &is.website), NULL), - GNUNET_JSON_spec_mark_optional( + GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("email", - (const char **) &is.email), + (const char **) &is.email), NULL), - GNUNET_JSON_spec_mark_optional( + GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("logo", - (const char **) &is.logo), + (const char **) &is.logo), NULL), GNUNET_JSON_spec_json ("address", &is.address), @@ -184,15 +184,15 @@ patch_instances_ID (struct TMH_MerchantInstance *mi, ((mi->settings.email == is.email) || (NULL != is.email && NULL != mi->settings.email && 0 == strcmp (mi->settings.email, - is.email))) && + is.email))) && ((mi->settings.website == is.website) || (NULL != is.website && NULL != mi->settings.website && 0 == strcmp (mi->settings.website, - is.website))) && + is.website))) && ((mi->settings.logo == is.logo) || (NULL != is.logo && NULL != mi->settings.logo && 0 == strcmp (mi->settings.logo, - is.logo))) && + is.logo))) && (1 == json_equal (mi->settings.address, is.address)) && (1 == json_equal (mi->settings.jurisdiction, @@ -322,6 +322,7 @@ patch_instances_ID (struct TMH_MerchantInstance *mi, wm_tail, wm); ad.h_wire = wm->h_wire; + ad.salt = wm->wire_salt; ad.active = true; qs = TMH_db->insert_account (TMH_db->cls, mi->settings.id, diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c index 10a8d503..5444222b 100644 --- a/src/backend/taler-merchant-httpd_private-post-orders.c +++ b/src/backend/taler-merchant-httpd_private-post-orders.c @@ -1060,51 +1060,56 @@ patch_order (struct MHD_Connection *connection, TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_PROPOSAL_PARSE_ERROR, "'merchant' field already set, but must be provided by backend"); } - jmerchant = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_string ("name", - settings->name), - GNUNET_JSON_pack_allow_null ( - GNUNET_JSON_pack_string ("website", - settings->website)), - GNUNET_JSON_pack_allow_null ( - GNUNET_JSON_pack_string ("email", - settings->email)), - GNUNET_JSON_pack_allow_null ( - GNUNET_JSON_pack_string ("logo", - settings->logo))); - GNUNET_assert (NULL != jmerchant); + { - json_t *loca; + json_t *jm; - /* Handle merchant address */ - loca = settings->address; - if (NULL != loca) + jm = GNUNET_JSON_PACK ( + GNUNET_JSON_pack_string ("name", + settings->name), + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_string ("website", + settings->website)), + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_string ("email", + settings->email)), + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_string ("logo", + settings->logo))); + GNUNET_assert (NULL != jm); { - loca = json_deep_copy (loca); - GNUNET_assert (0 == - json_object_set_new (jmerchant, - "address", - loca)); - } - } - { - json_t *locj; + json_t *loca; - /* Handle merchant jurisdiction */ - locj = settings->jurisdiction; - if (NULL != locj) + /* Handle merchant address */ + loca = settings->address; + if (NULL != loca) + { + loca = json_deep_copy (loca); + GNUNET_assert (0 == + json_object_set_new (jm, + "address", + loca)); + } + } { - locj = json_deep_copy (locj); - GNUNET_assert (0 == - json_object_set_new (jmerchant, - "jurisdiction", - locj)); + json_t *locj; + + /* Handle merchant jurisdiction */ + locj = settings->jurisdiction; + if (NULL != locj) + { + locj = json_deep_copy (locj); + GNUNET_assert (0 == + json_object_set_new (jm, + "jurisdiction", + locj)); + } } + GNUNET_assert (0 == + json_object_set_new (order, + "merchant", + jm)); } - GNUNET_assert (0 == - json_object_set_new (order, - "merchant", - jmerchant)); /* add fields to the contract that the backend should provide */ GNUNET_assert (0 == |