adyen-magento2 icon indicating copy to clipboard operation
adyen-magento2 copied to clipboard

[ECP-9229] Undefined array key "order" in Plugin/GraphQlPlaceOrderAddCartId.php on line 63

Open Nuranto opened this issue 1 year ago • 2 comments

Describe the bug

Some of our clients (very small proportion) cannot place order (Internal Server Error)

We were not able to reproduce, so we don't know how. But we found this error in logs :

`main.ERROR: Warning: Undefined array key "order" in /var/www/html/vendor/adyen/module-payment/Plugin/GraphQlPlaceOrderAddCartId.php on line 63`

And indeed, that plugin does not take into consideration that original method can return an array without order :

        if ($this->errors) {
            return [
                'errors' =>
                    $this->errors
            ];
        }
        return [
            'order' => [
                'order_number' => $order->getIncrementId(),
                // @deprecated The order_id field is deprecated, use order_number instead
                'order_id' => $order->getIncrementId(),
            ],
            'orderV2' => $this->orderFormatter->format($order),
            'errors' => []
        ];

Magento version 2.4.7

Plugin version 9.4.1

Nuranto avatar May 23 '24 13:05 Nuranto