fix: guard paypal plan sync against runtime exceptions
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user