$enabled, 'mode' => $mode, 'sandbox' => $mode !== 'live', 'client_id' => $clientId, 'client_secret' => $clientSecret, 'currency' => $currency, 'webhook_id' => trim((string)($panelSettings['paypal_webhook_id'] ?? '')), 'email' => trim((string)($panelSettings['paypal_email'] ?? '')), 'return_url' => $returnUrl, 'cancel_url' => $cancelUrl, 'site_base' => $siteBase, 'api_base' => $mode === 'live' ? 'https://api-m.paypal.com' : 'https://api-m.sandbox.paypal.com', ); } } if (!function_exists('billing_paypal_is_ready')) { function billing_paypal_is_ready($settings) { return !empty($settings['enabled']) && !empty($settings['client_id']) && !empty($settings['client_secret']); } }