Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.06 KB | None | 0 0
  1. <?php
  2.  
  3. // CONFIG: Enable debug mode. This means we'll log requests into 'ipn.log' in the same directory.
  4.  
  5. // Especially useful if you encounter network errors or other intermittent problems with IPN (validation).
  6.  
  7. // Set this to 0 once you go live or don't require logging.
  8.  
  9. define("DEBUG", 1);
  10.  
  11. // Set to 0 once you're ready to go live
  12.  
  13. define("USE_SANDBOX", 0);
  14.  
  15. define("LOG_FILE", "./ipn.log");
  16.  
  17. define("LOG_FILE_ERRORS", "./errors.log");
  18.  
  19. define("LOG_FILE_ATF", "./errorsatf.log");
  20.  
  21.  
  22.  
  23. //init vars
  24.  
  25. //$receiver_email = "paypal@nutrio2.com";
  26.  
  27. $receiver_id = "AZHAU5PH9YUA2";
  28.  
  29.  
  30.  
  31. // Read POST data
  32.  
  33. // reading posted data directly from $_POST causes serialization
  34.  
  35. // issues with array data in POST. Reading raw POST data from input stream instead.
  36.  
  37. $raw_post_data = file_get_contents('php://input');
  38.  
  39. $raw_post_array = explode('&', $raw_post_data);
  40.  
  41. $myPost = array();
  42.  
  43. foreach ($raw_post_array as $keyval) {
  44.  
  45. $keyval = explode ('=', $keyval);
  46.  
  47. if (count($keyval) == 2)
  48.  
  49. $myPost[$keyval[0]] = urldecode($keyval[1]);
  50.  
  51. }
  52.  
  53. // read the post from PayPal system and add 'cmd'
  54.  
  55. $req = 'cmd=_notify-validate';
  56.  
  57. if(function_exists('get_magic_quotes_gpc')) {
  58.  
  59. $get_magic_quotes_exists = true;
  60.  
  61. }
  62.  
  63. foreach ($myPost as $key => $value) {
  64.  
  65. if($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) {
  66.  
  67. $value = urlencode(stripslashes($value));
  68.  
  69. } else {
  70.  
  71. $value = urlencode($value);
  72.  
  73. }
  74.  
  75. $req .= "&$key=$value";
  76.  
  77. }
  78.  
  79.  
  80.  
  81. error_log(date('[Y-m-d H:i e] '). "IPN fired: $req" . PHP_EOL, 3, LOG_FILE);
  82.  
  83.  
  84.  
  85. // Post IPN data back to PayPal to validate the IPN data is genuine
  86.  
  87. // Without this step anyone can fake IPN data
  88.  
  89.  
  90.  
  91. if(USE_SANDBOX == true) {
  92.  
  93. $paypal_url = "https://www.sandbox.paypal.com/cgi-bin/webscr";
  94.  
  95. } else {
  96.  
  97. $paypal_url = "https://www.paypal.com/cgi-bin/webscr";
  98.  
  99. }
  100.  
  101.  
  102.  
  103. $ch = curl_init($paypal_url);
  104.  
  105. if ($ch == FALSE) {
  106.  
  107. //LOGS all FALSE IPNs
  108.  
  109. error_log(date('[Y-m-d H:i e] '). "FALSE IPN: $req" . PHP_EOL, 3, LOG_FILE);
  110.  
  111. return FALSE;
  112.  
  113. }
  114.  
  115.  
  116.  
  117. curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
  118.  
  119. curl_setopt($ch, CURLOPT_POST, 1);
  120.  
  121. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  122.  
  123. curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
  124.  
  125. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
  126.  
  127. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  128.  
  129. curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
  130.  
  131.  
  132.  
  133. if(DEBUG == true) {
  134.  
  135. curl_setopt($ch, CURLOPT_HEADER, 1);
  136.  
  137. curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
  138.  
  139. }
  140.  
  141.  
  142.  
  143. // CONFIG: Optional proxy configuration
  144.  
  145. //curl_setopt($ch, CURLOPT_PROXY, $proxy);
  146.  
  147. //curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
  148.  
  149.  
  150.  
  151. // Set TCP timeout to 30 seconds
  152.  
  153. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
  154.  
  155. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
  156.  
  157.  
  158.  
  159. // CONFIG: Please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set the directory path
  160.  
  161. // of the certificate as shown below. Ensure the file is readable by the webserver.
  162.  
  163. // This is mandatory for some environments.
  164.  
  165.  
  166.  
  167. //$cert = __DIR__ . "./cacert.pem";
  168.  
  169. //curl_setopt($ch, CURLOPT_CAINFO, $cert);
  170.  
  171.  
  172.  
  173. $res = curl_exec($ch);
  174.  
  175. if (curl_errno($ch) != 0) // cURL error
  176.  
  177. {
  178.  
  179. if(DEBUG == true) {
  180.  
  181. error_log(date('[Y-m-d H:i e] '). "Can't connect to PayPal to validate IPN message: " . curl_error($ch) . PHP_EOL, 3, LOG_FILE);
  182.  
  183. }
  184.  
  185. curl_close($ch);
  186.  
  187. exit;
  188.  
  189.  
  190.  
  191. } else {
  192.  
  193. // Log the entire HTTP response if debug is switched on.
  194.  
  195. if(DEBUG == true) {
  196.  
  197. error_log(date('[Y-m-d H:i e] '). "HTTP request of validation request:". curl_getinfo($ch, CURLINFO_HEADER_OUT) ." for IPN payload: $req" . PHP_EOL, 3, LOG_FILE);
  198.  
  199. error_log(date('[Y-m-d H:i e] '). "HTTP response of validation request: $res" . PHP_EOL, 3, LOG_FILE);
  200.  
  201. }
  202.  
  203. curl_close($ch);
  204.  
  205. }
  206.  
  207.  
  208.  
  209. // Inspect IPN validation result and act accordingly
  210.  
  211.  
  212.  
  213. // Split response headers and payload, a better way for strcmp
  214.  
  215. $tokens = explode("\r\n\r\n", trim($res));
  216.  
  217. $res = trim(end($tokens));
  218.  
  219.  
  220.  
  221. if (strcmp ($res, "VERIFIED") == 0) {
  222.  
  223. // check whether the payment_status is Completed
  224.  
  225. // check that txn_id has not been previously processed
  226.  
  227. // check that receiver_email is your PayPal email
  228.  
  229. // check that payment_amount/payment_currency are correct
  230.  
  231. // process payment and mark item as paid.
  232.  
  233.  
  234.  
  235. //check based on secure merchant id (receiver_id)
  236.  
  237. //error_log(date('[Y-m-d H:i e] '). "receiver email ".$_POST['receiver_email']. PHP_EOL, 3, LOG_FILE);
  238.  
  239.  
  240.  
  241. // assign posted variables to local variables
  242.  
  243. //$item_name = $_POST['item_name'];
  244.  
  245. //$item_number = $_POST['item_number'];
  246.  
  247. //$payment_status = $_POST['payment_status'];
  248.  
  249. //$payment_amount = $_POST['mc_gross'];
  250.  
  251. //$payment_currency = $_POST['mc_currency'];
  252.  
  253. //$txn_id = $_POST['txn_id'];
  254.  
  255. //$receiver_email = $_POST['receiver_email'];
  256.  
  257. //$payer_email = $_POST['payer_email'];
  258.  
  259. //$transaction_id = $_POST['txn_id'];
  260.  
  261. //$payerid = $_POST['payer_id'];
  262.  
  263. //$firstname = $_POST['first_name'];
  264.  
  265. //$lastname = $_POST['last_name'];
  266.  
  267. //$payeremail = $_POST['payer_email'];
  268.  
  269.  
  270.  
  271. $paymentstatus = $_POST['payment_status'];
  272.  
  273. $mdate= date('Y-m-d h:i:s',strtotime($paymentdate));
  274.  
  275.  
  276.  
  277. $otherstuff = json_encode($_POST);
  278.  
  279.  
  280.  
  281. $path = $_SERVER['DOCUMENT_ROOT'] . "/scripts/lib/includes.php";
  282.  
  283. require_once($path);
  284.  
  285.  
  286.  
  287. //this is a recurring_payment_profile txn
  288.  
  289. if (strpos($_POST["txn_type"],'recurring_payment_profile') !== false) {
  290.  
  291. $txn_id = $_POST["initial_payment_txn_id"];
  292.  
  293. $mc_gross = $_POST['initial_payment_amount'];
  294.  
  295. $payment_status = $_POST["initial_payment_status"];
  296.  
  297. $paymentdate = "0000-00-00 00:00:00";
  298.  
  299. $nextpaymentdate = $_POST['next_payment_date'];
  300.  
  301. $thispaymentdate = date("F j, Y, g:i a", strtotime($nextpaymentdate));
  302.  
  303.  
  304.  
  305. $profileId = $_POST["recurring_payment_id"];
  306.  
  307.  
  308.  
  309. $path = $_SERVER['DOCUMENT_ROOT'] . "/3/scripts/lib/Lionite/".$PAYPAL[getProductCode($_POST["pid"])].".php";
  310.  
  311. require_once($path);
  312.  
  313. $paypal = new Lionite_Paypal();
  314.  
  315. //Set sandbox mode
  316.  
  317. if(USE_SANDBOX == true) {
  318.  
  319. $paypal_sb = true;
  320.  
  321. } else {
  322.  
  323. $paypal_sb = false;
  324.  
  325. }
  326.  
  327. Lionite_Paypal::sandbox($paypal_sb);
  328.  
  329. $details = $paypal -> getRecurringProfile($profileId);
  330.  
  331.  
  332.  
  333. // Details found
  334.  
  335. if(is_array($details)) {
  336.  
  337. $ship_fname = $details["name"];
  338.  
  339. $ship_lname = "-";
  340.  
  341. $ship_address1 = $details["shipping_street"];
  342.  
  343. $ship_address2 = "";
  344.  
  345. $ship_city = $details["shipping_city"];
  346.  
  347. $ship_zip = $details["shipping_zip"];
  348.  
  349. $ship_state = $details["shipping_state"];
  350.  
  351. $ship_country = $details["shipping_country_name"];
  352.  
  353. $ship_country_code = $details["shipping_country_code"];
  354.  
  355. $ship_phone = '00000000';
  356.  
  357. $ship_email = $_POST["payer_email"];
  358.  
  359. $currency = $_POST["currency_code"];
  360.  
  361. $amount = 1;
  362.  
  363. //uses rp_invoice_id or profile_reference because recurring profiles have no other fields
  364.  
  365. //$ip = $_POST["rp_invoice_id"];
  366.  
  367.  
  368.  
  369. //parse custom to get things like IP
  370.  
  371. parse_str($_POST["rp_invoice_id"]);
  372.  
  373. $ip = $ip;
  374.  
  375. }
  376.  
  377.  
  378.  
  379. //this is a regular txn
  380.  
  381. } else {
  382.  
  383. $txn_id = $_POST["txn_id"];
  384.  
  385. $payment_status = $_POST["payment_status"];
  386.  
  387. $mc_gross = $_POST['mc_gross'];
  388.  
  389. $paymentdate = $_POST['payment_date'];
  390.  
  391. $product_name = isset($_POST['product_name'])?$_POST['product_name']:'';
  392.  
  393. $nextpaymentdate = "0000-00-00 00:00:00";
  394.  
  395. $thispaymentdate = date("F j, Y, g:i a", strtotime($paymentdate));
  396.  
  397.  
  398.  
  399. //parse custom to get things like IP
  400.  
  401. parse_str($_POST["custom"]);
  402.  
  403.  
  404.  
  405. // Prepare variables (for fulfillment)
  406.  
  407. $ship_fname = $_POST["address_name"];
  408.  
  409. $ship_lname = "-";
  410.  
  411. $ship_address1 = $_POST["address_street"];
  412.  
  413. $ship_address2 = "";
  414.  
  415. $ship_city = $_POST["address_city"];
  416.  
  417. $ship_zip = $_POST["address_zip"];
  418.  
  419. $ship_state = $_POST["address_state"];
  420.  
  421. $ship_country = $_POST["address_country"];
  422.  
  423. $ship_country_code = $_POST["address_country_code"];
  424.  
  425. $ship_phone = '8888888';
  426.  
  427. $ship_email = $_POST["payer_email"];
  428.  
  429. $currency = $_POST["mc_currency"];
  430.  
  431. $amount = 1;
  432.  
  433. $ip = $ip;
  434.  
  435.  
  436.  
  437. }
  438.  
  439.  
  440.  
  441. $parent_txn_id = '';
  442.  
  443.  
  444.  
  445. if (isset($_POST['parent_txn_id'])){
  446.  
  447. $parent_txn_id = $_POST['parent_txn_id'];
  448.  
  449. }
  450.  
  451.  
  452.  
  453. $sql = "INSERT INTO ipns (
  454.  
  455. parent_txn_id,
  456.  
  457. txn_id,
  458.  
  459. recurring_payment_id,
  460.  
  461. txn_type,
  462.  
  463. custom,
  464.  
  465. payment_type,
  466.  
  467. payment_date,
  468.  
  469. next_payment_date,
  470.  
  471. payment_status,
  472.  
  473. profile_status,
  474.  
  475. product_name,
  476.  
  477. first_name,
  478.  
  479. last_name,
  480.  
  481. payer_email,
  482.  
  483. payer_id,
  484.  
  485. address_name,
  486.  
  487. address_country,
  488.  
  489. address_country_code,
  490.  
  491. address_zip,
  492.  
  493. address_state,
  494.  
  495. address_city,
  496.  
  497. address_street,
  498.  
  499. business,
  500.  
  501. receiver_email,
  502.  
  503. receiver_id,
  504.  
  505. residence_country,
  506.  
  507. item_name1,
  508.  
  509. item_number1,
  510.  
  511. quantity,
  512.  
  513. shipping,
  514.  
  515. tax,
  516.  
  517. mc_currency,
  518.  
  519. mc_fee,
  520.  
  521. mc_gross,
  522.  
  523. mc_gross1,
  524.  
  525. invoice,
  526.  
  527. ip,
  528.  
  529. ieverything_else)
  530.  
  531. VALUES (
  532.  
  533. '".trim($parent_txn_id)."',
  534.  
  535. '".trim($txn_id)."',
  536.  
  537. '".trim($_POST["recurring_payment_id"])."',
  538.  
  539. '".trim($_POST["txn_type"])."',
  540.  
  541. '".trim($_POST["custom"])."',
  542.  
  543. '".trim($_POST["payment_type"])."',
  544.  
  545. '".trim(date('Y-m-d H:i:s', strtotime($paymentdate)))."',
  546.  
  547. '".trim(date('Y-m-d H:i:s', strtotime($nextpaymentdate)))."',
  548.  
  549. '".trim($payment_status)."',
  550.  
  551. '".trim($_POST["profile_status"])."',
  552.  
  553. '".trim($_POST["product_name"])."',
  554.  
  555. '".trim($_POST["first_name"])."',
  556.  
  557. '".trim($_POST["last_name"])."',
  558.  
  559. '".trim($_POST["payer_email"])."',
  560.  
  561. '".trim($_POST["payer_id"])."',
  562.  
  563. '".trim($ship_fname)."',
  564.  
  565. '".trim($ship_country)."',
  566.  
  567. '".trim($ship_country_code)."',
  568.  
  569. '".trim($ship_zip)."',
  570.  
  571. '".trim($ship_state)."',
  572.  
  573. '".trim($ship_city)."',
  574.  
  575. '".addslashes($ship_address1)."',
  576.  
  577. '".trim($_POST["business"])."',
  578.  
  579. '".trim($_POST["receiver_email"])."',
  580.  
  581. '".trim($_POST["receiver_id"])."',
  582.  
  583. '".trim($_POST["residence_country"])."',
  584.  
  585. '".trim($_POST["item_name1"])."',
  586.  
  587. '".trim($_POST["item_number1"])."',
  588.  
  589. '".trim($_POST["quantity"])."',
  590.  
  591. '".trim($_POST["shipping"])."',
  592.  
  593. '".trim($_POST["tax"])."',
  594.  
  595. '".trim($currency)."',
  596.  
  597. '".trim($_POST["mc_fee"])."',
  598.  
  599. '".trim($mc_gross)."',
  600.  
  601. '".trim($_POST["mc_gross1"])."',
  602.  
  603. '".trim($_POST["invoice"])."',
  604.  
  605. '".trim($ip)."',
  606.  
  607. '".addslashes(print_r($otherstuff,true))."')";
  608.  
  609.  
  610.  
  611. //debug sql
  612.  
  613. //error_log(date('[Y-m-d H:i e] '). "SQL: " . $sql . PHP_EOL, 3, LOG_FILE);
  614.  
  615.  
  616.  
  617. $result = mysql_query($sql);
  618.  
  619.  
  620.  
  621. //only post shipment when payment is completed (for creation of recurring billing profile, or for recurring/instant payments)
  622.  
  623. if ( trim($payment_status)=="Completed" ) {
  624.  
  625. $path = $_SERVER['DOCUMENT_ROOT'] . "/3/scripts/lib/ATF/".$ATF[getProductCode($_POST["item_number1"])].".php";
  626.  
  627. require_once($path);
  628.  
  629. // Create the client instance
  630.  
  631. $atf = new atf();
  632.  
  633. $date = date("m/d/Y"); //'02/22/2012'
  634.  
  635. $time = date("h:ia"); //'02:01am'
  636.  
  637. $orderID = $txn_id;
  638.  
  639. $total = $mc_gross;
  640.  
  641.  
  642.  
  643. //gets the pname depending on the transaction
  644.  
  645. if ($_POST["item_name1"]!="") {
  646.  
  647. //this is for all instant payments
  648.  
  649. $pname = $_POST["item_name1"];
  650.  
  651. } else if ($_POST["product_name"]!="") {
  652.  
  653. //this is likely for recurring profile CREATED
  654.  
  655. $pname = $_POST["product_name"];
  656.  
  657. } else if ($details["desc"]!="") {
  658.  
  659. //this grabs desc from the recurring profile
  660.  
  661. $pname = $details["desc"];
  662.  
  663. }
  664.  
  665.  
  666.  
  667. //from the pname, extract the sku
  668.  
  669. preg_match("/\(([^\)]*)\)/", $pname, $aMatches);
  670.  
  671. $psku = $aMatches[1];
  672.  
  673.  
  674.  
  675. error_log(date('[Y-m-d H:i e] '). "ATF vars: ". $orderID."|".
  676.  
  677. $date."|".
  678.  
  679. $time."|".
  680.  
  681. $total."|".
  682.  
  683. $ship_fname."|".
  684.  
  685. $ship_lname."|".
  686.  
  687. $ship_address1."|".
  688.  
  689. $ship_address2."|".
  690.  
  691. $ship_city."|".
  692.  
  693. $ship_zip."|".
  694.  
  695. $ship_state."|".
  696.  
  697. $ship_country."|".
  698.  
  699. $ship_phone."|".
  700.  
  701. $ship_email."|".
  702.  
  703. $psku."|".
  704.  
  705. $amount."|".
  706.  
  707. $ip. PHP_EOL, 3, LOG_FILE_ATF);
  708.  
  709.  
  710.  
  711. // Sets city, state, zip to the country if they are unset
  712.  
  713. if ($ship_city =="") { $ship_city = $ship_country; }
  714.  
  715. if ($ship_zip =="") { $ship_zip = $ship_country; }
  716.  
  717. if ($ship_state =="") { $ship_state = $ship_country; }
  718.  
  719.  
  720.  
  721. // Post shipment
  722.  
  723. $callresult = $atf->postShipment(
  724.  
  725. cleanText($orderID),
  726.  
  727. cleanText($date),
  728.  
  729. cleanText($time),
  730.  
  731. cleanText($total),
  732.  
  733. cleanText($ship_fname),
  734.  
  735. cleanText($ship_lname),
  736.  
  737. cleanText($ship_address1),
  738.  
  739. cleanText($ship_address2),
  740.  
  741. cleanText($ship_city),
  742.  
  743. cleanText($ship_zip),
  744.  
  745. cleanText($ship_state),
  746.  
  747. cleanText($ship_country),
  748.  
  749. cleanText($ship_phone),
  750.  
  751. cleanText($ship_email),
  752.  
  753. cleanText($psku),
  754.  
  755. cleanText($amount),
  756.  
  757. cleanText($ip)
  758.  
  759. );
  760.  
  761.  
  762.  
  763. error_log(date('[Y-m-d H:i e] '). "ATF call: ". print_r($callresult,true). PHP_EOL, 3, LOG_FILE_ATF);
  764.  
  765.  
  766.  
  767.  
  768.  
  769. /*******************************************
  770.  
  771. Process ad tracking pixels
  772.  
  773. ********************************************/
  774.  
  775.  
  776.  
  777. //do this for monthly recurring payments
  778.  
  779. if ($psku==$SKU_NUTRI1Monthly) {
  780.  
  781. $adURL = "http://www.nutrifrontier.net/track/a.php?type=sale&value=129.95&id=10&name=Nutrio2+Re-engage+6+bottles&description=";
  782.  
  783. } else {
  784.  
  785. $adURL = "";
  786.  
  787. }
  788.  
  789.  
  790.  
  791. if ($adURL!="") {
  792.  
  793. doCURL($adURL);
  794.  
  795. }
  796.  
  797.  
  798.  
  799. /*******************************************
  800.  
  801. Emails the customer
  802.  
  803. ********************************************/
  804.  
  805.  
  806.  
  807.  
  808.  
  809. $path = $_SERVER['DOCUMENT_ROOT'] . "/scripts/lib/PHPMailer/PHPMailerAutoload.php";
  810.  
  811. require_once($path);
  812.  
  813.  
  814.  
  815. //this includes the email body
  816.  
  817. $path = $_SERVER['DOCUMENT_ROOT'] . "/scripts/lib/include-email.php";
  818.  
  819. require_once($path);
  820.  
  821.  
  822.  
  823. $mail = new PHPMailer;
  824.  
  825. //$mail->SMTPDebug = 3; // Enable verbose debug output
  826.  
  827. $mail->isSMTP(); // Set mailer to use SMTP
  828.  
  829. $mail->Host = 'host.successvantage.com'; // Specify main and backup SMTP servers
  830.  
  831. $mail->SMTPAuth = true; // Enable SMTP authentication
  832.  
  833. $mail->Username = 'noreply@nutrio2.com'; // SMTP username
  834.  
  835. $mail->Password = 'yItv.^*&cVI['; // SMTP password
  836.  
  837. $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
  838.  
  839. $mail->Port = 465; // TCP port to connect to
  840.  
  841.  
  842.  
  843. $mail->From = 'noreply@nutrio2.com';
  844.  
  845. $mail->FromName = 'Nutrio2';
  846.  
  847. //$mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient
  848.  
  849. $mail->addAddress($_POST["payer_email"]); // Name is optional
  850.  
  851. //$mail->addReplyTo('info@example.com', 'Information');
  852.  
  853. //$mail->addCC('cc@example.com');
  854.  
  855. $mail->addBCC('mentismarketing.support@gmail.com');
  856.  
  857. //***************
  858.  
  859. $mail->isHTML(true); // Set email format to HTML
  860.  
  861.  
  862.  
  863. $mail->Subject = 'Nutrio2 Order '.$txn_id;
  864.  
  865. $mail->Body = getEmail( $txn_id,
  866.  
  867. $thispaymentdate,
  868.  
  869. $_POST["first_name"],
  870.  
  871. $_POST["last_name"],
  872.  
  873. $ship_fname,
  874.  
  875. $ship_address1,
  876.  
  877. $ship_city,
  878.  
  879. $ship_state,
  880.  
  881. $ship_zip,
  882.  
  883. $ship_country,
  884.  
  885. $psku,
  886.  
  887. $pname,
  888.  
  889. $mc_gross,
  890.  
  891. $currency );
  892.  
  893. //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  894.  
  895.  
  896.  
  897. /********************
  898.  
  899. * hasoffers postback
  900.  
  901. ********************/
  902.  
  903.  
  904.  
  905. if( isset($hasoffers_cookie) ){
  906.  
  907. $hasOffersURL = "http://tracking.nutrio2-at.com/aff_goal?a=lsr";
  908.  
  909.  
  910.  
  911. //Add goal id is there is one
  912.  
  913. isset($hasoffers_goal) ? $hasOffersURL .= "&goal_id=".$hasoffers_goal : '';
  914.  
  915.  
  916.  
  917. //Add transaction ID
  918.  
  919. $hasOffersURL .= "&transaction_id=".$hasoffers_cookie;
  920.  
  921.  
  922.  
  923. //Add Advertiser Sub IDs
  924.  
  925. $hasOffersURL .= "";
  926.  
  927.  
  928.  
  929. $hasOffersURL .= (isset($aff_sub1) && $aff_sub1 != '')?"&adv_sub=".$aff_sub1:'';
  930.  
  931. $hasOffersURL .= (isset($aff_sub2) && $aff_sub2 != '')?"&adv_sub2=".$aff_sub2:'';
  932.  
  933. $hasOffersURL .= (isset($aff_sub3) && $aff_sub3 != '')?"&adv_sub3=".$aff_sub3:'';
  934.  
  935. $hasOffersURL .= (isset($aff_sub4) && $aff_sub4 != '')?"&adv_sub4=".$aff_sub4:'';
  936.  
  937. $hasOffersURL .= (isset($aff_sub5) && $aff_sub5 != '')?"&adv_sub5=".$aff_sub5:'';
  938.  
  939.  
  940.  
  941. $hasoffers_result = doCURL($hasOffersURL);
  942.  
  943.  
  944.  
  945. $ho_fh = fopen("holog.txt","a");
  946.  
  947. fwrite($ho_fh, $hasoffers_result.' '.$hasOffersURL.' '.$_POST["custom"]);
  948.  
  949. fclose($ho_fh);
  950.  
  951.  
  952.  
  953. if(strpos( $hasoffers_result, 'success=true;') === false ){
  954.  
  955. error_log(date('[Y-m-d H:i e] '). "HasOffers postback failed for txn: $hasoffers_cookie\nData:$hasoffers_result\n\n". PHP_EOL, 3, LOG_FILE_ERRORS);
  956.  
  957. }
  958.  
  959. }else{
  960.  
  961. preg_match("/\((.*)\)/",$product_name,$matches);
  962.  
  963. $conversionSKU = $matches[1];
  964.  
  965.  
  966.  
  967. $sub_id = (isset($aff_sub1) && $aff_sub1 != '')?$aff_sub1:'';
  968.  
  969. $sub_id2 = (isset($aff_sub2) && $aff_sub2 != '')?$aff_sub2:'';
  970.  
  971. $sub_id3 = (isset($aff_sub3) && $aff_sub3 != '')?$aff_sub3:'';
  972.  
  973. $sub_id4 = (isset($aff_sub4) && $aff_sub4 != '')?$aff_sub4:'';
  974.  
  975. $sub_id5 = (isset($aff_sub5) && $aff_sub5 != '')?$aff_sub5:'';
  976.  
  977.  
  978.  
  979. $args = array(
  980.  
  981. 'NetworkId' => 'hvaffiliates',
  982.  
  983. 'Target' => 'Conversion',
  984.  
  985. 'Method' => 'create',
  986.  
  987. 'NetworkToken' => 'NETj0R7lVEL8BJ35JdY5lv5jtZM89M',
  988.  
  989. 'data' => array(
  990.  
  991. 'ip' => $ip,
  992.  
  993. 'offer_id' => '1',
  994.  
  995. 'status' => 'approved',
  996.  
  997. 'revenue' => $_POST['mc_gross'],
  998.  
  999. 'goal_id' => $hasoffers_goal,
  1000.  
  1001. 'payout' => $_POST['mc_gross'],
  1002.  
  1003. 'affiliate_info1' => $sub_id,
  1004.  
  1005. 'affiliate_info2' => $sub_id2,
  1006.  
  1007. 'affiliate_info3' => $sub_id3,
  1008.  
  1009. 'affiliate_info4' => $sub_id4,
  1010.  
  1011. 'affiliate_info5' => $sub_id5,
  1012.  
  1013. 'affiliate_id' => '1'
  1014.  
  1015. ),
  1016.  
  1017. 'return_object' => '1'
  1018.  
  1019. );
  1020.  
  1021.  
  1022.  
  1023. // Initialize cURL
  1024.  
  1025. $curlHandle = curl_init();
  1026.  
  1027.  
  1028.  
  1029. // Configure cURL request
  1030.  
  1031. curl_setopt($curlHandle, CURLOPT_URL, "https://api.hasoffers.com/Apiv3/json");
  1032.  
  1033.  
  1034.  
  1035. // Configure POST
  1036.  
  1037. curl_setopt($curlHandle, CURLOPT_POST, 1);
  1038.  
  1039. curl_setopt($curlHandle, CURLOPT_POSTFIELDS, http_build_query($args));
  1040.  
  1041.  
  1042.  
  1043. // Make sure we can access the response when we execute the call
  1044.  
  1045. curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
  1046.  
  1047.  
  1048.  
  1049. // Execute the API call
  1050.  
  1051. $jsonEncodedApiResponse = curl_exec($curlHandle);
  1052.  
  1053.  
  1054.  
  1055. // Ensure HTTP call was successful
  1056.  
  1057. if($jsonEncodedApiResponse === false) {
  1058.  
  1059. $ho_fh = fopen("holog.txt","a");
  1060.  
  1061. fwrite($ho_fh, $jsonEncodedApiResponse."WOOT\n");
  1062.  
  1063. fclose($ho_fh);
  1064.  
  1065. }
  1066.  
  1067. else{
  1068.  
  1069. // Decode the response from a JSON string to a PHP associative array
  1070.  
  1071. $apiResponse = json_decode($jsonEncodedApiResponse, true);
  1072.  
  1073.  
  1074.  
  1075. // Make sure we got back a well-formed JSON string and that there were no
  1076.  
  1077. // errors when decoding it
  1078.  
  1079. $jsonErrorCode = json_last_error();
  1080.  
  1081. if($jsonErrorCode !== JSON_ERROR_NONE) {
  1082.  
  1083. $ho_fh = fopen("holog.txt","a");
  1084.  
  1085. fwrite($ho_fh, $jsonErrorCode);
  1086.  
  1087. fclose($ho_fh);
  1088.  
  1089. }
  1090.  
  1091.  
  1092.  
  1093. // Print out the response details
  1094.  
  1095. if($apiResponse['response']['status'] === 1) {
  1096.  
  1097. // No errors encountered
  1098.  
  1099. file_put_contents('hosuccess.txt', print_r($apiResponse['response']['data'], true));
  1100.  
  1101. }
  1102.  
  1103. else {
  1104.  
  1105. file_put_contents('hoerrors.txt', print_r($apiResponse['response']['errors'], true));
  1106.  
  1107. }
  1108.  
  1109.  
  1110.  
  1111. $query = "UPDATE ipns SET hasOffersId='".$apiResponse['response']['data']['Conversion']['id']."' WHERE txn_id='".trim($txn_id)."'";
  1112.  
  1113. }
  1114.  
  1115. // Clean up the resource now that we're done with cURL
  1116.  
  1117. curl_close($curlHandle);
  1118.  
  1119. }
  1120.  
  1121.  
  1122.  
  1123. if(!$mail->send()) {
  1124.  
  1125. echo 'Message could not be sent.';
  1126.  
  1127. error_log(date('[Y-m-d H:i e] '). "Mailer Error: " . $mail->ErrorInfo . PHP_EOL, 3, LOG_FILE_ERRORS);
  1128.  
  1129. } else {
  1130.  
  1131. echo 'Message has been sent';
  1132.  
  1133. }
  1134.  
  1135. }
  1136.  
  1137. else if(trim($payment_status)=="Refunded"){
  1138.  
  1139. $ho_fh = fopen("holog.txt","a");
  1140.  
  1141. fwrite($ho_fh, $raw_post_data." ".$hasoffers_cookie);
  1142.  
  1143. fclose($ho_fh);
  1144.  
  1145.  
  1146.  
  1147. if(isset($hasoffers_cookie)){
  1148.  
  1149. $args = array(
  1150.  
  1151. 'NetworkId' => 'hvaffiliates',
  1152.  
  1153. 'Target' => 'Conversion',
  1154.  
  1155. 'Method' => 'update',
  1156.  
  1157. 'NetworkToken' => 'NETj0R7lVEL8BJ35JdY5lv5jtZM89M',
  1158.  
  1159. 'data' => array(
  1160.  
  1161. 'revenue' => '0.00'
  1162.  
  1163. ),
  1164.  
  1165. 'transaction_id' => $hasoffers_cookie
  1166.  
  1167. );
  1168.  
  1169. }else{
  1170.  
  1171. $query = "SELECT hasOffersId FROM ipns WHERE txn_id='".trim($txn_id)."' ORDER BY id ASC LIMIT 1";
  1172.  
  1173. $result = mysql_query($query);
  1174.  
  1175.  
  1176.  
  1177. if($result){
  1178.  
  1179. $row = mysql_fetch_assoc($result);
  1180.  
  1181. $conversionId = $row["hasOffersId"];
  1182.  
  1183. }else{
  1184.  
  1185. error_log(date('[Y-m-d H:i e] '). "MySQL Refund Error: " . trim($txn_id) . PHP_EOL, 3, LOG_FILE_ERRORS);
  1186.  
  1187. }
  1188.  
  1189.  
  1190.  
  1191. $args = array(
  1192.  
  1193. 'NetworkId' => 'hvaffiliates',
  1194.  
  1195. 'Target' => 'Conversion',
  1196.  
  1197. 'Method' => 'update',
  1198.  
  1199. 'NetworkToken' => 'NETj0R7lVEL8BJ35JdY5lv5jtZM89M',
  1200.  
  1201. 'id' => $conversionId,
  1202.  
  1203. 'data' => array(
  1204.  
  1205. 'status' => 'rejected'
  1206.  
  1207. )
  1208.  
  1209. );
  1210.  
  1211. }
  1212.  
  1213.  
  1214.  
  1215. // Initialize cURL
  1216.  
  1217. $curlHandle = curl_init();
  1218.  
  1219.  
  1220.  
  1221. // Configure cURL request
  1222.  
  1223. curl_setopt($curlHandle, CURLOPT_URL, "https://api.hasoffers.com/Apiv3/json");
  1224.  
  1225.  
  1226.  
  1227. // Configure POST
  1228.  
  1229. curl_setopt($curlHandle, CURLOPT_POST, 1);
  1230.  
  1231. curl_setopt($curlHandle, CURLOPT_POSTFIELDS, http_build_query($args));
  1232.  
  1233.  
  1234.  
  1235. // Make sure we can access the response when we execute the call
  1236.  
  1237. curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
  1238.  
  1239.  
  1240.  
  1241. // Execute the API call
  1242.  
  1243. $jsonEncodedApiResponse = curl_exec($curlHandle);
  1244.  
  1245.  
  1246.  
  1247. // Ensure HTTP call was successful
  1248.  
  1249. if($jsonEncodedApiResponse === false) {
  1250.  
  1251. $ho_fh = fopen("holog.txt","a");
  1252.  
  1253. fwrite($ho_fh, $jsonEncodedApiResponse."WOOT");
  1254.  
  1255. fclose($ho_fh);
  1256.  
  1257. }
  1258.  
  1259.  
  1260.  
  1261. // Clean up the resource now that we're done with cURL
  1262.  
  1263. curl_close($curlHandle);
  1264.  
  1265.  
  1266.  
  1267. // Decode the response from a JSON string to a PHP associative array
  1268.  
  1269. $apiResponse = json_decode($jsonEncodedApiResponse, true);
  1270.  
  1271.  
  1272.  
  1273. // Make sure we got back a well-formed JSON string and that there were no
  1274.  
  1275. // errors when decoding it
  1276.  
  1277. $jsonErrorCode = json_last_error();
  1278.  
  1279. if($jsonErrorCode !== JSON_ERROR_NONE) {
  1280.  
  1281. $ho_fh = fopen("holog.txt","a");
  1282.  
  1283. fwrite($ho_fh, $jsonErrorCode);
  1284.  
  1285. fclose($ho_fh);
  1286.  
  1287. }
  1288.  
  1289.  
  1290.  
  1291. // Print out the response details
  1292.  
  1293. if($apiResponse['response']['status'] === 1) {
  1294.  
  1295. // No errors encountered
  1296.  
  1297. file_put_contents('hosuccess.txt', print_r($apiResponse['response']['data'], true));
  1298.  
  1299. }
  1300.  
  1301. else {
  1302.  
  1303. file_put_contents('hoerrors.txt', print_r($apiResponse['response']['errors'], true));
  1304.  
  1305. }
  1306.  
  1307. }
  1308.  
  1309.  
  1310.  
  1311. if(DEBUG == true) {
  1312.  
  1313. error_log(date('[Y-m-d H:i e] '). "Verified IPN: $req ". PHP_EOL, 3, LOG_FILE);
  1314.  
  1315. }
  1316.  
  1317. } else if (strcmp ($res, "INVALID") == 0) {
  1318.  
  1319. // log for manual investigation
  1320.  
  1321. // Add business logic here which deals with invalid IPN messages
  1322.  
  1323. if(DEBUG == true) {
  1324.  
  1325. error_log(date('[Y-m-d H:i e] '). "Invalid IPN: $req" . PHP_EOL, 3, LOG_FILE);
  1326.  
  1327. }
  1328.  
  1329. }
  1330.  
  1331.  
  1332.  
  1333. //save a copy of IPN into tracker DB
  1334.  
  1335. require_once('ipn-track.php');
  1336.  
  1337.  
  1338.  
  1339. function doCURL($url) {
  1340.  
  1341.  
  1342.  
  1343. $ch = curl_init();
  1344.  
  1345. curl_setopt($ch, CURLOPT_URL, $url);
  1346.  
  1347.  
  1348.  
  1349. //return the transfer as a string
  1350.  
  1351. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  1352.  
  1353.  
  1354.  
  1355. // $output contains the output string
  1356.  
  1357. $output = curl_exec($ch);
  1358.  
  1359. curl_close($ch);
  1360.  
  1361. return $output;
  1362.  
  1363. }
  1364.  
  1365.  
  1366.  
  1367. function cleanText($text) {
  1368.  
  1369.  
  1370.  
  1371. // Remove all none utf-8 symbols
  1372.  
  1373. $text = htmlspecialchars_decode(htmlspecialchars($text, ENT_IGNORE, 'UTF-8'));
  1374.  
  1375. // remove non-breaking spaces and other non-standart spaces
  1376.  
  1377. $text = preg_replace('~\s+~u', ' ', $text);
  1378.  
  1379. // replace controls symbols with "?"
  1380.  
  1381. $text = preg_replace('~\p{C}+~u', '?', $text);
  1382.  
  1383.  
  1384.  
  1385. return $text;
  1386.  
  1387.  
  1388.  
  1389. }
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395. /********
  1396.  
  1397.  
  1398.  
  1399. Example of Paypal Profile
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405. Recurring profile details
  1406.  
  1407.  
  1408.  
  1409. array(50) {
  1410.  
  1411. ["ACK"]=>
  1412.  
  1413. string(7) "Success"
  1414.  
  1415. ["VERSION"]=>
  1416.  
  1417. string(4) "82.0"
  1418.  
  1419. ["BUILD"]=>
  1420.  
  1421. string(8) "17098556"
  1422.  
  1423. ["profile_id"]=>
  1424.  
  1425. string(14) "I-HY9V9MY0PE4W"
  1426.  
  1427. ["status"]=>
  1428.  
  1429. string(6) "Active"
  1430.  
  1431. ["autobill"]=>
  1432.  
  1433. string(10) "NoAutoBill"
  1434.  
  1435. ["desc"]=>
  1436.  
  1437. string(89) "Time magazine monthly subscription for 1 year. 1 month free trial, then 29.99 GBP monthly"
  1438.  
  1439. ["max_failed"]=>
  1440.  
  1441. string(1) "0"
  1442.  
  1443. ["name"]=>
  1444.  
  1445. string(10) "buyer test"
  1446.  
  1447. ["start_date"]=>
  1448.  
  1449. string(20) "2015-06-30T16:00:00Z"
  1450.  
  1451. ["next_billing_date"]=>
  1452.  
  1453. string(20) "2015-07-01T10:00:00Z"
  1454.  
  1455. ["num_cycles_completed"]=>
  1456.  
  1457. string(1) "0"
  1458.  
  1459. ["num_cycles_remaining"]=>
  1460.  
  1461. string(1) "1"
  1462.  
  1463. ["outstanding_balance"]=>
  1464.  
  1465. string(4) "0.00"
  1466.  
  1467. ["failed_payments"]=>
  1468.  
  1469. string(1) "0"
  1470.  
  1471. ["trial_amount_paid"]=>
  1472.  
  1473. string(4) "0.00"
  1474.  
  1475. ["regular_amount_paid"]=>
  1476.  
  1477. string(4) "0.00"
  1478.  
  1479. ["aggregate_amount"]=>
  1480.  
  1481. string(4) "0.00"
  1482.  
  1483. ["aggregate_optional_amount"]=>
  1484.  
  1485. string(4) "0.00"
  1486.  
  1487. ["final_payment_date"]=>
  1488.  
  1489. string(20) "2016-07-01T10:00:00Z"
  1490.  
  1491. ["timestamp"]=>
  1492.  
  1493. string(20) "2015-06-28T07:00:50Z"
  1494.  
  1495. ["correlation_id"]=>
  1496.  
  1497. string(13) "a1fa47056c5c7"
  1498.  
  1499. ["shipping_street"]=>
  1500.  
  1501. string(16) "123 Thomson Rd. "
  1502.  
  1503. ["shipping_city"]=>
  1504.  
  1505. string(9) "Singapore"
  1506.  
  1507. ["shipping_zip"]=>
  1508.  
  1509. string(6) "308123"
  1510.  
  1511. ["shipping_country_code"]=>
  1512.  
  1513. string(2) "SG"
  1514.  
  1515. ["shipping_country"]=>
  1516.  
  1517. string(2) "SG"
  1518.  
  1519. ["shipping_country_name"]=>
  1520.  
  1521. string(9) "Singapore"
  1522.  
  1523. ["shipping_address_owner"]=>
  1524.  
  1525. string(6) "PayPal"
  1526.  
  1527. ["shipping_address_status"]=>
  1528.  
  1529. string(11) "Unconfirmed"
  1530.  
  1531. ["period"]=>
  1532.  
  1533. string(5) "Month"
  1534.  
  1535. ["frequency"]=>
  1536.  
  1537. string(1) "1"
  1538.  
  1539. ["total_cycles"]=>
  1540.  
  1541. string(1) "1"
  1542.  
  1543. ["currency"]=>
  1544.  
  1545. string(3) "GBP"
  1546.  
  1547. ["cost"]=>
  1548.  
  1549. string(5) "29.99"
  1550.  
  1551. ["shipping"]=>
  1552.  
  1553. string(4) "0.00"
  1554.  
  1555. ["tax"]=>
  1556.  
  1557. string(4) "0.00"
  1558.  
  1559. ["trial_period"]=>
  1560.  
  1561. string(5) "Month"
  1562.  
  1563. ["trial_frequency"]=>
  1564.  
  1565. string(1) "1"
  1566.  
  1567. ["trial_total_cycles"]=>
  1568.  
  1569. string(1) "1"
  1570.  
  1571. ["trial_currency_code"]=>
  1572.  
  1573. string(3) "GBP"
  1574.  
  1575. ["trial_cost"]=>
  1576.  
  1577. string(4) "0.00"
  1578.  
  1579. ["trial_shipping_amount"]=>
  1580.  
  1581. string(4) "0.00"
  1582.  
  1583. ["trial_tax_amount"]=>
  1584.  
  1585. string(4) "0.00"
  1586.  
  1587. ["regular_billing_period"]=>
  1588.  
  1589. string(5) "Month"
  1590.  
  1591. ["regular_billing_frequency"]=>
  1592.  
  1593. string(1) "1"
  1594.  
  1595. ["regular_total_billing_cycles"]=>
  1596.  
  1597. string(2) "12"
  1598.  
  1599. ["regular_currency_code"]=>
  1600.  
  1601. string(3) "GBP"
  1602.  
  1603. ["regular_shipping_amount"]=>
  1604.  
  1605. string(4) "0.00"
  1606.  
  1607. ["regular_tax_amount"]=>
  1608.  
  1609. string(4) "0.00"
  1610.  
  1611. }
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621. Recurring profile created::::
  1622.  
  1623.  
  1624.  
  1625. {"payment_cycle":"Daily","txn_type":"recurring_payment_profile_created","last_name":"buyer","initial_payment_status":"Completed","next_payment_date":"03:00:00 Jul 01, 2015 PDT","residence_country":"SG","initial_payment_amount":"1.00","rp_invoice_id":"103.245.95.50","currency_code":"USD","time_created":"00:24:47 Jul 01, 2015 PDT","verify_sign":"AN9zikv75AwD7FSABy-2H9RV1ETNAKBIFCX-19lgfr5pRs7dp0BR3jNQ","period_type":" Regular","payer_status":"verified","test_ipn":"1","tax":"0.00","payer_email":"paypal-buyer@brainmaxima.com","first_name":"test","receiver_email":"paypal-facilitator@brainmaxima.com","payer_id":"GPACWYCF3836U","product_type":"1","initial_payment_txn_id":"2HW30276WH825815R","shipping":"0.00","amount_per_cycle":"9.99","profile_status":"Active","charset":"gb2312","notify_version":"3.8","amount":"9.99","outstanding_balance":"0.00","recurring_payment_id":"I-KA4L0YUC1H9T","product_name":"Time magazine monthly subscription for 1 year. 1 month free trial, then 29.99 USD daily","ipn_track_id":"4b27a7e4c1e9"}
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631. Recurring payment::::
  1632.  
  1633.  
  1634.  
  1635. {"mc_gross":"9.99","period_type":" Regular","outstanding_balance":"0.00","next_payment_date":"03:00:00 Jun 29, 2015 PDT","protection_eligibility":"Eligible","payment_cycle":"Daily","address_status":"unconfirmed","tax":"0.00","payer_id":"GPACWYCF3836U","address_street":"123 Thomson Rd.","payment_date":"03:41:09 Jun 28, 2015 PDT","payment_status":"Completed","product_name":"Time magazine monthly subscription for 1 year. 1 month free trial, then 29.99 USD daily","charset":"gb2312","rp_invoice_id":"132.147.72.52","recurring_payment_id":"I-4EB8UFKB2LL5","address_zip":"308123","first_name":"test","mc_fee":"0.64","address_country_code":"SG","address_name":"buyer test","notify_version":"3.8","amount_per_cycle":"9.99","payer_status":"verified","currency_code":"USD","business":"paypal-facilitator@brainmaxima.com","address_country":"Singapore","address_city":"Singapore","verify_sign":"Agfb8DnF8gs6j4EwIwFPjQ7Rt9a.At5RBxymPJ.fwSjS0mt91UNJdiL1","payer_email":"paypal-buyer@brainmaxima.com","initial_payment_amount":"1.00","profile_status":"Active","amount":"9.99","txn_id":"71S220809S1846841","payment_type":"instant","last_name":"buyer","address_state":"","receiver_email":"paypal-facilitator@brainmaxima.com","payment_fee":"0.64","receiver_id":"FZBJUFBDMSBZJ","txn_type":"recurring_payment","mc_currency":"USD","residence_country":"SG","test_ipn":"1","transaction_subject":"Time magazine monthly subscription for 1 year. 1 month free trial, then 29.99 USD daily","payment_gross":"9.99","shipping":"0.00","product_type":"1","time_created":"00:32:46 Jun 28, 2015 PDT","ipn_track_id":"88e6336ee79"}
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641. One time payment::::
  1642.  
  1643.  
  1644.  
  1645. {"mc_gross":"69.97","protection_eligibility":"Eligible","address_status":"unconfirmed","item_number1":"1984","payer_id":"GPACWYCF3836U","tax":"0.00","address_street":"123 Thomson Rd.","payment_date":"08:56:44 Jun 24, 2015 PDT","payment_status":"Completed","charset":"gb2312","address_zip":"308123","mc_shipping":"0.00","mc_handling":"0.00","first_name":"test","mc_fee":"2.68","address_country_code":"SG","address_name":"buyer test","notify_version":"3.8","custom":"5","payer_status":"verified","address_country":"Singapore","num_cart_items":"1","mc_handling1":"0.00","address_city":"Singapore","verify_sign":"AMbszvxvYSF5dhC2-PBwiJRHzT8yALLUM2kWqwI-m6msJ0OyQ2NlvySO","payer_email":"paypal-buyer@brainmaxima.com","mc_shipping1":"0.00","tax1":"0.00","txn_id":"3G580325DH949014M","payment_type":"instant","last_name":"buyer","address_state":"","item_name1":"Product ABC","receiver_email":"paypal-facilitator@brainmaxima.com","payment_fee":"2.68","quantity1":"1","receiver_id":"FZBJUFBDMSBZJ","txn_type":"cart","mc_gross_1":"69.97","mc_currency":"USD","residence_country":"SG","test_ipn":"1","transaction_subject":"","payment_gross":"69.97","ipn_track_id":"20bae702572a5"}
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651. ********/
  1652.  
  1653.  
  1654.  
  1655. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement