File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
packages/core/core-flows/src Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @medusajs/core-flows " : patch
3
+ ---
4
+
5
+ fix(core-flows): refresh payment collection using raw total
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ export const refreshPaymentCollectionForCartWorkflow = createWorkflow(
120
120
return {
121
121
selector : { id : cart . payment_collection . id } ,
122
122
update : {
123
- amount : cart . total ,
123
+ amount : cart . raw_total ,
124
124
currency_code : cart . currency_code ,
125
125
} ,
126
126
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export const getLastPaymentStatus = (order: OrderDetailDTO) => {
26
26
( isDefined ( paymentCollection . amount ) &&
27
27
MathBN . eq ( paymentCollection . amount , 0 ) )
28
28
) {
29
- paymentStatus [ PaymentStatus . CAPTURED ] += MathBN . eq (
29
+ paymentStatus [ PaymentStatus . CAPTURED ] += MathBN . gte (
30
30
paymentCollection . captured_amount as number ,
31
31
paymentCollection . amount
32
32
)
@@ -35,7 +35,7 @@ export const getLastPaymentStatus = (order: OrderDetailDTO) => {
35
35
}
36
36
37
37
if ( MathBN . gt ( paymentCollection . refunded_amount ?? 0 , 0 ) ) {
38
- paymentStatus [ PaymentStatus . REFUNDED ] += MathBN . eq (
38
+ paymentStatus [ PaymentStatus . REFUNDED ] += MathBN . gte (
39
39
paymentCollection . refunded_amount as number ,
40
40
paymentCollection . amount
41
41
)
You can’t perform that action at this time.
0 commit comments