api - printing PayPal response -
i writing code response
$paypalresult = $paypal->gettransactiondetails($paypalrequestdata); echo '<pre />'; print_r($paypalresult);
after using print_r command getting following result.
array ( [receiverbusiness] => rdaa.org [receiveremail] => rdudeja.org [receiverid] => rs2thgdskdkg6 [email] => begin@denim.com [payerid] => rpxdf4pdmrqd6 [payerstatus] => verified [countrycode] => [shiptoname] => kamal sudeja [protectioneligibility] => eligible [protectioneligibilitytype] => itemnotreceivedeligible,unauthorizedpaymenteligible [l_name0] => denim [l_number0] => 1234 [l_qty0] => 1 [l_taxamt0] => 0.00 [l_currencycode0] => usd [l_taxable0] => false [errors] => array ( ) [orderitems] => array ( [0] => array ( [l_name] => denim [l_desc] => [l_number] => 1234 [l_qty] => 1 [l_amt] => [l_taxamt] => 0.00 [l_ebayitemtxnid] => [l_ebayitemorderid] => ) )
i writing following code print associative array.
foreach($paypalresult $k=>$v) { echo $k.'='.$v.'<br>'; }
but showing error
"array string conversion"
help me want print response.
you don't need loop through $paypalresult. params includes parsed , available you, can use $paypalresult['email'] pull value, example.
the things might want loop through $paypalresult['orderitems'] or $paypalresult['errors'] arrays themselves, @daniel a. white mentioned in comment.
in case, though, this...
foreach($paypalresult['orderitems'] $orderitem) { $itemname = $orderitem['l_name']; }
Comments
Post a Comment