Set the timeout and do a sync request to the Terminal API endpoint

@param array $request
@param int $storeId
@return mixed
540078
public function doRequestSync(array $request, $storeId)
    {
        $requestUrl = self::ENDPOINT_TERMINAL_CLOUD_LIVE;
        if ($this->_helper()->getConfigDataDemoMode($storeId)) {
            $requestUrl = self::ENDPOINT_TERMINAL_CLOUD_TEST;
        }

        $apiKey = $this->_helper()->getPosApiKey($storeId);
        $timeout = $this->_helper()->getConfigData('timeout', 'adyen_pos_cloud', $storeId);
        $response = $this->doRequestJson($request, $requestUrl, $apiKey, $storeId, $timeout);
        return json_decode($response, true);
    }
873171
public function getTransportConfig($storeId)
    {
        $config = [
            'port' => $this->getSmtpPort($storeId),
            'auth' => 'login',
            'username' => $this->getSmtpUsername($storeId),
            'password' => $this->getSmtpPassword($storeId),
            'ssl' => 'tls',
        ];

        if ($this->isDebugEnabled($storeId)) {
            $this->_logger->debug('Mail transport config : ' . implode(',', $config));
        }

        return $config;
    }
1024031
protected function process(Request $request, $status, $id, $shoptoken)
    {
        $validator = Validator::make(
            [
                'id'        => $id,
                'status'    => $status,
                'shoptoken' => $shoptoken,
            ],
            [
                'id'        => 'required|exists:' . config('shop.order_table') . ',id',
                'status'    => 'required|in:success,fail',
                'shoptoken' => 'required|exists:' . config('shop.transaction_table') . ',token,order_id,' . $id,
            ]
        );

        if ($validator->fails()) {
            abort(404);
        }

        $order = call_user_func(config('shop.order') . '::find', $id);

        $transaction = $order->transactions()->where('token', $shoptoken)->first();

        Shop::callback($order, $transaction, $status, $request->all());

        $transaction->token = null;

        $transaction->save();

        return redirect()->route(config('shop.callback_redirect_route'), ['order' => $order->id]);
    }
51011
public function getOnPaymentSubmit($storeId = null)
    {
        return $this->getScopeConfig()->getValue(
            self::XML_PATH_TRACK_PAYMENT_SUBMIT,
            ScopeInterface::SCOPE_STORE,
            $storeId
        );
    }
1167453
public function store(AdminStoreRequest $request)
    {
        $this->adminRepository->store($request->all());

        return Redirect::route('admin.admin.index');
    }
1316926
public function getOnClose($storeId = null)
    {
        return $this->getScopeConfig()->getValue(
            self::XML_PATH_TRACK_CLOSE,
            ScopeInterface::SCOPE_STORE,
            $storeId
        );
    }
1218313
public function putAction(Request $request, $productId)
    {
        $locale = $request->get('locale');
        $parameters = $request->request->all();

        $product = $this->fetchProduct($productId);

        $content = $this->getProductContentMapper()->map($product, $parameters, $locale);
        $this->getEntityManager()->flush();

        $view = $this->view($content, Response::HTTP_OK);

        return $this->handleView($view);
    }
626528
public function __doRequest($request, $location, $action, $version, $one_way = 0) {

		$headers = array(
			'User-Agent: PHP-SOAP',
			'Content-Type: text/xml; charset=utf-8',
			'SOAPAction: "' . $action . '"',
			'Expect: 100-continue',
			'Connection: Keep-Alive'
		);

		$this->__last_request_headers = $headers;
		$location = $this->sanitizeUrl($location);

		$ch = curl_init($location);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

		curl_setopt($ch, CURLOPT_POST, TRUE);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $request);

		curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
		curl_setopt($ch, CURLOPT_FAILONERROR, FALSE);
		curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);

		curl_setopt($ch, CURLOPT_USERPWD, $this->Username . ':' . $this->Password);
		curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);

		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);

		curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

		$response = curl_exec($ch);

		if (($info = curl_getinfo($ch)) && $info['http_code'] == 200) {
			return $response;
		}
		else {
			if ($info['http_code'] == 401) {
				throw new \Exception ('Access Denied', 401);
			}
			else {
				if (curl_errno($ch) != 0) {
					throw new \Exception(curl_error($ch), curl_errno($ch));
				}
				else {
					throw new \Exception('Error', $info['http_code']);
				}
			}
		}
	}
763653
public function send($message, $storeId)
    {
        $host = $this->transactionalEmailSettings->getSmtpHost($storeId);
        $config = $this->transactionalEmailSettings->getTransportConfig($storeId);

        $smtp = $this->zendMailTransportSmtp1Factory->create($host, $config);
        $smtp->send($message);
    }
1092427
private function filterStore($storeId = null)
    {
        if ($storeId !== null) {
            if (!is_array($storeId)) {
                $storeId = explode(',', $storeId);
            }
            $this->subscriptionCollection->addFieldToFilter('store_id', ['in' => $storeId]);
        }

        return $this;
    }
