'dispatch_order', 'drivers_ids' => json_encode([$targetDriverId]), 'payload' => $finalPayload // 🔥 هنا نرسل المصفوفة وليس كائناً ]; // إرسال الطلب $ch = curl_init($socketUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "x-internal-key: $INTERNAL_KEY" ]); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo "Response Code: $httpCode\n"; if ($response == 'Dispatched') { echo "✅ Success! Order List sent to driver.\n"; } else { echo "❌ Failed: $response\n"; } ?>