Skip to content

Commit

Permalink
Updating the solution for the Guzzle URL flexiblility
Browse files Browse the repository at this point in the history
  • Loading branch information
toddcornett committed Jan 9, 2020
1 parent 97ffe2a commit d494fdf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Restforce.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Restforce implements RestforceInterface

private const DEFAULT_API_VERSION = 'v38.0';
private const DEFAULT_AUTH_URL = 'https://login.salesforce.com';
private const DEFAULT_GUZZLE_URL = 'https://na1.salesforce.com';

/** @var string */
private $clientId;
Expand All @@ -29,6 +30,8 @@ class Restforce implements RestforceInterface
private $apiVersion;
/** @var string */
private $authUrl;
/** @var string */
private $guzzleUrl;
/** @var OAuthRestClient|null */
private $oAuthRestClient;

Expand All @@ -51,6 +54,7 @@ public function __construct(

if ($authUrl === null) {
$authUrl = self::DEFAULT_AUTH_URL;
$guzzleUrl = self::DEFAULT_GUZZLE_URL;
}

$this->apiVersion = $apiVersion;
Expand All @@ -60,6 +64,7 @@ public function __construct(
$this->username = $username;
$this->password = $password;
$this->authUrl = $authUrl;
$this->guzzleUrl = isset($guzzleUrl) ? $guzzleUrl : $authUrl;
}

public function create(string $sobjectType, array $data): ResponseInterface
Expand Down

0 comments on commit d494fdf

Please sign in to comment.