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(
120120 return {
121121 selector : { id : cart . payment_collection . id } ,
122122 update : {
123- amount : cart . total ,
123+ amount : cart . raw_total ,
124124 currency_code : cart . currency_code ,
125125 } ,
126126 }
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export const getLastPaymentStatus = (order: OrderDetailDTO) => {
2626 ( isDefined ( paymentCollection . amount ) &&
2727 MathBN . eq ( paymentCollection . amount , 0 ) )
2828 ) {
29- paymentStatus [ PaymentStatus . CAPTURED ] += MathBN . eq (
29+ paymentStatus [ PaymentStatus . CAPTURED ] += MathBN . gte (
3030 paymentCollection . captured_amount as number ,
3131 paymentCollection . amount
3232 )
@@ -35,7 +35,7 @@ export const getLastPaymentStatus = (order: OrderDetailDTO) => {
3535 }
3636
3737 if ( MathBN . gt ( paymentCollection . refunded_amount ?? 0 , 0 ) ) {
38- paymentStatus [ PaymentStatus . REFUNDED ] += MathBN . eq (
38+ paymentStatus [ PaymentStatus . REFUNDED ] += MathBN . gte (
3939 paymentCollection . refunded_amount as number ,
4040 paymentCollection . amount
4141 )
You can’t perform that action at this time.
0 commit comments