mollie / Shopware6

MIT License
51 stars 53 forks source link

Error executing API call (422: Unprocessable Entity) VAT problem #63

Closed glittrnl closed 3 years ago

glittrnl commented 3 years ago

Hello,

I am using Shopware version 6.3.3.1 and mollie module version 1.3.8

I am experiencing the following problem in the next situation:

I have a discount activated with the rule for every "New customer". When you are not logged into the website and trying to make an order as guest this discount will automatically be added to your bill as soon as you passed the checkout step "customer information". This is the last step before payment. If you press the "go to payment" button -> instead of going to the mollie page you get an error on site and payment can not be completed.

In shopware logging I get this error:

Could not create Mollie order, error: [2020-12-17T20:28:52+0000] Error executing API call (422: Unprocessable Entity): Order line 2 is invalid. VAT amount is off. Expected VAT amount to be -€0.31 (-€1.76 × (21.00% / 121.00%)), got -€0.30. Field: lines.2.v

In short: _1. Discount automatically added to bill on last step before payment.

  1. clicking go to payment button returns error and payment can not be completed_

Thank you, Heiko

Mochten er vragen zijn dan hoor ik het graag.

glittrnl commented 3 years ago

This next error is unrelated to the discount rule mentioned above. the logging error is also different.

ERROR: Could not create Mollie order, error: [2020-12-18T08:00:10+0000] Error executing API call (422: Unprocessable Entity): Order line 3 is invalid. The field 'imageUrl' should be a valid URL.. Field: lines.3.imageUrl. Documentation: https://docs.mollie.com/gu Fout (400)

{ "source": "mollie_payments", "additionalData": { "function": "order-prepare", "error": { "message": "Could not create Mollie order, error: [2020-12-18T08:00:10+0000] Error executing API call (422: Unprocessable Entity): Order line 3 is invalid. The field 'imageUrl' should be a valid URL.. Field: lines.3.imageUrl. Documentation: https://docs.mollie.com/guides/handling-errors", "trace": [ { "file": "/var/www/clients/client2/web31/web/custom/plugins/MolliePayments/src/Handler/PaymentHandler.php", "line": 227, "function": "createOrderAtMollie", "class": "Kiener\MolliePayments\Handler\PaymentHandler", "type": "->", "args": [ { "amount": { "currency": "EUR", "value": "47.88" }, "redirectUrl":

---> LONG return URL.

Tested this: This error occurs when there is a %20 in the url of the image. when i remove the spaces in the url of the image the error is gone and payment can continue...

I think these problems came after upgrading from 1.3.7 to 1.3.8

milan-kiener commented 3 years ago

@glittrnl The first error you report relates to the VAT rounding for discounts. This is a known issue on the Shopware side. Shopware has released a fix for this in 6.3.4.x. Updating to that version or higher should solve this problem.

The second reported issue relates to a recent API change and the changes we made for that in the plugin. We will release a quick fix for this tomorrow at the latest.

glittrnl commented 3 years ago

Thank you for your response!