0

I'm not getting the street address, state and city. I have using the below code to fetch the information:

<?php
if($_GET['tx']) $tx= $_GET['tx']; 
$identity = '1Y7reMOTMxCY66RFk.......................'; 
$ch = curl_init();
curl_setopt_array($ch, array ( CURLOPT_URL =>
    'https://www.sandbox.paypal.com/cgi-bin/webscr', CURLOPT_POST => TRUE,
    CURLOPT_POSTFIELDS => http_build_query(array ('cmd' => '_notify-synch','tx' => $tx,
    'at' => $identity,)), CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HEADER => FALSE,
    CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false,)); 
$response = curl_exec($ch); 
$status   = curl_getinfo($ch, CURLINFO_HTTP_CODE); 
curl_close($ch); 
if( substr($response, 0, 7) == 'SUCCESS') 
{ 
$response = substr_replace($response, '', 0, 7); 
$response = str_replace(array("\n", "\r", "\r\n"), '&', $response);  
parse_str($response, $response_array);
} 
echo "<pre>"; print_r($response_array); ?>

Output:

Array
(
    [transaction_subject] => 
    [txn_type] => web_accept
    [payment_date] => 21:41:19 Aug 20, 2014 PDT
    [last_name] => Maurya
    [residence_country] => US
    [pending_reason] => address
    [item_name] => THE BOOM
    [payment_gross] => 1495.00
    [mc_currency] => USD
    [business] => arunk-facilitator@hotmail.com
    [payment_type] => instant
    [protection_eligibility] => Ineligible
    [payer_status] => verified
    [fraud_management_pending_filters_1] => Maximum Transaction Amount
    [tax] => 0.00
    [payer_email] => pm.sz@gmail.com
    [txn_id] => 3PU02356JM49....
    [quantity] => 1
    [receiver_email] => arunk-facilitator@hotmail.com
    [first_name] => Prikshit
    [payer_id] => HFKPSNRD...
    [receiver_id] => N4DKWT577...
    [item_number] => 102
    [handling_amount] => 0.00
    [payment_status] => Pending
    [shipping] => 0.00
    [mc_gross] => 1495.00
    [custom] =>
    [charset] => windows-1252
)
Deduplicator
  • 44,692
  • 7
  • 66
  • 118

1 Answers1

1

Since its a button payment you need to make sure that the value for the variable
no_shipping in your button code is not set to 1 . If no_shipping=1 is passed you
will not get the shipping address back both in PDT as well as in IPN .

You can get the description for this variable on the below url :

https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables#no_shipping

Eshan
  • 3,647
  • 1
  • 11
  • 14