summaryrefslogtreecommitdiff
path: root/merchant-spec
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-08-10 15:16:43 +0200
committerFlorian Dold <florian@dold.me>2021-08-10 15:16:43 +0200
commit1b4927a7cf49ca277dfccb4d84ac348caec944f3 (patch)
tree9071f792c8d832e1633631422cdb4efdde660d5b /merchant-spec
parenta2cef959c0cf801e9f4136736dd8e8e8d98838af (diff)
downloaddocs-1b4927a7cf49ca277dfccb4d84ac348caec944f3.tar.gz
docs-1b4927a7cf49ca277dfccb4d84ac348caec944f3.tar.bz2
docs-1b4927a7cf49ca277dfccb4d84ac348caec944f3.zip
header
Diffstat (limited to 'merchant-spec')
-rw-r--r--merchant-spec/public-orders-get.ts15
1 files changed, 12 insertions, 3 deletions
diff --git a/merchant-spec/public-orders-get.ts b/merchant-spec/public-orders-get.ts
index 03c4f7af..b256860c 100644
--- 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