SyliusMolliePlugin icon indicating copy to clipboard operation
SyliusMolliePlugin copied to clipboard

Fetching available methods for orders with an orderTotal of less than 1 doesn't work

Open JoppeDC opened this issue 3 years ago • 0 comments

If the order total is less than 1, the total is formatted wrongly.

Eg.

The total is €0,35. The value stored is "35".

The plugin formats this value to a string, for the mollie API. The formatted value is ".35" instead of "0.35".

This causes the mollie api to return an exception, which is caught in the MolliePaymentsMethodResolver, and we get no available mollie methods.

The problem is in the parseTotalToString of the MollieAllowedMethodsResolver, as you can see here: https://sandbox.onlinephpfunctions.com/c/01ecc

API error:

field: "amount.value"
message: "(400: Bad Request): The amount contains an invalid value.

JoppeDC avatar Apr 20 '22 09:04 JoppeDC