October 21Oct 21 PayPal Checkout Pro v0.0.1 - by thirty bees Thirty Bees 1.7.0 PHP 8.3.35 The following warning is in the error log: [20-Oct-2026 13:55:14 US/Eastern] PHP Warning: Undefined array key "intent" in /...../shop/modules/tbpaypalcheckout/src/Model/PayPalOrder.php on line 125 This occurred at the same time a user was making a purchase. Here is the source block - possibly change to use the Null Coalescing Operator as a fix? public static function createFromPayPalOrder(Logger $logger, int $cartId, array $paypalOrder): ?PayPalOrder { $order = new static(); $order->id_cart = (int)$cartId; $order->paypal_order_id = (string)$paypalOrder['id']; $order->paypal_status = (string)$paypalOrder['status']; $order->intent = (string)$paypalOrder['intent']; // Extract amount and currency if (isset($paypalOrder['purchase_units'][0]['amount'])) { $order->amount = (float)$paypalOrder['purchase_units'][0]['amount']['value']; $order->currency = (string)$paypalOrder['purchase_units'][0]['amount']['currency_code']; } $order->date_add = date('Y-m-d H:i:s'); $order->date_upd = date('Y-m-d H:i:s'); if ($order->save()) { $logger->debug('PayPal order saved to database', [ 'id_tbpaypal_order' => $order->id, 'paypal_order_id' => $order->paypal_order_id, 'cart_id' => $cartId ]); return $order; } return null; }
Create an account or sign in to comment