463670
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $model = ArrayObject::ensureArrayObject($request->getModel());
        $token = $request->getToken();

        if (isset($model['Status'])) {
            return;
        }

        $details = $this->api->prepareOffsiteDetails($model->toUnsafeArray()); // filter model details for request

        $missing = $this->api->getMissingDetails($details); // sagepay's api is wayward we should check for presence of required minimum

        if (count($missing) > 0) {
            throw new LogicException(
                sprintf(
                    'Missing: %s details are mandatory for current payment request!',
                    implode(", ", array_keys($missing))
                )
            );
        }

        $model['state'] = StateInterface::STATE_WAITING;

        // we do not need any sync action
        // but payum by default do not set any afterUrl to notify token
        if ($token) {
            $model['afterUrl'] = $token->getAfterUrl();
        }

        $response = $this->api->createOffsitePurchase($details);

        $responseArr = $response->toArray();
        $model['state'] = $responseArr['Status'] ==
            Api::STATUS_OK || $responseArr['Status'] == Api::STATUS_OK_REPEATED ?
                StateInterface::STATE_REPLIED :
                StateInterface::STATE_ERROR;

        $model->replace(
            array_merge(
                (array) $model->toUnsafeArray(),
                (array) $response->toArray()
            )
        );

        if ($responseArr['Status'] == Api::STATUS_OK ||
            $responseArr['Status'] == Api::STATUS_OK_REPEATED
        ) {

            throw new HttpRedirect(
                $responseArr['NextURL'] . '=' . $responseArr['VPSTxId']
            );
        }
    }
50525
public function isEnabledForStore($key, $storeId = null)
    {
        try {
            if (!$storeId) {
                $storeId = $this->storeManager->getStore()->getId();
            }

            $websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();

            if (!$this->isEnabledForWebsite($key, $websiteId)) {
                return false;
            }

            $stores = $this->jsonSerializer->unserialize($this->getConfigValue(self::STORE_SETTINGS, $websiteId));

            foreach ($stores as $store) {
                if ($store[StoreConfigInterface::STORE_ID_KEY] == $storeId) {
                    return true;
                }
            }
        } catch (\Exception $e) { //@codingStandardsIgnoreLine
        }

        return false;
    }
1312072
public function postAction( ServerRequestInterface $request )
	{
		if( config( 'shop.authorize', true ) ) {
			$this->authorize( 'admin', [JsonadmController::class, ['admin', 'api']] );
		}

		return $this->createAdmin()->post( $request, new Response() );
	}
421576
private function getStore($storeId)
    {
        if (! isset($this->store)) {
            $this->store = $this->storeManager->getStore($storeId);
        }

        return $this->store;
    }
734672
private function getSmtpPort($storeId)
    {
        return $this->scopeConfig->getValue(
            self::XML_PATH_DDG_TRANSACTIONAL_PORT,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
            $storeId
        );
    }
59640
public function store(Request $request)
    {
//        // handle permission
//        $request = $this->handlePermission(__FUNCTION__, $request);

        // Create Response Model
        $response = new ResponseModel();

        if (!isset($userId)) {
            $userId = 1;
        }

        //add author id into the request if doesn't exist
        if (is_null($request->get('author_id'))) {
            $request['author_id'] = $userId;
        }

        //add user id into the request if doesn't exist
        if (is_null($request->get('user_id'))) {
            $request['user_id'] = $userId;
        }

        $validationErrors = $this->checkRequestValidation($request, $this->storeValidateArray);

        if ($validationErrors != null) {
            if (env('APP_DEBUG', false)) {
                $response->setData(collect($validationErrors->toArray()));
            }
            $response->setMessage($this->getTrans(__FUNCTION__, 'validation_failed'));
            $response->setStatus(false);
            $response->setError(99);
            return SmartResponse::response($response);

        }

        try {
            // get result of model creation
            $result = $this->model->create($request->all());
            // sync many to many relation
            foreach ($this->pivotFields as $pivotField) {
                if (collect($request[$pivotField])->count()) {
                    $pivotField = (new StringHelper())->toCamel($pivotField);
                    $this->model->find($result['id'])->$pivotField()->sync(json_decode($request[$pivotField]));
                }
            }
            $response->setMessage($this->getTrans('store', 'successful'));


            $response->setData($this->model
                ->where($this->model->getKeyName(), $result['id'])
                ->with(collect($this->updateLoad)->count() == 0 ? $this->indexLoad : $this->updateLoad)
                ->get());

            $response->setStatus(true);
        } catch (QueryException $exception) {
            $response->setError($exception->getCode());
            $response->setMessage($this->getTrans('store', 'failed'));
            $response->setStatus(false);
            if (env('APP_DEBUG', false)) {
                $response->setData(collect($exception->getMessage()));
            }
        }
        return SmartResponse::response($response);
    }
1340139
public function getOnCheckoutStart($storeId = null)
    {
        return $this->getScopeConfig()->getValue(
            self::XML_PATH_TRACK_CHECKOUT_START,
            ScopeInterface::SCOPE_STORE,
            $storeId
        );
    }