// For this example, we'll just email ourselves ALL the data. $subject = 'DOCman PayPal IPN (Pay Per Download) - PayPal Order Received!'; $body = "An instant payment notification was successfully recieved\n"; $body .= "from ".$p->ipn_data['payer_email']." on ".date('m/d/Y'); $body .= " at ".date('g:i A')."\n\nDetails:\n"; $tmp = unserialize(base64_decode($_POST['custom'])); // $mode = JRequest::getVar('mode'); $my_id = (int)$tmp['my_id']; @$doc_id = $tmp['doc_id']; $order_id = (int)$tmp['order_id']; $key = $tmp['key']; //mail('*****@*****.**','debug data',$order_id . ' ' . $mode . ' ' . print_r($tmp,true)); $priceFromDb = $dm->getPrice($doc_id); if ($dm->cfg['useVat'] > 0 && $mode != 'cart') { $priceFromDb = $priceFromDb + ($dm->vatCalc($priceFromDb)); } $chk1 = round(floatval($priceFromDb),2); $chk2 = floatval($p->ipn_data['mc_gross']); if ($chk1 - $chk2 != 0) { //die(); } if ($p->ipn_data['mc_currency'] != $dm->cfg['currency']) { $problemOccured = true; } if ($p->ipn_data['test_ipn'] == 1 && $dm->cfg['sandbox'] == 'No') { $problemOccured = true;
} $doc_id = JRequest::getVar('id',null,null,'int'); $key = JRequest::getVar('key'); $order_id = JRequest::getVar('order_id',null,null,'int'); if (!$doc_id) { $doc_id = (int)JRequest::getVar('alias'); } $item = $dm->getItem($doc_id); $my = JFactory::getUser(); $dm->cfg = $dm->getConfig(); $price = $dm->getPrice($doc_id); /** * free for user /** * @author Deian * * free for user type */ //die(print_r($my,true)); //die("{$my->usertype} | " . $dm->cfg['free_for_usertypes']); //if (array_key_exists(,explode(",",$dm->cfg['free_for_usertypes']))) { if (is_array($my->groups)) {