Closed Romanavr closed 2 weeks ago
Thanks for the PR, I'll try to look at it early next week!
Hi @Romanavr , Just tagged 2.4.0 which added the multi currency support.
Hi @Romanavr , Just tagged 2.4.0 which added the multi currency support.
Thanks! Will check and let you know if something is wrong.
Hey @WHITE-developer
I get the error Amount precision is too high for currency.
when I try to pay in a currency whose exchange rate is not 1.
How to reproduce:
EUR
, I have a product variant for 100 EUR.USD
with the exchange rate, for example, 1.078
It's also worth adding that I have 21% TAX included on this product and 5 EUR shipping, see example:
Hey @Romanavr
Could you test the fix I just pushed to the develop-v2
branch if this fixes it?
Hey @Romanavr Could you test the fix I just pushed to the
develop-v2
branch if this fixes it?
Thanks for the quick this fix. This works, however another problem is that in some cases I get the following error from the Mollie API (initial problem): "The amount of the order does not match the total amount from the order lines.
"
How to reproduce:
EUR
, I have a product variant for 100
EUR.NOK
) with the exchange rate, for example, 11.7531
https://github.com/white-nl/commerce-mollie-plus/pull/21#issue-2171438197
I mentioned earlier in my PR that I ran into the same problem when I tried to fix it. We're currently using a fork with the fix suggested in the PR, and it works, so maybe you can still use something from it.
I guess the main problem is that commerce under the hood converts(or rounds) the total value again and thus we get the difference between the total amount(in decimals) sent and the calculated amount of each item in the Mollie.
Mollie Order API
always compares the total amount sent and the total amount of each item (the API itself sums the quantity * price
of each item). And if we have a difference, then an error message will be thrown above.
Hi, I tested with the same order you have but the error I got is a wrong tax amount on the lineItem, as the converted tax amount is (17.36*11.7531) = 204.03. But when calculating the included tax on the converted lineItem price (1175.31) (1175.31-1175.31/1.21) = 203.98
And this is the calculation that Mollie does, this means that we can't use the calculated tax values that Craft provides but that we'll have to do the calculations ourself
Hi, I tested with the same order you have but the error I got is a wrong tax amount on the lineItem, as the converted tax amount is (17.36*11.7531) = 204.03. But when calculating the included tax on the converted lineItem price (1175.31) (1175.31-1175.31/1.21) = 203.98
And this is the calculation that Mollie does, this means that we can't use the calculated tax values that Craft provides but that we'll have to do the calculations ourself
Yes, that's exactly what I meant. For this particular reason, we need to do the calculations manually rather than taking calculations from commerce. If you can fix this I will be grateful for it.
This is fixed in 2.5.0
@white-lukas Unfortunately, it doesn't work if I have an order with exchange order != 1 and have VAT and any discount (coupon code):
Client error: `POST https://api.mollie.com/v2/orders` resulted in a `422 unknown` response:
{"status":422,"title":"Unprocessable Entity","detail":"Order line 5 is invalid. VAT amount is off. Expected VAT amount t (truncated...)
Hi @Romanavr Could you provide the used VAT rate/method and discount, as I did test with different methods but was not able to replicate it
I've now removed the vat and discount amounts If they where applied on line item level, and just calculated them inside the line item price to further prevent the vat calculation
Description
See following PR -> https://github.com/white-nl/commerce-mollie-plus/pull/21 We recently switched to this plugin from the original Mollie plugin and after a few days we noticed something strange in the logs. It turned out that this plugin does not support other payment currencies at all.
Our client really like the support of the "Klarna Pay Later", so we decided to help you guys a bit and add crutch currency support by our own. Please look at my PR, I wrote there what I did. You can reject it or just use it as a source of inspiration, but PLEASE add currency support. If you know how to do this better, I, and others, will be very grateful to you. We have tested this code for a 2 weeks on our store and everything worked well.
Steps to reproduce
Additional info