fix(core-flows): return refunded when all captured payments have been refunded (#10923)
what: - returns refunded when all captured payments have been refunded
This commit is contained in:
5
.changeset/sixty-peaches-hug.md
Normal file
5
.changeset/sixty-peaches-hug.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/core-flows": patch
|
||||
---
|
||||
|
||||
fix(core-flows): return refunded when all captured payments have been refunded
|
||||
@@ -55,7 +55,10 @@ export const getLastPaymentStatus = (order: OrderDetailDTO) => {
|
||||
}
|
||||
|
||||
if (paymentStatus[PaymentStatus.REFUNDED] > 0) {
|
||||
if (paymentStatus[PaymentStatus.REFUNDED] === totalPaymentExceptCanceled) {
|
||||
if (
|
||||
paymentStatus[PaymentStatus.REFUNDED] ===
|
||||
paymentStatus[PaymentStatus.CAPTURED]
|
||||
) {
|
||||
return PaymentStatus.REFUNDED
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user