From 9a407c2a38c6d0d7ea95c3d5ded0b663491d1880 Mon Sep 17 00:00:00 2001 From: Jennie Robinson Faber Date: Sun, 19 Apr 2026 18:32:08 +0100 Subject: [PATCH] fix(billing): exclude verify + zero-amount rows from payment history Helcim's card-transactions list includes auth-only "verify" rows and $0 entries that have no value on the member-facing history. --- server/utils/helcim.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/utils/helcim.js b/server/utils/helcim.js index 11b4775..c62c628 100644 --- a/server/utils/helcim.js +++ b/server/utils/helcim.js @@ -191,7 +191,13 @@ export async function listHelcimCustomerTransactions(customerCode) { ? response : (response?.transactions || response?.data || []) - const sorted = [...rows].sort((a, b) => { + const filtered = rows.filter((t) => { + const type = String(t?.type || '').toLowerCase() + const amount = typeof t?.amount === 'number' ? t.amount : Number(t?.amount) || 0 + return type !== 'verify' && amount > 0 + }) + + const sorted = [...filtered].sort((a, b) => { const da = Date.parse(a?.dateCreated || '') || 0 const db = Date.parse(b?.dateCreated || '') || 0 return db - da