10 use Magento\Framework\HTTP\ZendClientFactory;
67 'verifypeer' =>
$config->getValue(
'verify_peer')
70 if (
$config->getValue(
'use_proxy')) {
71 $clientConfig[
'proxy'] =
$config->getValue(
'proxy_host')
73 .
$config->getValue(
'proxy_port');
74 $clientConfig[
'httpproxytunnel'] =
true;
75 $clientConfig[
'proxytype'] = CURLPROXY_HTTP;
79 $client = $this->httpClientFactory->create();
82 (
bool)
$config->getValue(
'sandbox_flag')
83 ?
$config->getValue(
'transaction_url_test_mode')
84 :
$config->getValue(
'transaction_url')
86 $client->setConfig($clientConfig);
88 $client->setParameterPost(
$request->getData());
91 'X-VPS-VIT-CLIENT-CERTIFICATION-ID' =>
'33baf5893fc2123d8b191d2d011b7fdc',
92 'X-VPS-Request-ID' => $this->mathRandom->getUniqueHash(),
93 'X-VPS-CLIENT-TIMEOUT' => 45
96 $client->setUrlEncodeBody(
false);
102 parse_str(strstr(
$response->getBody(),
'RESULT'), $responseArray);
104 $result->setData(array_change_key_case($responseArray, CASE_LOWER));
109 'response_code' => -1,
110 'response_reason_code' => $e->getCode(),
111 'response_reason_text' => $e->getMessage()
116 $this->logger->debug(
121 (array)
$config->getValue(
'getDebugReplacePrivateDataKeys'),
122 (bool)
$config->getValue(
'debug')
postRequest(DataObject $request, ConfigInterface $config)
__construct(ZendClientFactory $httpClientFactory, Random $mathRandom, Logger $logger)