title: Paypal PHP SDK payment status
body: <p>I am using paypal php sdk. I have the following code:</p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL);
  ini_set('display_errors', 1);
  
  require __DIR__  . '/vendor/PayPal-PHP-SDK/autoload.php';
  
  $dev_ClientID = 'xxxxxxxxxx';
  $dev_ClientSecret = 'xxxxxxxxxx';
  
  $apiContext = new \PayPal\Rest\ApiContext(
          new \PayPal\Auth\OAuthTokenCredential(
               $dev_ClientID     
              ,$dev_ClientSecret     
          )   
  );
  
  $payer = new \PayPal\Api\Payer();
  $payer-&gt;setPaymentMethod('paypal');
  
  $amount = new \PayPal\Api\Amount();
  $amount-&gt;setTotal('1.00');
  $amount-&gt;setCurrency('USD');
  $transaction = new \PayPal\Api\Transaction();
  $transaction-&gt;setAmount($amount);
  
  $redirectUrls = new \PayPal\Api\RedirectUrls();
  $redirectUrls-&gt;setReturnUrl("https://www.somedomain.com/paypal_success.php")
      -&gt;setCancelUrl("https://www.somedomain.com/paypal_cancel.php");
  
  // Create the WebProfile
  $presentation = new \PayPal\Api\Presentation();
  $presentation-&gt;setLogoImage("http://www.yeowza.com/favico.ico")
      -&gt;setBrandName("YeowZa! Paypal")
      -&gt;setLocaleCode("US");
  
  $inputfields = new \PayPal\Api\InputFields();
  $inputfields -&gt;getNoShipping(1);
  
  $webProfile = new \PayPal\Api\WebProfile();
  $webProfile
     -&gt;setName('somename' . uniqid())
     -&gt;setInputFields($inputfields)
     -&gt;setTemporary(true);
  
  $webProfileId = $webProfile-&gt;create($apiContext)-&gt;getId();
  
  $payment = new \PayPal\Api\Payment();
  $payment-&gt;setExperienceProfileId($webProfileId);
  
  $payment-&gt;setIntent('sale')
      -&gt;setPayer($payer)
      -&gt;setTransactions(array($transaction))
      -&gt;setRedirectUrls($redirectUrls);
  
  try {
      $payment-&gt;create($apiContext);
      echo "\n\nRedirect user to approval_url: " . $payment-&gt;getApprovalLink() . "\n";
  }
  catch (\PayPal\Exception\PayPalConnectionException $ex) {
      // This will print the detailed information on the exception.
      echo $ex-&gt;getData();
  }
  ?&gt;
  </code></pre>
  
  <p>I get the payment link but i still see the shipping info.</p>
  
  <p>I have defined getNoShipping to true, maybe hooked web profile wrong. So thats one thing. The second thing I am not sure about is this.</p>
  
  <p>I passed a payment and got redirected back to paypal_success.php with paymentId, token and  PayerID. How would I use these to receive info about the transaction. I wish to make sure it actually occured.</p>
  
  <p>I tried the following:</p>
  
  <pre><code>$paymentId = $_GET["paymentId"];
  $token = $_GET["token"];
  $PayerID = $_GET["PayerID"];
  echo "paymentId: " . $paymentId . "&lt;br&gt;";
  echo "token: " .$token . "&lt;br&gt;";
  echo "PayerID: " .$PayerID . "&lt;br&gt;";
  
  
  
  $curl = curl_init("https://api.sandbox.paypal.com/v1/checkout/orders/$paymentId");
  curl_setopt($curl, CURLOPT_POST, false);
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($curl, CURLOPT_HEADER, false);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($curl, CURLOPT_HTTPHEADER, array(
      'Authorization: Bearer ' . $token,
      'Accept: application/json',
      'Content-Type: application/json'
  ));
  $response = curl_exec($curl);
  $result = json_decode($response);
  
  
  var_dump($result);
  </code></pre>
  
  <p>with the following result:</p>
  
  <p>{ ["error"]=> string(13) "invalid_token" ["error_description"]=> string(35) "Token signature verification failed" }</p>
  
  <p>Will appreciate any help rendered.
  Thanks</p>