Closed FloWord closed 1 year ago
Dear FloWord
This is a PHP rounding issue, that needs to be solved on merchants servers individually.
PHP precision is a PHP server config issue that the wallee plugin has no control over. That is why we have the line item consistency setting.
For a general solution, you can turn off the line-item-consistency option: https://plugin-documentation.wallee.com/wallee-payment/magento-2/1.3.15/docs/en/documentation.html#_line_items
Best regards
Dear @theodorspringwallee thanks for your support.
i tried to upgrade again to 1.3.15 and disable this settings but now i got this error:
[2023-01-23 16:18:50] main.CRITICAL: Error 442 connecting to the API (https://app-wallee.com/api/transaction/create?spaceId=33XX) : {"date":"2023-01-23T15:18:50.863Z","defaultMessage":"The number 0.000000000000056843418860808 needs to have at most 11 integer digits and at most 8 decimal digits.","id":"7Q54f1bypemlltR8LcA07ZzwkfZWvvy4CPNUr8D93b4 (2023-01-23T15:18:50.863Z)","message":"The number 0.000000000000056843418860808 needs to have at most 11 integer digits and at most 8 decimal digits.","type":"DEVELOPER_ERROR"} {"exception":"[object] (Wallee\\Sdk\\ApiException(code: 442): Error 442 connecting to the API (https://app-wallee.com/api/transaction/create?spaceId=33XX) : {\"date\":\"2023-01-23T15:18:50.863Z\",\"defaultMessage\":\"The number 0.000000000000056843418860808 needs to have at most 11 integer digits and at most 8 decimal digits.\",\"id\":\"7Q54f1bypemlltR8LcA07ZzwkfZWvvy4CPNUr8D93b4 (2023-01-23T15:18:50.863Z)\",\"message\":\"The number 0.000000000000056843418860808 needs to have at most 11 integer digits and at most 8 decimal digits.\",\"type\":\"DEVELOPER_ERROR\"} at /var/www/domain/repo/htdocs/magento/src/vendor/wallee/sdk/lib/ApiClient.php:495)"} []
Any idea whats wrong now?
Thank you
Dear FloWord
I think It's again about your PHP settings. Please ensure that you have not more than 8 digits after the amount separator.
From other customers I do not know such an issue, so I guess you have made some additional configurations within PHP or with your server settings in general, or you have a special environment, where your shop is running.
For further help, please contact info@wallee.com
Best regards
We have a very similar issue:
[2023-01-24T15:04:42.794508+00:00] report.CRITICAL: Wallee\Sdk\ApiException: Error 442 connecting to the API (https://app-wallee.com/api/transaction/create?spaceId=12345) : {"date":"2023-01-24T15:04:42.519Z","defaultMessage":"The discount including tax of 0.00000000000000022204460492503 needs to be rounded to '2' decimal places accordingly to the currency.","id":"yFzUg4RGs6copRjG10dPJObHiUKWw-qc_v2kD34YATA (2023-01-24T15:04:42.519Z)","message":"The discount including tax of 0.00000000000000022204460492503 needs to be rounded to '2' decimal places accordingly to the currency.","type":"DEVELOPER_ERROR"} in /var/www/html/vendor/wallee/sdk/lib/ApiClient.php:495
Stack trace:
#0 /var/www/html/vendor/wallee/sdk/lib/Service/TransactionService.php(384): Wallee\Sdk\ApiClient->callApi('/transaction/cr...', 'POST', Array, Object(Wallee\Sdk\Model\TransactionCreate), Array, '\\Wallee\\Sdk\\Mod...', '/transaction/cr...')
#1 /var/www/html/vendor/wallee/sdk/lib/Service/TransactionService.php(316): Wallee\Sdk\Service\TransactionService->createWithHttpInfo('12345', Object(Wallee\Sdk\Model\TransactionCreate))
#2 /var/www/html/vendor/wallee/magento-2/Model/Service/Quote/TransactionService.php(267): Wallee\Sdk\Service\TransactionService->create('12345', Object(Wallee\Sdk\Model\TransactionCreate))
[...]
@theodorspringwallee, this is not a PHP server setting. You guys broke it here:
Previously, you used PHP's round
with two decimal digits. Now in the new version, you use \Magento\Framework\Pricing\Helper\Data::currency
, which does not apply any rounding. This is why certain cases now break as outlined by @FloWord.
This is a critical issue and needs to be fixed ASAP.
Currently, in our showcase, we can't reproduce this issue: https://magento-2.showcase-wallee.com/
Since your amounts in the API error message is nearly to zero I also tried with a Magento 2 coupon, but I still can proceed such an order:
Please, can you tell us, how exactly we can reproduce this issue?
Best regards
It probably depends on the prices and maybe even on the tax settings. I could reproduce it with the following cart on our systems:
Can you reproduce it with these prices?
Even if you can't, the issue is still pretty clear when looking at the code.
Dear sprankhub
Even with these prices, it's not reproducible:
As you proposed, we will continue the fixing of this issue on the code level, about the Magento\Framework\Pricing\Helper\Data
object, which does not apply the rounding.
Best regards
@theodorspringwallee , please try to set a tax class to the shipping costs, if you did not try that, yet. In my tests, everything still works more or less, as long as I use a shipping method which is for free. As soon as I switch to another shipping method, the error comes up.
Dear norgeindian
Thank you for the input. Unfortunately, this reproduction step, didn't work within our showcase.
But one of our developers could (sporadically) reproduce this issue and tries to fix this issue now.
Best regards
Hello @theodorspringwallee i updated now from 1.3.14
to 1.3.16
. It works! Thanks for this quick fix.
We updated from
1.3.14
to1.3.15
. Now we got this error message in checkout:main.CRITICAL: The line item total amount of 263.04 does not match the expected amount of 263.04. {"exception":"[object] (Exception(code: 0): The line item total amount of 263.04 does not match the expected amount of 263.04. at /var/www/domain/repo/htdocs/magento/src/vendor/wallee/magento-2/Helper/LineItem.php:101)"} []
We found this in
vendor/wallee/magento-2/Helper/LineItem.php
The issue because: 188.17 - 188.17 = -0.00...0284 the value is NOT ZERO
Can you solve this rounding problem?