diff --git a/app/configurations/config.jyvaskyla.js b/app/configurations/config.jyvaskyla.js index af6d6ecd6d..a536b24eb1 100644 --- a/app/configurations/config.jyvaskyla.js +++ b/app/configurations/config.jyvaskyla.js @@ -173,19 +173,6 @@ export default configMerger(walttiConfig, { transferPenalty: 1600, }, - ticketPurchaseLink: function purchaseTicketLink(fare) { - const fareId = fare.fareProducts[0].product.id; - const ticket = fareId?.substring - ? fareId.substring(fareId.indexOf(':') + 1) - : ''; - let zones = ''; - // Waltti wants zone ids, so map A to 01, B to 02 etc - for (let i = 0; i < ticket.length; i++) { - zones += `0${ticket.charCodeAt(i) - 64}`; // eslint-disable - } - return `https://waltti.fi/walttiapp/busTicket/?operator=50209&ticketType=single&customerGroup=adult&zones=${zones}`; - }, - fareMapping: function mapFareId(fareId) { const id = fareId?.substring?.(fareId.indexOf(':') + 1); switch (id) { diff --git a/app/configurations/config.lahti.js b/app/configurations/config.lahti.js index 0108763dbd..1119e1cbf2 100644 --- a/app/configurations/config.lahti.js +++ b/app/configurations/config.lahti.js @@ -186,19 +186,6 @@ export default configMerger(walttiConfig, { transferPenalty: 1600, }, - ticketPurchaseLink: function purchaseTicketLink(fare) { - const fareId = fare.fareProducts[0].product.id; - const ticket = fareId?.substring - ? fareId.substring(fareId.indexOf(':') + 1) - : ''; - let zones = ''; - // Waltti wants zone ids, so map A to 01, B to 02 etc - for (let i = 0; i < ticket.length; i++) { - zones += `0${ticket.charCodeAt(i) - 64}`; // eslint-disable - } - return `https://kauppa.waltti.fi/walttiappfeat/busTicket/?operator=50223&ticketType=single&customerGroup=adult&zones=${zones}`; - }, - fareMapping: function mapFareId(fareId) { const id = fareId?.substring?.(fareId.indexOf(':') + 1); switch (id) { diff --git a/app/configurations/config.waltti.js b/app/configurations/config.waltti.js index 68853ea50f..97fb8ac875 100644 --- a/app/configurations/config.waltti.js +++ b/app/configurations/config.waltti.js @@ -267,4 +267,17 @@ export default { value: 600, }, ], + + ticketPurchaseLink: function purchaseTicketLink(fare) { + const fareId = fare.fareProducts[0].product.id; + const ticket = fareId?.substring + ? fareId.substring(fareId.indexOf(':') + 1) + : ''; + let zones = ''; + // Waltti wants zone ids, so map A to 01, B to 02 etc + for (let i = 0; i < ticket.length; i++) { + zones += `0${ticket.charCodeAt(i) - 64}`; // eslint-disable + } + return `https://waltti.fi/walttiapp/busTicket/?operator=50209&ticketType=single&customerGroup=adult&zones=${zones}`; + }, };