diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_post-orders-ID-claim.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_post-orders-ID-claim.c | 27 |
1 files changed, 3 insertions, 24 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 60aadf4b..0c5da004 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-claim.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-claim.c @@ -163,30 +163,15 @@ TMH_post_orders_ID_claim (const struct TMH_RequestHandler *rh, const char *nonce; enum GNUNET_DB_QueryStatus qs; json_t *contract_terms; - struct TALER_ClaimTokenP claim_token; + struct TALER_ClaimTokenP claim_token = { 0 }; { struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("nonce", &nonce), - GNUNET_JSON_spec_end () - }; - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_json_data (connection, - hc->request_body, - spec); - if (GNUNET_OK != res) - return (GNUNET_NO == res) - ? MHD_YES - : MHD_NO; - } - if (NULL != json_object_get (hc->request_body, - "token")) - { - struct GNUNET_JSON_Specification spec[] = { + GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("token", - &claim_token), + &claim_token)), GNUNET_JSON_spec_end () }; enum GNUNET_GenericReturnValue res; @@ -199,12 +184,6 @@ TMH_post_orders_ID_claim (const struct TMH_RequestHandler *rh, ? MHD_YES : MHD_NO; } - else - { - memset (&claim_token, - 0, - sizeof (claim_token)); - } contract_terms = NULL; for (unsigned int i = 0; i<MAX_RETRIES; i++) { |