From 44b7abcab7d7a828f7aa8f928502f23cae0b0fb7 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Wed, 4 Dec 2024 16:08:27 +1100 Subject: [PATCH] Limit Payment tokens found to ones that work with the selected payment processor and handle for tokens created by legacy eway recurring payment processor --- js/eway.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/eway.js b/js/eway.js index b30d637..95284ae 100644 --- a/js/eway.js +++ b/js/eway.js @@ -9,6 +9,7 @@ CRM.eway.setPaymentTokenOptions = async function () { where: [ ['contact_id', '=', CRM.eway.contact_id], ['expiry_date', '>', 'now'], + ['payment_processor_id', '=', CRM.eway.ppid], ], orderBy: {expiry_date: 'DESC'} }); @@ -37,7 +38,13 @@ CRM.eway.updateOptions = function (values) { month = '0' + month; } - html += ``; + // Handle for tokens created via the legacy payment processor. + if (value.masked_account_number) { + html += ``; + } + else { + html += ``; + } } const $select = CRM.$('#contact_payment_token');