diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-patch-templates-ID.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-patch-templates-ID.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/backend/taler-merchant-httpd_private-patch-templates-ID.c b/src/backend/taler-merchant-httpd_private-patch-templates-ID.c index 57c6dd95..52a21b57 100644 --- a/src/backend/taler-merchant-httpd_private-patch-templates-ID.c +++ b/src/backend/taler-merchant-httpd_private-patch-templates-ID.c @@ -52,9 +52,9 @@ determine_cause (struct MHD_Connection *connection, enum GNUNET_DB_QueryStatus qs; qs = TMH_db->lookup_template (TMH_db->cls, - instance_id, - template_id, - &tpx); + instance_id, + template_id, + &tpx); switch (qs) { case GNUNET_DB_STATUS_HARD_ERROR: @@ -102,16 +102,19 @@ determine_cause (struct MHD_Connection *connection, */ MHD_RESULT TMH_private_patch_templates_ID (const struct TMH_RequestHandler *rh, - struct MHD_Connection *connection, - struct TMH_HandlerContext *hc) + struct MHD_Connection *connection, + struct TMH_HandlerContext *hc) { struct TMH_MerchantInstance *mi = hc->instance; const char *template_id = hc->infix; struct TALER_MERCHANTDB_TemplateDetails tp = {0}; enum GNUNET_DB_QueryStatus qs; + uint32_t pos_algorithm; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("template_description", (const char **) &tp.template_description), + GNUNET_JSON_spec_uint32 ("pos_algorithm", + &pos_algorithm), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("pos_key", (const char **) &tp.pos_key), @@ -135,7 +138,8 @@ TMH_private_patch_templates_ID (const struct TMH_RequestHandler *rh, : MHD_NO; } - if (! TMH_template_contract_valid (tp.template_contract)) + tp.pos_algorithm = (enum TALER_MerchantConfirmationAlgorithm) pos_algorithm; + if (! TMH_template_contract_valid (tp.template_contract)) { GNUNET_break_op (0); GNUNET_JSON_parse_free (spec); @@ -146,9 +150,9 @@ TMH_private_patch_templates_ID (const struct TMH_RequestHandler *rh, } qs = TMH_db->update_template (TMH_db->cls, - mi->settings.id, - template_id, - &tp); + mi->settings.id, + template_id, + &tp); { MHD_RESULT ret = MHD_NO; |