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.
This commit is contained in:
parent
5d6fcdd78d
commit
9a407c2a38
1 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue