diff options
author | Florian Dold <florian@dold.me> | 2021-08-10 15:26:04 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-08-10 15:26:04 +0200 |
commit | b010ac83f8a668a5425b445bb913cd85cbdb9f64 (patch) | |
tree | b69c6892b4ff1c775f702edc8bca1f8c048cb947 /merchant-spec | |
parent | 1b4927a7cf49ca277dfccb4d84ac348caec944f3 (diff) | |
download | docs-b010ac83f8a668a5425b445bb913cd85cbdb9f64.tar.gz docs-b010ac83f8a668a5425b445bb913cd85cbdb9f64.tar.bz2 docs-b010ac83f8a668a5425b445bb913cd85cbdb9f64.zip |
refund pending case
Diffstat (limited to 'merchant-spec')
-rw-r--r-- | merchant-spec/public-orders-get.ts | 18 |
1 files changed, 13 insertions, 5 deletions
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 || "<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", |