method = $method; } public static function get(AbstractMethodPaypal $method) { if ($method->isSandbox()) { $environment = new SandboxEnvironment($method->getClientId(), $method->getSecret()); } else { $environment = new ProductionEnvironment($method->getClientId(), $method->getSecret()); } $client = new PayPalHttpClient($environment); return $client; } }