/** * make account config & return * * @return \Nikapps\BazaarApiPhp\Configs\AccountConfig */ public function getAccountConfig() { if (!$this->accountConfig) { $accountConfig = new AccountConfig(); $accountConfig->setClientId($this->config->get('bazaar-api-laravel::credentials.client_id')); $accountConfig->setClientSecret($this->config->get('bazaar-api-laravel::credentials.client_secret')); $accountConfig->setRedirectUri($this->config->get('bazaar-api-laravel::credentials.redirect_uri')); $accountConfig->setRefreshToken($this->config->get('bazaar-api-laravel::credentials.refresh_token')); $this->accountConfig = $accountConfig; } return $this->accountConfig; }
/** * fill account config & return * * @param $code * @param $redirectUrl * @return \Nikapps\BazaarApiPhp\Configs\AccountConfig */ protected function getAccountConfig($code, $redirectUrl) { $accountConfig = new AccountConfig(); $accountConfig->setClientId($this->config->get('bazaar-api-laravel::credentials.client_id')); $accountConfig->setClientSecret($this->config->get('bazaar-api-laravel::credentials.client_secret')); $accountConfig->setRedirectUri($redirectUrl); $accountConfig->setCode($code); return $accountConfig; }