diff options
Diffstat (limited to 'src/backend/anastasis-httpd_truth.c')
-rw-r--r-- | src/backend/anastasis-httpd_truth.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/src/backend/anastasis-httpd_truth.c b/src/backend/anastasis-httpd_truth.c index 164c33a..b0b6530 100644 --- a/src/backend/anastasis-httpd_truth.c +++ b/src/backend/anastasis-httpd_truth.c | |||
@@ -520,19 +520,18 @@ proposal_cb (void *cls, | |||
520 | por->hr.http_status, | 520 | por->hr.http_status, |
521 | (int) por->hr.ec); | 521 | (int) por->hr.ec); |
522 | GNUNET_break (0); | 522 | GNUNET_break (0); |
523 | gc->resp = TALER_MHD_make_json_pack ( | 523 | gc->resp = TALER_MHD_MAKE_JSON_PACK ( |
524 | "{s:I, s:s, s:I, s:I, s:O?}", | 524 | GNUNET_JSON_pack_uint64 ("code", |
525 | "code", | 525 | TALER_EC_ANASTASIS_TRUTH_PAYMENT_CREATE_BACKEND_ERROR), |
526 | (json_int_t) TALER_EC_ANASTASIS_TRUTH_PAYMENT_CREATE_BACKEND_ERROR, | 526 | GNUNET_JSON_pack_string ("hint", |
527 | "hint", | 527 | "Failed to setup order with merchant backend"), |
528 | "Failed to setup order with merchant backend", | 528 | GNUNET_JSON_pack_uint64 ("backend-ec", |
529 | "backend-ec", | 529 | por->hr.ec), |
530 | (json_int_t) por->hr.ec, | 530 | GNUNET_JSON_pack_uint64 ("backend-http-status", |
531 | "backend-http-status", | 531 | por->hr.http_status), |
532 | (json_int_t) por->hr.http_status, | 532 | GNUNET_JSON_pack_allow_null ( |
533 | "backend-reply", | 533 | GNUNET_JSON_pack_object_steal ("backend-reply", |
534 | por->hr.reply); | 534 | (json_t *) por->hr.reply))); |
535 | GNUNET_assert (NULL != gc->resp); | ||
536 | gc->response_code = MHD_HTTP_BAD_GATEWAY; | 535 | gc->response_code = MHD_HTTP_BAD_GATEWAY; |
537 | return; | 536 | return; |
538 | } | 537 | } |
@@ -727,14 +726,17 @@ begin_payment (struct GetContext *gc) | |||
727 | pay_deadline = GNUNET_TIME_relative_to_absolute ( | 726 | pay_deadline = GNUNET_TIME_relative_to_absolute ( |
728 | ANASTASIS_CHALLENGE_OFFER_LIFETIME); | 727 | ANASTASIS_CHALLENGE_OFFER_LIFETIME); |
729 | GNUNET_TIME_round_abs (&pay_deadline); | 728 | GNUNET_TIME_round_abs (&pay_deadline); |
730 | order = json_pack ("{s:o, s:s, s:s, s:o, s:o}", | 729 | order = GNUNET_JSON_PACK ( |
731 | "amount", TALER_JSON_from_amount (&gc->challenge_cost), | 730 | TALER_JSON_pack_amount ("amount", |
732 | "summary", "challenge fee for anastasis service", | 731 | &gc->challenge_cost), |
733 | "order_id", order_id, | 732 | GNUNET_JSON_pack_string ("summary", |
734 | "auto_refund", GNUNET_JSON_from_time_rel ( | 733 | "challenge fee for anastasis service"), |
735 | AUTO_REFUND_TIMEOUT), | 734 | GNUNET_JSON_pack_string ("order_id", |
736 | "pay_deadline", GNUNET_JSON_from_time_abs ( | 735 | order_id), |
737 | pay_deadline)); | 736 | GNUNET_JSON_pack_time_rel ("auto_refund", |
737 | AUTO_REFUND_TIMEOUT), | ||
738 | GNUNET_JSON_pack_time_abs ("pay_deadline", | ||
739 | pay_deadline)); | ||
738 | gc->po = TALER_MERCHANT_orders_post2 (AH_ctx, | 740 | gc->po = TALER_MERCHANT_orders_post2 (AH_ctx, |
739 | AH_backend_url, | 741 | AH_backend_url, |
740 | order, | 742 | order, |