pronamic / wp-pronamic-pay-mollie

Mollie driver for the WordPress payment processing library.
http://www.wp-pay.org/gateways/mollie/
6 stars 1 forks source link

Error 'Payment line VAT rate is required' for WooCommerce order with free shipping #25

Closed rvdsteege closed 1 year ago

rvdsteege commented 1 year ago

When placing a WooCommerce order with free shipping and using the Klarna payment method, the following error occurred and I was unable to pay for my order:

Payment line VAT rate is required.

This occurs because there is an order item for shipping, but as $rates is empty the percentage stays null in https://github.com/pronamic/wp-pronamic-pay-woocommerce/blob/2ae572d430d558f1ee6e0468b0f73c31fe515777/src/Gateway.php#L742-L766

When transforming the payment lines to Mollie lines for an order request, the error is triggered.

https://github.com/pronamic/wp-pronamic-pay-mollie/blob/cd2cbadfeab5ec377e78a96ddef6beffb3a1aba7/src/Gateway.php#L823-L830

https://github.com/pronamic/wp-pronamic-pay-mollie/blob/88abf0be0ca4dfbbccb62b2ef265a5f3fe5d656e/src/LinesTransformer.php#L56-L60

remcotolsma commented 1 year ago

Fixed in https://github.com/pronamic/wp-pronamic-pay-woocommerce/commit/61fe876bf2d2d9d70435148cb027eb3a6c485cee.

Scherm­afbeelding 2023-03-13 om 15 49 36