Commit 09c03384 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇 Committed by Volker Krause
Browse files

Extract Cancel URL from Lufthansa pkpass

parent 5ae2266b
......@@ -21,5 +21,15 @@ function main(pass, node)
res.underName.name = passengerName.value;
}
const back = pass.backFields;
const cancelLink = back.find(item => item.key === "cancel");
if (cancelLink) {
const cancelUrl = cancelLink.value.match(/https:\/\/mobile.lufthansa.com\/service\/checkin\?[A-Z0-9=&]*[A-Z0-9=&]/i);
if (cancelUrl) {
res.potentialAction = JsonLd.newObject("CancelAction");
res.potentialAction.url = cancelUrl[1];
}
}
return res;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment