You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After adding products to a cart with a price of $0, completed the order using the system default payment provider and captured the $0 amount, the order didn't update to captured. I think this is because how Medusa handles the captured state:
if (MathBN.gt(paymentCollection.captured_amount ?? 0, 0)) {
paymentStatus[PaymentStatus.CAPTURED] += MathBN.eq(
paymentCollection.captured_amount as number,
paymentCollection.amount
)
? 1
: 0.5
}
But if a free order then captured amount is 0. If think if: captured_amount === captured_amount === amount === 0 then mark it as captured.
What do you think?
Thanks!
Expected behavior
Should be marked as captured.
Actual behavior
Is marked as awaiting
Link to reproduction repo
not apply
The text was updated successfully, but these errors were encountered:
Package.json file
Node.js version
v20.17.0
Database and its version
PostgreSQL 13.16
Operating system name and version
MacOS 14.0 (23A344)
Browser name
No response
What happended?
After adding products to a cart with a price of $0, completed the order using the
system
default payment provider and captured the $0 amount, the order didn't update tocaptured
. I think this is because how Medusa handles the captured state:But if a free order then captured amount is 0. If think if:
captured_amount === captured_amount === amount === 0
then mark it ascaptured
.What do you think?
Thanks!
Expected behavior
Should be marked as
captured
.Actual behavior
Is marked as
awaiting
Link to reproduction repo
not apply
The text was updated successfully, but these errors were encountered: