S
S
SmartAge2016-10-23 03:14:59
PHP
SmartAge, 2016-10-23 03:14:59

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);

The advice that is given on stackoverflow already tried nothing helped, so it is advisable to answer those who have come across this topic.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SagePtr, 2016-10-23
@SagePtr

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.

P
Puma Thailand, 2016-11-01
@opium

use wget to make this request manually

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question