cancel
Showing results for 
Search instead for 
Did you mean: 

Who Me Too'd this topic

Who Me Too'd this topic

Options
bnctech
Contributor
Posted on

Hi,

 

After few years of normal working of our script, from 29.03.2019 we stopped receiving payer_email address. That's very important for us to get the buyer email address after ebay transaction.

 

I noticed that there are few type of confirmation emails from Paypal about instant payment. Only for the type where the buyer email is in the line like:  You received a payment of £XX.XX GBP from ABCD (dsada %at% sdh.co.uk) we are receing the payer email from the IPN as normal. For all other types we are not receiving this. We checked that raw data no longer contains this. The thing is that previously the Confirmation emails looked exactly the same, so it seems that Paypal has changed something in the IPN method since 29.03.2019.

 

Are there any other way to get the payer email address after we receive payment for ebay transaction?

 

Our part of code:

 

<?php
define("USE_SANDBOX", 0);
$file = 'logs.txt'; 
$raw_post_data = file_get_contents('php://input');
 
$raw_post_array = explode('&', $raw_post_data);
$myPost = array();
foreach ($raw_post_array as $keyval) {
  $keyval = explode ('=', $keyval);
  if (count($keyval) == 2)
     $myPost[$keyval[0]] = urldecode($keyval[1]);
}
 
$req = 'cmd=_notify-validate';
if(function_exists('get_magic_quotes_gpc')) {
   $get_magic_quotes_exists = true;
foreach ($myPost as $key => $value) {        
   if($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) { 
        $value = urlencode(stripslashes($value)); 
   } else {
        $value = urlencode($value);
   }
   $req .= "&$key=$value";
}
 
if(USE_SANDBOX == true) {
} else {
 
// Step 2: POST IPN data back to PayPal to validate
 
$ch = curl_init($paypal_url);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
 
if( !($res = curl_exec($ch)) ) {
    curl_close($ch);
    exit;
}
curl_close($ch);
 
$found = false;
$transaction_id = $_POST['txn_id'];
$item_number = $_POST['item_number'];
$payer_email = $_POST['payer_email'];
$now = date("Y-m-d H:i:s");
...............
 

Thank you

 

Who Me Too'd this topic