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:
Frane Polić
2025-04-02 13:57:44 +02:00
committed by GitHub
parent 2270f29ec5
commit a8513019db
9 changed files with 384 additions and 32 deletions
+8 -6
View File
@@ -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)