wallee-payment / shopware-6

Wallee integration for Shopware 6.5 and greater

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

non-string product option breaks payment process

darinda opened this issue · comments

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.