cUrl post для авторизации. net возвращает пустой 80% времени - PullRequest
0 голосов
/ 17 июня 2020

У меня PHP работает на godaddy linux, и он вызывает авторизацию. Net API. В 20% случаев он работает нормально (от конца до конца), в 80% случаев aut hnet возвращает пустой результат. Каждый раз отправляются одни и те же данные, от яблок к яблокам.

Вот мой завиток:

$gatewayAddress = "https://api2.authorize.net/xml/v1/request.api";

$curlHandler = curl_init();
curl_setopt ($curlHandler, CURLOPT_URL, $gatewayAddress);
curl_setopt ($curlHandler, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($curlHandler, CURLOPT_HEADER, 0);
curl_setopt ($curlHandler, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($curlHandler, CURLOPT_VERBOSE, true); 
$verbose = fopen('php://temp', 'w+'); 
curl_setopt($curlHandler, CURLOPT_STDERR, $verbose); 
curl_setopt ($curlHandler, CURLOPT_CONNECTTIMEOUT, 300); 
curl_setopt ($curlHandler, CURLOPT_SSL_VERIFYPEER, false); 
curl_setopt ($curlHandler, CURLOPT_SSL_VERIFYHOST, false); 
curl_setopt ($curlHandler, CURLOPT_DNS_USE_GLOBAL_CACHE, false ); 
curl_setopt ($curlHandler, CURLOPT_POST, true);
curl_setopt ($curlHandler, CURLOPT_POSTFIELDS, $postString);
$result = curl_exec($curlHandler);

Вот результат отладки из завитка:

*   Trying 198.241.207.102:443...
* Connected to secure2.authorize.net (198.241.207.102) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLSv1.2 / AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: C=US; ST=California; L=Foster City; O=Authorize.Net; CN=*.authorize.net
*  start date: Feb  5 20:44:08 2020 GMT
*  expire date: Mar 15 21:14:08 2021 GMT
*  issuer: C=US; O=Entrust, Inc.; OU=See www.entrust.net/legal-terms; OU=(c) 2012 Entrust, Inc. - for authorized use only; CN=Entrust Certification Authority - L1K
*  SSL certificate verify ok.
> POST /gateway/transact.dll HTTP/1.1

Host: secure2.authorize.net
Accept: */*
Content-Length: 638
Content-Type: application/x-www-form-urlencoded

* upload completely sent off: 638 out of 638 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Cache-Control: no-cache, no-store, must-revalidate
< Pragma: no-cache
< Content-Type: text/html
< Expires: -1
< Date: Wed, 17 Jun 2020 19:38:21 GMT
< X-Cnection: close
< Content-Length: 317
< 
* Connection #0 to host secure2.authorize.net left intact

Я не уверен, следует ли мне вызывать aut hnet или обнаруживать проблему в linux / apache / server-setup, et c.

Есть идеи?

...