wallee-payment / shopware-6

Wallee integration for Shopware 6.5 and greater
Apache License 2.0
3 stars 5 forks source link

non-string product option breaks payment process #9

Open darinda opened 1 year ago

darinda commented 1 year ago

When the cart contains a cart item that has a custom option value which is NOT of type string (i.e int) a fatal error will arise, causing the payment process to fail.

request.CRITICAL: Uncaught PHP Exception TypeError: "WalleePayment\Core\Util\Payload\AbstractPayload::fixLength(): Argument #1 ($string) must be of type string, int given, called in [...]/vendor/wallee/shopware-6/src/Core/Util/Payload/TransactionPayload.php on line 402

The code expects all values to be of type string which is not necessarily the case.

Casting the value to string is safe and fixes the problem.