Need to read/decode Payment and Txn_id from enrol paypal ipn

Re: Need to read/decode Payment and Txn_id from enrol paypal ipn

by Cal Stan -
Number of replies: 0

The IPN still does not respond to output anything.

I tried CURL, Session and also Header and I still did not get any response posted to my data capture page.

I even tried those codes at the beginning of the IPN php (line 2) and get no output result to my capture page (but the student registration to moodle went ok).

see below for one of the codes I tried

I really need some help.

       ____________________________________

// cURL code for activating Affiliate $ Payment and Txn Id

$url = 'http://www.my_affiliates_data_receiving_page.php';
$fields = array(
   
    'mc_gross' => urlencode($_POST['mc_gross']),
    'txn_id' => urlencode($_POST['txn_id'])
);

//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);

//execute post
$result = curl_exec($ch);

//close connection
curl_close($ch);