Adyen/adyen-magento2

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

Opened this issue · 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

Hi @Nuranto,

Thank you for reporting this issue. I have created an internal ticket to address this issue, adding a check for the order.
One the fix PR is merged, this issue will automatically be closed.

Kind regards,
Rok

Hi
We meet this issue with all orders involving a zero total (i.e. "free" payment method), preventing any of these orders to be placed :(