anastasis

Credential backup and recovery protocol and service
Log | Files | Refs | Submodules | README | LICENSE

commit 98645197df13a4a2aae862d0d265dbd56200e2db
parent cd4869785f83536e4f42cba0ce295410d06b0b69
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 22 Mar 2026 21:43:28 +0100

adapt code to lastest merchant API

Diffstat:
Msrc/backend/anastasis-httpd_policy-upload.c | 66+++++++++++++++++++++++++++++++++++++-----------------------------
Msrc/backend/anastasis-httpd_truth-challenge.c | 135++++++++++++++++++++++++++++++++++++++++++++++---------------------------------
Msrc/backend/anastasis-httpd_truth-solve.c | 94++++++++++++++++++++++++++++++++++++++++++++-----------------------------------
Msrc/backend/anastasis-httpd_truth-upload.c | 70+++++++++++++++++++++++++++++++++++++++++-----------------------------
4 files changed, 210 insertions(+), 155 deletions(-)

diff --git a/src/backend/anastasis-httpd_policy-upload.c b/src/backend/anastasis-httpd_policy-upload.c @@ -29,6 +29,8 @@ #include <taler/taler_json_lib.h> #include <taler/taler_merchant_service.h> #include <taler/taler_signatures.h> +#include <taler/taler-merchant/post-private-orders.h> +#include <taler/taler-merchant/get-private-orders-ORDER_ID.h> /** * How long do we hold an HTTP client connection if @@ -98,12 +100,12 @@ struct PolicyUploadContext /** * Used while we are awaiting proposal creation. */ - struct TALER_MERCHANT_PostOrdersHandle *po; + struct TALER_MERCHANT_PostPrivateOrdersHandle *po; /** * Used while we are waiting payment. */ - struct TALER_MERCHANT_OrderMerchantGetHandle *cpo; + struct TALER_MERCHANT_GetPrivateOrderHandle *cpo; /** * HTTP response code to use on resume, if non-NULL. @@ -198,12 +200,12 @@ AH_resume_all_bc () puc); if (NULL != puc->po) { - TALER_MERCHANT_orders_post_cancel (puc->po); + TALER_MERCHANT_post_private_orders_cancel (puc->po); puc->po = NULL; } if (NULL != puc->cpo) { - TALER_MERCHANT_merchant_order_get_cancel (puc->cpo); + TALER_MERCHANT_get_private_order_cancel (puc->cpo); puc->cpo = NULL; } MHD_resume_connection (puc->con); @@ -222,9 +224,9 @@ cleanup_ctx (struct TM_HandlerContext *hc) struct PolicyUploadContext *puc = hc->ctx; if (NULL != puc->po) - TALER_MERCHANT_orders_post_cancel (puc->po); + TALER_MERCHANT_post_private_orders_cancel (puc->po); if (NULL != puc->cpo) - TALER_MERCHANT_merchant_order_get_cancel (puc->cpo); + TALER_MERCHANT_get_private_order_cancel (puc->cpo); if (NULL != puc->hash_ctx) GNUNET_CRYPTO_hash_context_abort (puc->hash_ctx); if (NULL != puc->resp) @@ -322,7 +324,7 @@ make_payment_request (struct PolicyUploadContext *puc) */ static void proposal_cb (void *cls, - const struct TALER_MERCHANT_PostOrdersReply *por) + const struct TALER_MERCHANT_PostPrivateOrdersResponse *por) { struct PolicyUploadContext *puc = cls; enum GNUNET_DB_QueryStatus qs; @@ -392,7 +394,7 @@ proposal_cb (void *cls, */ static void check_payment_cb (void *cls, - const struct TALER_MERCHANT_OrderStatusResponse *osr) + const struct TALER_MERCHANT_GetPrivateOrderResponse *osr) { struct PolicyUploadContext *puc = cls; const struct TALER_MERCHANT_HttpResponse *hr = &osr->hr; @@ -534,15 +536,21 @@ await_payment (struct PolicyUploadContext *puc) order_id = GNUNET_STRINGS_data_to_string_alloc ( &puc->payment_identifier, sizeof(struct ANASTASIS_PaymentSecretP)); - puc->cpo = TALER_MERCHANT_merchant_order_get (AH_ctx, - AH_backend_url, - order_id, - NULL /* our payments are NOT session-bound */ - , - timeout, - &check_payment_cb, - puc); + puc->cpo = TALER_MERCHANT_get_private_order_create (AH_ctx, + AH_backend_url, + order_id); + GNUNET_assert (NULL != puc->cpo); GNUNET_free (order_id); + GNUNET_assert ( + GNUNET_OK == + TALER_MERCHANT_get_private_order_set_options ( + puc->cpo, + TALER_MERCHANT_get_private_order_option_timeout (timeout))); + GNUNET_assert ( + TALER_EC_NONE == + TALER_MERCHANT_get_private_order_start (puc->cpo, + &check_payment_cb, + puc)); } AH_trigger_curl (); } @@ -559,7 +567,6 @@ await_payment (struct PolicyUploadContext *puc) static MHD_RESULT begin_payment (struct PolicyUploadContext *puc) { - static const char *no_uuids[1] = { NULL }; json_t *order; GNUNET_CONTAINER_DLL_insert (puc_head, @@ -602,18 +609,19 @@ begin_payment (struct PolicyUploadContext *puc) GNUNET_free (order_id); } MHD_suspend_connection (puc->con); - puc->po = TALER_MERCHANT_orders_post2 (AH_ctx, - AH_backend_url, - order, - GNUNET_TIME_UNIT_ZERO, - NULL, /* no payment target */ - 0, - NULL, /* no inventory products */ - 0, - no_uuids, /* no uuids */ - false, /* do NOT require claim token */ - &proposal_cb, - puc); + puc->po = TALER_MERCHANT_post_private_orders_create (AH_ctx, + AH_backend_url, + order); + GNUNET_assert (NULL != puc->po); + GNUNET_assert ( + GNUNET_OK == + TALER_MERCHANT_post_private_orders_set_options ( + puc->po, + TALER_MERCHANT_post_private_orders_option_create_token (false))); + GNUNET_assert (TALER_EC_NONE == + TALER_MERCHANT_post_private_orders_start (puc->po, + &proposal_cb, + puc)); AH_trigger_curl (); json_decref (order); return MHD_YES; diff --git a/src/backend/anastasis-httpd_truth-challenge.c b/src/backend/anastasis-httpd_truth-challenge.c @@ -30,6 +30,9 @@ #include <taler/taler_merchant_service.h> #include <taler/taler_json_lib.h> #include <taler/taler_mhd_lib.h> +#include <taler/taler-merchant/post-private-orders.h> +#include <taler/taler-merchant/get-private-orders-ORDER_ID.h> +#include <taler/taler-merchant/post-private-orders-ORDER_ID-refund.h> /** * What is the maximum frequency at which we allow @@ -123,12 +126,12 @@ struct ChallengeContext /** * Used while we are awaiting proposal creation. */ - struct TALER_MERCHANT_PostOrdersHandle *po; + struct TALER_MERCHANT_PostPrivateOrdersHandle *po; /** * Used while we are waiting payment. */ - struct TALER_MERCHANT_OrderMerchantGetHandle *cpo; + struct TALER_MERCHANT_GetPrivateOrderHandle *cpo; /** * HTTP response code to use on resume, if non-NULL. @@ -191,7 +194,7 @@ struct RefundEntry /** * Operation handle. */ - struct TALER_MERCHANT_OrderRefundHandle *ro; + struct TALER_MERCHANT_PostPrivateOrdersRefundHandle *ro; /** * Which order is being refunded. @@ -309,7 +312,7 @@ AH_truth_challenge_shutdown (void) re); if (NULL != re->ro) { - TALER_MERCHANT_post_order_refund_cancel (re->ro); + TALER_MERCHANT_post_private_orders_refund_cancel (re->ro); re->ro = NULL; } GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -327,12 +330,12 @@ AH_truth_challenge_shutdown (void) gc->in_list = false; if (NULL != gc->cpo) { - TALER_MERCHANT_merchant_order_get_cancel (gc->cpo); + TALER_MERCHANT_get_private_order_cancel (gc->cpo); gc->cpo = NULL; } if (NULL != gc->po) { - TALER_MERCHANT_orders_post_cancel (gc->po); + TALER_MERCHANT_post_private_orders_cancel (gc->po); gc->po = NULL; } if (gc->suspended) @@ -365,7 +368,7 @@ AH_truth_challenge_shutdown (void) static void refund_cb ( void *cls, - const struct TALER_MERCHANT_RefundResponse *rr) + const struct TALER_MERCHANT_PostPrivateOrdersRefundResponse *rr) { struct RefundEntry *re = cls; @@ -434,19 +437,27 @@ begin_refund (const struct ChallengeContext *gc) re->order_id); re->payment_identifier = gc->payment_identifier; re->truth_uuid = gc->truth_uuid; - re->ro = TALER_MERCHANT_post_order_refund (AH_ctx, - AH_backend_url, - re->order_id, - &gc->challenge_cost, - "failed to issue challenge", - &refund_cb, - re); - if (NULL == re->ro) + re->ro = TALER_MERCHANT_post_private_orders_refund_create (AH_ctx, + AH_backend_url, + re->order_id, + &gc->challenge_cost + , + "failed to issue challenge"); { - GNUNET_break (0); - GNUNET_free (re->order_id); - GNUNET_free (re); - return; + enum TALER_ErrorCode ec; + + ec = TALER_MERCHANT_post_private_orders_refund_start (re->ro, + &refund_cb, + re); + if (TALER_EC_NONE != ec) + { + TALER_MERCHANT_post_private_orders_refund_cancel (re->ro); + re->ro = NULL; + GNUNET_break (0); + GNUNET_free (re->order_id); + GNUNET_free (re); + return; + } } GNUNET_CONTAINER_DLL_insert (re_head, re_tail, @@ -492,12 +503,12 @@ request_done (struct TM_HandlerContext *hc) } if (NULL != gc->cpo) { - TALER_MERCHANT_merchant_order_get_cancel (gc->cpo); + TALER_MERCHANT_get_private_order_cancel (gc->cpo); gc->cpo = NULL; } if (NULL != gc->po) { - TALER_MERCHANT_orders_post_cancel (gc->po); + TALER_MERCHANT_post_private_orders_cancel (gc->po); gc->po = NULL; } if (NULL != gc->root) @@ -587,7 +598,7 @@ make_payment_request (struct ChallengeContext *gc) */ static void proposal_cb (void *cls, - const struct TALER_MERCHANT_PostOrdersReply *por) + const struct TALER_MERCHANT_PostPrivateOrdersResponse *por) { struct ChallengeContext *gc = cls; enum GNUNET_DB_QueryStatus qs; @@ -650,7 +661,7 @@ proposal_cb (void *cls, */ static void check_payment_cb (void *cls, - const struct TALER_MERCHANT_OrderStatusResponse *osr) + const struct TALER_MERCHANT_GetPrivateOrderResponse *osr) { struct ChallengeContext *gc = cls; @@ -789,19 +800,23 @@ begin_payment (struct ChallengeContext *gc) "Order exists, checking payment status for order `%s'\n", order_id); timeout = GNUNET_TIME_absolute_get_remaining (gc->timeout); - gc->cpo = TALER_MERCHANT_merchant_order_get (AH_ctx, - AH_backend_url, - order_id, - NULL /* NOT session-bound */, - timeout, - &check_payment_cb, - gc); + gc->cpo = TALER_MERCHANT_get_private_order_create (AH_ctx, + AH_backend_url, + order_id); + GNUNET_assert (NULL != gc->cpo); + GNUNET_assert ( + GNUNET_OK == + TALER_MERCHANT_get_private_order_set_options ( + gc->cpo, + TALER_MERCHANT_get_private_order_option_timeout (timeout))); + GNUNET_assert (TALER_EC_NONE == + TALER_MERCHANT_get_private_order_start (gc->cpo, + &check_payment_cb, + gc)); } else { /* Create a fresh order */ - static const char *no_uuids[1] = { NULL }; - json_t *order; struct GNUNET_TIME_Timestamp pay_deadline; GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, @@ -815,30 +830,38 @@ begin_payment (struct ChallengeContext *gc) order_id); pay_deadline = GNUNET_TIME_relative_to_timestamp ( ANASTASIS_CHALLENGE_OFFER_LIFETIME); - order = GNUNET_JSON_PACK ( - TALER_JSON_pack_amount ("amount", - &gc->challenge_cost), - GNUNET_JSON_pack_string ("summary", - "challenge fee for anastasis service"), - GNUNET_JSON_pack_string ("order_id", - order_id), - GNUNET_JSON_pack_time_rel ("auto_refund", - AUTO_REFUND_TIMEOUT), - GNUNET_JSON_pack_timestamp ("pay_deadline", - pay_deadline)); - gc->po = TALER_MERCHANT_orders_post2 (AH_ctx, - AH_backend_url, - order, - AUTO_REFUND_TIMEOUT, - NULL, /* no payment target */ - 0, - NULL, /* no inventory products */ - 0, - no_uuids, /* no uuids */ - false, /* do NOT require claim token */ - &proposal_cb, - gc); - json_decref (order); + { + json_t *order; + + order = GNUNET_JSON_PACK ( + TALER_JSON_pack_amount ("amount", + &gc->challenge_cost), + GNUNET_JSON_pack_string ("summary", + "challenge fee for anastasis service"), + GNUNET_JSON_pack_string ("order_id", + order_id), + GNUNET_JSON_pack_time_rel ("auto_refund", + AUTO_REFUND_TIMEOUT), + GNUNET_JSON_pack_timestamp ("pay_deadline", + pay_deadline)); + gc->po = TALER_MERCHANT_post_private_orders_create (AH_ctx, + AH_backend_url, + order); + json_decref (order); + } + GNUNET_assert (NULL != gc->po); + GNUNET_assert ( + GNUNET_OK == + TALER_MERCHANT_post_private_orders_set_options ( + gc->po, + TALER_MERCHANT_post_private_orders_option_create_token (false), + TALER_MERCHANT_post_private_orders_option_refund_delay ( + AUTO_REFUND_TIMEOUT))); + GNUNET_assert (TALER_EC_NONE == + TALER_MERCHANT_post_private_orders_start ( + gc->po, + &proposal_cb, + gc)); } GNUNET_free (order_id); AH_trigger_curl (); diff --git a/src/backend/anastasis-httpd_truth-solve.c b/src/backend/anastasis-httpd_truth-solve.c @@ -30,6 +30,8 @@ #include <taler/taler_merchant_service.h> #include <taler/taler_json_lib.h> #include <taler/taler_mhd_lib.h> +#include <taler/taler-merchant/post-private-orders.h> +#include <taler/taler-merchant/get-private-orders-ORDER_ID.h> /** * What is the maximum frequency at which we allow @@ -117,12 +119,12 @@ struct SolveContext /** * Used while we are awaiting proposal creation. */ - struct TALER_MERCHANT_PostOrdersHandle *po; + struct TALER_MERCHANT_PostPrivateOrdersHandle *po; /** * Used while we are waiting payment. */ - struct TALER_MERCHANT_OrderMerchantGetHandle *cpo; + struct TALER_MERCHANT_GetPrivateOrderHandle *cpo; /** * HTTP response code to use on resume, if non-NULL. @@ -272,12 +274,12 @@ AH_truth_solve_shutdown (void) gc->in_list = false; if (NULL != gc->cpo) { - TALER_MERCHANT_merchant_order_get_cancel (gc->cpo); + TALER_MERCHANT_get_private_order_cancel (gc->cpo); gc->cpo = NULL; } if (NULL != gc->po) { - TALER_MERCHANT_orders_post_cancel (gc->po); + TALER_MERCHANT_post_private_orders_cancel (gc->po); gc->po = NULL; } if (gc->suspended) @@ -339,12 +341,12 @@ request_done (struct TM_HandlerContext *hc) } if (NULL != gc->cpo) { - TALER_MERCHANT_merchant_order_get_cancel (gc->cpo); + TALER_MERCHANT_get_private_order_cancel (gc->cpo); gc->cpo = NULL; } if (NULL != gc->po) { - TALER_MERCHANT_orders_post_cancel (gc->po); + TALER_MERCHANT_post_private_orders_cancel (gc->po); gc->po = NULL; } if (NULL != gc->root) @@ -434,7 +436,7 @@ make_payment_request (struct SolveContext *gc) */ static void proposal_cb (void *cls, - const struct TALER_MERCHANT_PostOrdersReply *por) + const struct TALER_MERCHANT_PostPrivateOrdersResponse *por) { struct SolveContext *gc = cls; enum GNUNET_DB_QueryStatus qs; @@ -497,7 +499,7 @@ proposal_cb (void *cls, */ static void check_payment_cb (void *cls, - const struct TALER_MERCHANT_OrderStatusResponse *osr) + const struct TALER_MERCHANT_GetPrivateOrderResponse *osr) { struct SolveContext *gc = cls; @@ -636,19 +638,23 @@ begin_payment (struct SolveContext *gc) "Order exists, checking payment status for order `%s'\n", order_id); timeout = GNUNET_TIME_absolute_get_remaining (gc->timeout); - gc->cpo = TALER_MERCHANT_merchant_order_get (AH_ctx, - AH_backend_url, - order_id, - NULL /* NOT session-bound */, - timeout, - &check_payment_cb, - gc); + gc->cpo = TALER_MERCHANT_get_private_order_create (AH_ctx, + AH_backend_url, + order_id); + GNUNET_assert (NULL != gc->cpo); + GNUNET_assert ( + GNUNET_OK == + TALER_MERCHANT_get_private_order_set_options ( + gc->cpo, + TALER_MERCHANT_get_private_order_option_timeout (timeout))); + GNUNET_assert (TALER_EC_NONE == + TALER_MERCHANT_get_private_order_start (gc->cpo, + &check_payment_cb, + gc)); } else { /* Create a fresh order */ - static const char *no_uuids[1] = { NULL }; - json_t *order; struct GNUNET_TIME_Timestamp pay_deadline; GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, @@ -662,30 +668,36 @@ begin_payment (struct SolveContext *gc) order_id); pay_deadline = GNUNET_TIME_relative_to_timestamp ( ANASTASIS_CHALLENGE_OFFER_LIFETIME); - order = GNUNET_JSON_PACK ( - TALER_JSON_pack_amount ("amount", - &gc->challenge_cost), - GNUNET_JSON_pack_string ("summary", - "challenge fee for anastasis service"), - GNUNET_JSON_pack_string ("order_id", - order_id), - GNUNET_JSON_pack_time_rel ("auto_refund", - AUTO_REFUND_TIMEOUT), - GNUNET_JSON_pack_timestamp ("pay_deadline", - pay_deadline)); - gc->po = TALER_MERCHANT_orders_post2 (AH_ctx, - AH_backend_url, - order, - AUTO_REFUND_TIMEOUT, - NULL, /* no payment target */ - 0, - NULL, /* no inventory products */ - 0, - no_uuids, /* no uuids */ - false, /* do NOT require claim token */ - &proposal_cb, - gc); - json_decref (order); + { + json_t *order; + + order = GNUNET_JSON_PACK ( + TALER_JSON_pack_amount ("amount", + &gc->challenge_cost), + GNUNET_JSON_pack_string ("summary", + "challenge fee for anastasis service"), + GNUNET_JSON_pack_string ("order_id", + order_id), + GNUNET_JSON_pack_time_rel ("auto_refund", + AUTO_REFUND_TIMEOUT), + GNUNET_JSON_pack_timestamp ("pay_deadline", + pay_deadline)); + gc->po = TALER_MERCHANT_post_private_orders_create (AH_ctx, + AH_backend_url, + order); + json_decref (order); + } + GNUNET_assert ( + GNUNET_OK == + TALER_MERCHANT_post_private_orders_set_options ( + gc->po, + TALER_MERCHANT_post_private_orders_option_create_token (false), + TALER_MERCHANT_post_private_orders_option_refund_delay ( + AUTO_REFUND_TIMEOUT))); + GNUNET_assert (TALER_EC_NONE == + TALER_MERCHANT_post_private_orders_start (gc->po, + &proposal_cb, + gc)); } GNUNET_free (order_id); AH_trigger_curl (); diff --git a/src/backend/anastasis-httpd_truth-upload.c b/src/backend/anastasis-httpd_truth-upload.c @@ -30,6 +30,8 @@ #include <taler/taler_merchant_service.h> #include <taler/taler_signatures.h> #include "anastasis_authorization_lib.h" +#include <taler/taler-merchant/post-private-orders.h> +#include <taler/taler-merchant/get-private-orders-ORDER_ID.h> /** @@ -56,12 +58,12 @@ struct TruthUploadContext /** * Used while we are awaiting proposal creation. */ - struct TALER_MERCHANT_PostOrdersHandle *po; + struct TALER_MERCHANT_PostPrivateOrdersHandle *po; /** * Used while we are waiting payment. */ - struct TALER_MERCHANT_OrderMerchantGetHandle *cpo; + struct TALER_MERCHANT_GetPrivateOrderHandle *cpo; /** * Post parser context. @@ -129,12 +131,12 @@ AH_truth_upload_shutdown (void) tuc); if (NULL != tuc->cpo) { - TALER_MERCHANT_merchant_order_get_cancel (tuc->cpo); + TALER_MERCHANT_get_private_order_cancel (tuc->cpo); tuc->cpo = NULL; } if (NULL != tuc->po) { - TALER_MERCHANT_orders_post_cancel (tuc->po); + TALER_MERCHANT_post_private_orders_cancel (tuc->po); tuc->po = NULL; } MHD_resume_connection (tuc->connection); @@ -154,9 +156,9 @@ cleanup_truth_post (struct TM_HandlerContext *hc) TALER_MHD_parse_post_cleanup_callback (tuc->post_ctx); if (NULL != tuc->po) - TALER_MERCHANT_orders_post_cancel (tuc->po); + TALER_MERCHANT_post_private_orders_cancel (tuc->po); if (NULL != tuc->cpo) - TALER_MERCHANT_merchant_order_get_cancel (tuc->cpo); + TALER_MERCHANT_get_private_order_cancel (tuc->cpo); if (NULL != tuc->resp) MHD_destroy_response (tuc->resp); if (NULL != tuc->json) @@ -248,7 +250,7 @@ make_payment_request (struct TruthUploadContext *tuc) */ static void proposal_cb (void *cls, - const struct TALER_MERCHANT_PostOrdersReply *por) + const struct TALER_MERCHANT_PostPrivateOrdersResponse *por) { struct TruthUploadContext *tuc = cls; @@ -292,7 +294,7 @@ proposal_cb (void *cls, */ static void check_payment_cb (void *cls, - const struct TALER_MERCHANT_OrderStatusResponse *osr) + const struct TALER_MERCHANT_GetPrivateOrderResponse *osr) { struct TruthUploadContext *tuc = cls; const struct TALER_MERCHANT_HttpResponse *hr = &osr->hr; @@ -397,7 +399,6 @@ check_payment_cb (void *cls, case MHD_HTTP_NOT_FOUND: /* Setup fresh order */ { - static const char *no_uuids[1] = { NULL }; char *order_id; json_t *order; @@ -420,18 +421,19 @@ check_payment_cb (void *cls, "order_id", order_id); GNUNET_free (order_id); - tuc->po = TALER_MERCHANT_orders_post2 (AH_ctx, - AH_backend_url, - order, - GNUNET_TIME_UNIT_ZERO, - NULL, /* no payment target */ - 0, - NULL, /* no inventory products */ - 0, - no_uuids, /* no uuids */ - false, /* do NOT require claim token */ - &proposal_cb, - tuc); + tuc->po = TALER_MERCHANT_post_private_orders_create (AH_ctx, + AH_backend_url, + order); + GNUNET_assert (NULL != tuc->po); + GNUNET_assert ( + GNUNET_OK == + TALER_MERCHANT_post_private_orders_set_options ( + tuc->po, + TALER_MERCHANT_post_private_orders_option_create_token (false))); + GNUNET_assert (TALER_EC_NONE == + TALER_MERCHANT_post_private_orders_start (tuc->po, + &proposal_cb, + tuc)); AH_trigger_curl (); json_decref (order); return; @@ -482,14 +484,9 @@ begin_payment (struct TruthUploadContext *tuc) order_id = GNUNET_STRINGS_data_to_string_alloc ( &tuc->truth_uuid, sizeof (tuc->truth_uuid)); - tuc->cpo = TALER_MERCHANT_merchant_order_get (AH_ctx, - AH_backend_url, - order_id, - NULL /* our payments are NOT session-bound */ - , - timeout, - &check_payment_cb, - tuc); + tuc->cpo = TALER_MERCHANT_get_private_order_create (AH_ctx, + AH_backend_url, + order_id); GNUNET_free (order_id); if (NULL == tuc->cpo) { @@ -499,6 +496,21 @@ begin_payment (struct TruthUploadContext *tuc) TALER_EC_ANASTASIS_GENERIC_PAYMENT_CHECK_START_FAILED, "Could not check order status"); } + GNUNET_assert (GNUNET_OK == + TALER_MERCHANT_get_private_order_set_options ( + tuc->cpo, + TALER_MERCHANT_get_private_order_option_timeout (timeout))); + if (TALER_EC_NONE != + TALER_MERCHANT_get_private_order_start (tuc->cpo, + &check_payment_cb, + tuc)) + { + GNUNET_break (0); + return TALER_MHD_reply_with_error (tuc->connection, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_ANASTASIS_GENERIC_PAYMENT_CHECK_START_FAILED, + "Could not check order status"); + } GNUNET_CONTAINER_DLL_insert (tuc_head, tuc_tail, tuc);