summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-10-30 17:03:52 +0100
committerChristian Grothoff <christian@grothoff.org>2020-10-30 17:03:52 +0100
commit9ef5d9cf5fe2dbceaddc557c540f716448cd264e (patch)
treeedb377f2101a790edc76198bf96f58b1462e8ef2
parent0b007849a03046193c1e7d01bf2cc001009dd251 (diff)
downloadtaler-mdb-9ef5d9cf5fe2dbceaddc557c540f716448cd264e.tar.gz
taler-mdb-9ef5d9cf5fe2dbceaddc557c540f716448cd264e.tar.bz2
taler-mdb-9ef5d9cf5fe2dbceaddc557c540f716448cd264e.zip
adapt to merchant API change
-rw-r--r--src/main.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/main.c b/src/main.c
index 8ba9367..bf9a7eb 100644
--- 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