summaryrefslogtreecommitdiff
path: root/src/lib/merchant_api_post_orders.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/merchant_api_post_orders.c')
-rw-r--r--src/lib/merchant_api_post_orders.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/merchant_api_post_orders.c b/src/lib/merchant_api_post_orders.c
index ff142cde..c4ccea36 100644
--- a/src/lib/merchant_api_post_orders.c
+++ b/src/lib/merchant_api_post_orders.c
@@ -92,7 +92,7 @@ handle_post_order_finished (void *cls,
.hr.http_status = (unsigned int) response_code,
.hr.reply = json
};
- struct TALER_ClaimTokenP token = {0};
+ struct TALER_ClaimTokenP token;
po->job = NULL;
switch (response_code)
@@ -102,12 +102,14 @@ handle_post_order_finished (void *cls,
break;
case MHD_HTTP_OK:
{
+ bool no_token;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("order_id",
&por.details.ok.order_id),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_fixed_auto ("token",
- &token)),
+ &token),
+ &no_token),
GNUNET_JSON_spec_end ()
};
@@ -122,7 +124,7 @@ handle_post_order_finished (void *cls,
}
else
{
- if (! GNUNET_is_zero (&token))
+ if (! no_token)
por.details.ok.token = &token;
}
}
@@ -177,7 +179,8 @@ handle_post_order_finished (void *cls,
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_timestamp (
"restock_expected",
- &por.details.gone.restock_expected)),
+ &por.details.gone.restock_expected),
+ NULL),
GNUNET_JSON_spec_end ()
};