From b010ac83f8a668a5425b445bb913cd85cbdb9f64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 10 Aug 2021 15:26:04 +0200 Subject: refund pending case --- merchant-spec/public-orders-get.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'merchant-spec') diff --git a/merchant-spec/public-orders-get.ts b/merchant-spec/public-orders-get.ts index b256860c..dbc3b8b1 100644 --- a/merchant-spec/public-orders-get.ts +++ b/merchant-spec/public-orders-get.ts @@ -11,6 +11,8 @@ interface MerchantOrderInfo { contractHash?: string; claimed: boolean; paid: boolean; + // Refund hasn't been picked up yet + refundPending: boolean; fulfillmentUrl?: string; publicReorderUrl?: string; lastPaidSessionId?: string; @@ -173,7 +175,7 @@ function respUnpaid(req: Req, ord: MerchantOrderInfo): Resp { responseType: "StatusUnpaidResponse", // This must include the claim token. The same taler:// // URI should also be shown as the QR code. - talerHeader: "taler://pay/..." + talerHeader: "taler://pay/...", }; } return { @@ -189,14 +191,20 @@ function respUnpaid(req: Req, ord: MerchantOrderInfo): Resp { function respPaid(req: Req, ord: MerchantOrderInfo): Resp { if (req.accept === "html") { - if (req.accept === "html") { + if (ord.refundPending) { return { - httpStatus: "302 Found", + httpStatus: "402 Payment Required", contentType: "html", - redirectLocation: ord.fulfillmentUrl || "", - responseType: "empty", + responseType: "QRCodeRefundPage", + talerHeader: "taler://refund/...", }; } + return { + httpStatus: "302 Found", + contentType: "html", + redirectLocation: ord.fulfillmentUrl || "", + responseType: "empty", + }; } return { httpStatus: "200 OK", -- cgit v1.2.3