diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_get-orders-ID.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_get-orders-ID.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c b/src/backend/taler-merchant-httpd_get-orders-ID.c index d587745c..fb189d37 100644 --- a/src/backend/taler-merchant-httpd_get-orders-ID.c +++ b/src/backend/taler-merchant-httpd_get-orders-ID.c @@ -238,6 +238,12 @@ struct GetOrderData bool refunded; /** + * Set to true if a refund is still available for the + * wallet for this payment. + */ + bool refund_available; + + /** * Set to true if the client requested HTML, otherwise * we generate JSON. */ @@ -682,6 +688,7 @@ exchange_found_cb (void *cls, * @param rtransaction_id identificator of the refund * @param reason human-readable explanation of the refund * @param refund_amount refund amount which is being taken from @a coin_pub + * @param pending true if the this refund was not yet processed by the wallet/exchange */ static void process_refunds_cb (void *cls, @@ -691,7 +698,8 @@ process_refunds_cb (void *cls, const char *exchange_url, uint64_t rtransaction_id, const char *reason, - const struct TALER_Amount *refund_amount) + const struct TALER_Amount *refund_amount, + bool pending) { struct GetOrderData *god = cls; struct CoinRefund *cr; @@ -722,6 +730,7 @@ process_refunds_cb (void *cls, } god->refund_amount = *refund_amount; god->refunded = true; + god->refund_available |= pending; } @@ -1307,7 +1316,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh, { enum GNUNET_GenericReturnValue res; - if (god->refunded) // FIXME: don't check for refunded, but for PENDING refund! + if (god->refund_available) { char *qr; char *uri; @@ -1320,7 +1329,10 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh, { GNUNET_break (0); GNUNET_free (uri); - return MHD_NO; // FIXME: add nicer error reply... + return TALER_MHD_reply_with_error (god->sc.con, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_ALLOCATION_FAILURE, + "during QR code generation"); } { struct KVC kvc[] = { |