Commit b8d4ebea authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Extract Cancel URL from Lufthansa pkpass

parent db335199
Pipeline #87845 passed with stage
in 14 minutes and 2 seconds
......@@ -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;
}
Supports Markdown
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