예제 #1
0
 /**
  * Ask CloudSearch server to send us a new secret key
  *
  * @return void
  */
 public function requestSecretKey()
 {
     $apiKey = Config::getInstance()->QSL->CloudSearch->api_key;
     $requestUrl = 'http://' . static::CLOUD_SEARCH_DOMAIN . static::CLOUD_SEARCH_REQUEST_SECRET_KEY_URL;
     $request = new Request($requestUrl);
     $request->body = array('apiKey' => $apiKey);
     $request->sendRequest();
 }
예제 #2
0
 /**
  * Prepare request
  *
  * @param \XLite\Core\HTTP\Request $request Request
  * @param string                   $type    Request type
  * @param array                    $params  Request params
  *
  * @return \XLite\Core\HTTP\Request
  */
 protected function prepareRequest($request, $type, $params)
 {
     if ('api' === $this->getSetting('api_type') && 'certificate' === $this->getSetting('auth_method')) {
         $request->setAdditionalOption(\CURLOPT_SSLCERT, $this->getSetting('certificate'));
     }
     return parent::prepareRequest($request, $type, $params);
 }
예제 #3
0
 public function setContentType($value)
 {
     $this->request->setHeader('Content-Type', $value);
 }
예제 #4
0
 /**
  * Prepare request object
  *
  * @param \XLite\Core\HTTP\Request $request Request object
  * @param array                    $params  Request params
  *
  * @return \XLite\Core\HTTP\Request
  */
 protected function prepareMerchantCredentialsRequest($request, $params)
 {
     $request->verb = 'GET';
     $accessToken = $this->getAccessToken(static::CLIENT_ID, static::CLIENT_SECRET);
     if (is_array($accessToken) && $accessToken['access_token']) {
         $request->setHeader('Authorization', sprintf('Bearer %s', $accessToken['access_token']));
     }
     return $request;
 }
예제 #5
0
파일: Login.php 프로젝트: kirkbauer2/kirkxc
 /**
  * Prepare request
  *
  * @param \XLite\Core\HTTP\Request $request Request
  * @param string                   $type    Request type
  * @param array                    $params  Request params
  *
  * @return \XLite\Core\HTTP\Request
  */
 protected function prepareRequest($request, $type, $params)
 {
     $request->setHeader('Accept', 'application/json');
     $request->setHeader('Accept-Language', 'en_US');
     $request->setHeader('Content-Type', 'application/x-www-form-urlencoded');
     $authorization = base64_encode(sprintf('%s:%s', \Xlite\Core\Config::getInstance()->CDev->Paypal->loginClientId, \Xlite\Core\Config::getInstance()->CDev->Paypal->loginClientSecret));
     $request->setHeader('Authorization', sprintf('Basic %s', $authorization));
     return parent::prepareRequest($request, $type, $params);
 }