Answer the question
In order to leave comments, you need to log in
Paypal PDT curl returns false?
I get tx from the stick, then I send my token and this tx. But in response I get nothing $status = 0, here is the code
$tx = $_GET['tx'];
$auth_token = "I_o-o3auPvfXBbZ49cZpMQP1PXxvhbjkKB1vi0tgMFRv0e8ucdThFIqnRvS";
$request = curl_init();
// Set request options
curl_setopt_array($request, array
(
CURLOPT_URL => 'https://www.sandbox.paypal.com/cgi-bin/webscr',
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => http_build_query(array
(
'cmd' => '_notify-synch',
'tx' => $tx,
'at' => $auth_token,
)),
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HEADER => FALSE,
CURLOPT_SSL_VERIFYHOST => 6,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_CAINFO => 'cacert.pem',
));
// Execute request and get response and status code
$response = curl_exec($request);
$status = curl_getinfo($request, CURLINFO_HTTP_CODE);
Answer the question
In order to leave comments, you need to log in
I would look not at CURLINFO_HTTP_CODE, but at CURLINFO_SSL_VERIFYRESULT first.
And CURLOPT_SSL_VERIFYHOST is not clear where you got 6 from.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question