I am using PHP PayPal SDK for payment. I am getting the success response from the data and the whole JSON object. I want to know how I can get individual data from the whole returned object. I am specifically interested in the item_number (sku). This is where I am currently $paymentId = $this->input->get("paymentId") ;
$PayerID = $this->input->get("PayerID") ;
$token = $this->input->get("token") ;
$payment = Payment::get($paymentId, $apiContext);
$execution = new PaymentExecution();
$execution->setPayerId($this->input->get('PayerID'));
try{
$result = $payment->execute($execution, $apiContext);
}
catch (Exception $ex){
die($ex);
}
if($result->getState() == 'approved'){
//get item ID
//get transaction code
// get payer information
}
It is not well documented in their documention in github here Any idea how I can go about it?
I am more interested in the item ID so I can update the database.