title: paypal php rest api. response codes?
body: <p>This whole paypal process has been one nightmare after the next. I've managed to complete the application all except for one small problem. the response object from paypal <code>Payment::execute()</code> has no documentation. My front end is client side, so i really have no way of knowing what this response array contains.</p>
  
  <p>here's what i've got so far:</p>
  
  <pre><code>    $paymentId = $this-&gt;ppconf; //stores paymentId
  
      if(empty($paymentId)){Throw New \Exception('missing payment id'); }
  
      $payment = Payment::get($paymentId, $apiContext);
      $execution = new PaymentExecution();
      $execution-&gt;setPayerId($z);
      $response = $payment-&gt;execute($execution, $apiContext); // i need to know what this response array looks like and what the response codes are, so i can generate my $result array for my application.
  
      $state = $response-&gt;getState();
      $failures = ['failed','canceled','expired'];
      if(in_array($state,$failures)){
          $result = ['type'=&gt;'error'];
      }else{
          $result = ['type'=&gt;'success'];
          $this-&gt;finished = true;
      }
  
      return $result;
  </code></pre>