mode ? new SandboxEnvironment($merchant->clientId, $merchant->clientSecret) : new ProductionEnvironment($merchant->clientId, $merchant->clientSecret); } /** * Get http client. * * @since 2.25.0 Add custom AuthorizationInjector. * @since 2.9.0 */ public function getHttpClient(): PayPalHttpClient { return new PayPalCheckoutSdk\PayPalHttpClient($this->getEnvironment()); } /** * Get api url. * * @deprecated 2.30.1 * @since 2.9.0 * * @param string $endpoint * * @return string */ public function getApiUrl($endpoint) { $baseUrl = $this->getEnvironment()->baseUrl(); return "{$baseUrl}/$endpoint"; } /** * Get PayPal homepage url. * * @since 2.9.0 * * @return string */ public function getHomePageUrl() { return sprintf( 'https://%1$spaypal.com/', 'sandbox' === $this->mode ? 'sandbox.' : '' ); } }