taler-docs

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

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

header

Diffstat:
Mmerchant-spec/public-orders-get.ts | 15++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/merchant-spec/public-orders-get.ts b/merchant-spec/public-orders-get.ts @@ -33,6 +33,8 @@ interface Resp { responseType: string; // Redirect "Location: " if applicable to status code redirectLocation?: string; + // "Taler: " header in the response + talerHeader?: string; // Additional details about response response?: any; } @@ -60,7 +62,7 @@ function handlePublicOrdersGet(mos: MerchantOrderStore, req: Req): Resp { // Contract terms hash given but wrong return respForbidden(req); } - if (req.claimToken && ord.claimToken !== req.claimToken) { + if (req.claimToken && !ctOk) { // Claim token given but wrong return respForbidden(req); } @@ -165,11 +167,18 @@ function respGoto(req: Req, publicReorderUrl: string): Resp { function respUnpaid(req: Req, ord: MerchantOrderInfo): Resp { if (req.accept === "html") { - return; + return { + httpStatus: "402 Payment Required", + contentType: "html", + responseType: "StatusUnpaidResponse", + // This must include the claim token. The same taler:// + // URI should also be shown as the QR code. + talerHeader: "taler://pay/..." + }; } return { httpStatus: "402 Payment Required", - contentType: "html", + contentType: "json", responseType: "StatusUnpaidResponse", response: { // Required for repurchase detection