taler-mdb

GNU Taler Extensions and Integrations
Log | Files | Refs | Submodules | README | LICENSE

commit 9ef5d9cf5fe2dbceaddc557c540f716448cd264e
parent 0b007849a03046193c1e7d01bf2cc001009dd251
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 30 Oct 2020 17:03:52 +0100

adapt to merchant API change

Diffstat:
Msrc/main.c | 25+++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/main.c b/src/main.c @@ -1478,27 +1478,24 @@ check_payment_again (void *cls) * @brief Callback for a POST /orders request * * @param cls closure - * @param hr HTTP response for this request - * @param order_id order ID of the order created - * @param token the claim token generated by the merchant (NULL if - * it wasn't generated). + * @param por response for this request */ static void proposal_cb (void *cls, - const struct TALER_MERCHANT_HttpResponse *hr, - const char *order_id, - const struct TALER_ClaimTokenP *token) + const struct TALER_MERCHANT_PostOrdersReply *por) { struct PaymentActivity *pa = cls; pa->po = NULL; - if (MHD_HTTP_OK != hr->http_status) + if (MHD_HTTP_OK != por->hr.http_status) { + /* FIXME: In the future, we may want to support MHD_HTTP_GONE + explicitly and show 'product out of stock' here! */ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to setup order with backend: %u/%d\n", - hr->http_status, - (int) hr->ec); - json_dumpf (hr->reply, + por->hr.http_status, + (int) por->hr.ec); + json_dumpf (por->hr.reply, stderr, 0); mdb.cmd = &cmd_reader_display_backend_not_reachable; @@ -1510,8 +1507,8 @@ proposal_cb (void *cls, } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Backend successfully created order `%s'\n", - order_id); - pa->order_id = GNUNET_strdup (order_id); + por->details.ok.order_id); + pa->order_id = GNUNET_strdup (por->details.ok.order_id); pa->ogh = TALER_MERCHANT_merchant_order_get (ctx, pa->base_url, pa->order_id, @@ -1524,7 +1521,7 @@ proposal_cb (void *cls, static void -start_read_cancel_button (); +start_read_cancel_button (void); /** * @brief Launch a new order