fix(core-flows,dashboard): handling authorized payment collection on OE (#11958)
* wip: handling authorized payment collection on OE * fix: update condition * fix: condition for creation * chore: remove commented code * chore: changeset, refactor * chore: typo, comments * fix: add a test case * fix: reorg workflows, partially captured * fix: status enum type
This commit is contained in:
@@ -12,10 +12,12 @@ export const getTotalCaptured = (
|
||||
}, 0)
|
||||
|
||||
export const getTotalPending = (paymentCollections: AdminPaymentCollection[]) =>
|
||||
paymentCollections.reduce((acc, paymentCollection) => {
|
||||
acc +=
|
||||
(paymentCollection.amount as number) -
|
||||
(paymentCollection.captured_amount as number)
|
||||
paymentCollections
|
||||
.filter((pc) => pc.status !== "canceled")
|
||||
.reduce((acc, paymentCollection) => {
|
||||
acc +=
|
||||
(paymentCollection.amount as number) -
|
||||
(paymentCollection.captured_amount as number)
|
||||
|
||||
return acc
|
||||
}, 0)
|
||||
return acc
|
||||
}, 0)
|
||||
|
||||
Reference in New Issue
Block a user