diff --git a/app/app/Http/Controllers/Dashboard/AdminDashboardController.php b/app/app/Http/Controllers/Dashboard/AdminDashboardController.php index 439006c..f8148fa 100644 --- a/app/app/Http/Controllers/Dashboard/AdminDashboardController.php +++ b/app/app/Http/Controllers/Dashboard/AdminDashboardController.php @@ -332,8 +332,19 @@ class AdminDashboardController extends Controller public function syncPaypalPlans(PayPalPlanSyncService $sync): RedirectResponse { - $resultSandbox = $sync->sync('sandbox'); - $resultLive = $sync->sync('live'); + try { + $resultSandbox = $sync->sync('sandbox'); + $resultLive = $sync->sync('live'); + } catch (\Throwable $e) { + report($e); + $this->logAdminAction('paypal_plan_sync_failed', [ + 'error' => $e->getMessage(), + ]); + + return back()->withErrors([ + 'pricing' => 'PayPal sync failed. Check server logs for details (network/credentials/proxy).', + ]); + } $this->logAdminAction('paypal_plan_sync', [ 'sandbox' => $resultSandbox,