title: Paypal REST API: Retrieve invoice numbers for further processing after payment approved
body: <p>I was use this <a href="https://github.com/paypal/PayPal-PHP-SDK" rel="nofollow">Paypal PHP SDK</a> for my shopping app, after executed and get approved of the buyer's payment, I want to return payment details so that I can continues for further action such as update database.</p>
  
  <p>I get this hit back URL <code>http://example.com/shopping/payment?success=true&amp;paymentId=PAY-1TK25581J9941930MK2H3ODR&amp;token=EC-9JK21383KS5324308&amp;PayerID=RELUJA6BN3MNE</code>, in my source code, I have <code>$info = $payment-&gt;getTransactions();</code> to view payment's details after payment approved, print as <code>print_r($info)</code>:</p>
  
  <p><code>Array ( [0] =&gt; PayPal\Api\Transaction Object ( [_propMap:PayPal\Common\PayPalModel:private] =&gt; Array ( [amount] =&gt; PayPal\Api\Amount Object ( [_propMap:PayPal\Common\PayPalModel:private] =&gt; Array ( [total] =&gt; 56.00 [currency] =&gt; GBP [details] =&gt; PayPal\Api\Details Object ( [_propMap:PayPal\Common\PayPalModel:private] =&gt; Array ( [subtotal] =&gt; 46.00 [shipping] =&gt; 10.00 ) ) ) ) [payee] =&gt; PayPal\Api\Payee Object ( [_propMap:PayPal\Common\PayPalModel:private] =&gt; Array ( [email] =&gt; myshop@example.com ) ) [description] =&gt; Payment description [invoice_number] =&gt; 0AGIRVBYCOLK [item_list] =&gt; PayPal\Api\ItemList Object ( [_propMap:PayPal\Common\PayPalModel:private] =&gt; Array ( [items] =&gt; Array ( [0] =&gt; PayPal\Api\Item Object ( [_propMap:PayPal\Common\PayPalModel:private] =&gt; Array ( [name] =&gt; Blossom Cherry [price] =&gt; 20.00 [currency] =&gt; GBP [quantity] =&gt; 1 [description] =&gt; Tanks / Womens - M ) ) [1] =&gt; PayPal\Api\Item Object ( [_propMap:PayPal\Common\PayPalModel:private] =&gt; Array ( [name] =&gt; Space Sheep [price] =&gt; 26.00 [currency] =&gt; GBP [quantity] =&gt; 1 [description] =&gt; Roundnecks / Mens - L ) ) ) [shipping_address] =&gt; PayPal\Api\ShippingAddress Object ( [_propMap:PayPal\Common\PayPalModel:private] =&gt; Array ( [recipient_name] =&gt; test buyer [line1] =&gt; Level 01, Wall Street [city] =&gt; ABC City [state] =&gt; Manchester [postal_code] =&gt; 12345 [country_code] =&gt; UK ) ) ) ) [related_resources] =&gt; Array ( ) [notify_url] =&gt; http://example.com/paypal/pp-ipn.php ) ) )</code>
  `</p>
  
  <p>How can I get each individual elements, let says I want to get <code>[invoice_number]</code> for database process in the app?</p>
  
  <p>I have tried <code>echo $info[0]['invoice_number']</code> but error shown up, what is the best way to decode above arrays? </p>