-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capture request for invoice payment method always fails for tax-free orders and notifications are stuck in processing due to Throwable not handled #552
Comments
Created PR #553 |
any news regarding this? |
Hi @AndreasA , This is just a quick note to inform you that we received your ticket and have already started working on resolving your issue. If you have any further questions or concerns, please let us know. Best regards |
Hi @AndreasA , We have found and fixed the issue with handling tax-free orders. The fix will be included in the next plugin release. Once the update is available, we will let you know. Thank you for your patience, and please feel free to reach out if you have any further questions or concerns. Best regards |
@teodoratimoti Something seems to be wrong with the 3.17.2 release, see issue: #591 also the second part regarding Throwable not being handled correctly is still an issue: |
Hi @AndreasA , We have released a new version v3.17.3 which includes a fix for the issue you mentioned. Could you please update to this version and check if the problem persists? https://github.com/Adyen/adyen-shopware6/releases/tag/3.17.3 This fix is also included in v4.2.2 which you can download here: https://github.com/Adyen/adyen-shopware6/releases/tag/4.2.2 If you encounter any further issues, feel free to let us know. Best regards |
Describe the bug
If an order is tax free, the capture request cannot be built for the line items as determining the tax-rate fails with
Call to a member function getPercentage() on null
in ProcessNotifications (if done through notifications - same for manual capture).As this is a
\Throwable
which is not caught by\Exception
, it will also not be handled by the catch block in the notifications handlerhttps://github.com/Adyen/adyen-shopware6/blob/develop/src/ScheduledTask/ProcessNotificationsHandler.php#L247
for v3.15.0 https://github.com/Adyen/adyen-shopware6/blob/3.15.0/src/ScheduledTask/ProcessNotificationsHandler.php#L242
This could be changed to
\Throwable
as that will catch excpetions an throwables.Therefore, the notification is stuck in processing state, and the error does not show up in any log. Only if one is running the corresponding command, will it show up in the output.
The error itself occurs due to the line
$lineItem->getPrice()->getTaxRules()->highestRate()->getPercentage() * 10
in the capture service: https://github.com/Adyen/adyen-shopware6/blob/develop/src/Service/CaptureService.php#L341for v3.15.0 https://github.com/Adyen/adyen-shopware6/blob/3.15.0/src/Service/CaptureService.php#L341
For tax free orders, the tax rules are empty, therefore, the highest rate is null. In new PHP version, this could be fixed like this:
($lineItem->getPrice()->getTaxRules()->highestRate()?->getPercentage() ?? 0) * 10
.So two changes are necessary (see above) to fully fix the issues.
Versions
Shopware version: 6.5.8.14
Plugin version: 3.15.0
The text was updated successfully, but these errors were encountered: