public function __construct(array $options = null) { $this->config = Config::options($options); $composerData = json_decode(file_get_contents(__DIR__ . '/../../composer.json'), true); $partner_token = isset($options['partner_token']) ? $options['partner_token'] : ""; $this->client = new Client(['debug' => $this->config['debug'], 'base_url' => $this->config['baseUri'], 'headers' => ['Content-Type' => 'application/json', 'api-sdk' => 'opencart-0.3.1', 'partner-token' => $partner_token]]); }
public function __construct($options) { $this->config = Config::options($options); if (!isset($this->config['clientId']) || !isset($this->config['clientSecret'])) { throw new Exception('Client id or secret not found'); } $this->request = new Request($options); $this->clientId = $this->config['clientId']; $this->clientSecret = $this->config['clientSecret']; }
public function __construct(array $options = null) { $this->config = Config::options($options); $composerData = json_decode(file_get_contents(__DIR__ . '/../../composer.json'), true); $this->client = new Client(['debug' => $this->config['debug'], 'base_uri' => $this->config['baseUri'], 'headers' => ['Content-Type' => 'application/json', 'api-sdk' => 'php-' . $composerData['version']]]); }
public function __construct(array $options = null) { $this->config = Config::options($options); $this->client = new Client(['debug' => $this->config['debug'], 'base_uri' => $this->config['baseUri'], 'headers' => ['Content-Type' => 'application/json']]); }