taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

commit b010ac83f8a668a5425b445bb913cd85cbdb9f64
parent 1b4927a7cf49ca277dfccb4d84ac348caec944f3
Author: Florian Dold <florian@dold.me>
Date:   Tue, 10 Aug 2021 15:26:04 +0200

refund pending case

Diffstat:
Mmerchant-spec/public-orders-get.ts | 18+++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)

diff --git 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 || "<backend pay success page>", - responseType: "empty", + responseType: "QRCodeRefundPage", + talerHeader: "taler://refund/...", }; } + return { + httpStatus: "302 Found", + contentType: "html", + redirectLocation: ord.fulfillmentUrl || "<backend pay success page>", + responseType: "empty", + }; } return { httpStatus: "200 OK",