taler-mdb

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

commit 03413813d902b5c79b9d1470595a48263b6c6405
parent 6f093be8314ac69fe9b329fb0853d97251480991
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 26 Aug 2020 13:39:12 +0200

fix instance handling when checking payments

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

diff --git a/src/main.c b/src/main.c @@ -344,6 +344,11 @@ struct PaymentActivity struct Product *product; /** + * Base URL for merchant interactions for this pa. + */ + const char *base_url; + + /** * Order ID for pending order */ char *order_id; @@ -1459,9 +1464,7 @@ check_payment_again (void *cls) pa->delay_pay_task = NULL; GNUNET_assert (NULL == pa->ogh); pa->ogh = TALER_MERCHANT_merchant_order_get (ctx, - (NULL == p->instance) - ? backend_base_url - : p->instance, + pa->base_url, pa->order_id, NULL /* snack machine, no Web crap */, false, @@ -1510,7 +1513,7 @@ proposal_cb (void *cls, order_id); pa->order_id = GNUNET_strdup (order_id); pa->ogh = TALER_MERCHANT_merchant_order_get (ctx, - backend_base_url, + pa->base_url, pa->order_id, NULL /* snack machine, no Web crap */, false, @@ -1597,10 +1600,11 @@ launch_payment (struct Product *product) pa->product = product; pa->amount = product->price; /* put the order on the merchant's backend */ + pa->base_url = (NULL == product->instance) + ? backend_base_url + : product->instance; pa->po = TALER_MERCHANT_orders_post2 (ctx, - (NULL == product->instance) - ? backend_base_url - : product->instance, + pa->base_url, orderReq, MAX_REFUND_DELAY, NULL, /* no payment target preference */