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
Description
We are experiencing some issues in a shop where we have setup various currencies for customers to pay with.
We have setup the USD as primary currency and AUD, CAD, EUR and GBP as secondary currencies. When a customer tries to pay in a secondary currency, we sometimes get rounding issues in the pay action, and then receiving the error that the payment the customer is trying to do, is a partial payment, which is not allowed. After some debugging we found out that the amount the customer wants to pay is 94.2399999 while the outstanding balance is 94.24.
Get a cart with a total cost of $94.24 and set the currency to the secondary one.
Select a gateway and perform the pay action
Expected behavior
The $paymentAmountInPrimaryCurrency should be correctly rounded of to two decimals to be the same amount as $order->getOutstandingBalance()
Additional info
Craft version: Craft Pro 3.6.17
Commerce version: 3.3.4.1
PHP version:8.0.7
Database driver & version: PostgreSQL 12.6
The text was updated successfully, but these errors were encountered:
Description
We are experiencing some issues in a shop where we have setup various currencies for customers to pay with.
We have setup the USD as primary currency and AUD, CAD, EUR and GBP as secondary currencies. When a customer tries to pay in a secondary currency, we sometimes get rounding issues in the pay action, and then receiving the error that the payment the customer is trying to do, is a partial payment, which is not allowed. After some debugging we found out that the amount the customer wants to pay is 94.2399999 while the outstanding balance is 94.24.
I've found that the following check is blocking our customers from going to the selected payment gateway.
https://github.com/craftcms/commerce/blob/develop/src/controllers/PaymentsController.php#L430
To Reproduce
How, and what happened?
Expected behavior
The
$paymentAmountInPrimaryCurrency
should be correctly rounded of to two decimals to be the same amount as$order->getOutstandingBalance()
Additional info
The text was updated successfully, but these errors were encountered: