[guadec-web] Final IPN file: without database access



commit 18f55296c8bf5c6a15899d9619bc9cf17580e424
Author: Saumya Dwivedi <saumya zero gmail com>
Date:   Tue Jul 8 11:22:43 2014 +0530

    Final IPN file: without database access

 guadec/confirm-payment.php |    2 +-
 guadec/ipn.php             |   34 ++++++++++++++++++++--------------
 2 files changed, 21 insertions(+), 15 deletions(-)
---
diff --git a/guadec/confirm-payment.php b/guadec/confirm-payment.php
index 58ef716..989d6ea 100644
--- a/guadec/confirm-payment.php
+++ b/guadec/confirm-payment.php
@@ -94,7 +94,7 @@ if (!empty($_POST)) {
                "totalfee=".$tamount
                                ;
                $mailContent .= $registerInfo;
-               $subject = "From GUADEC 2014 Registration";
+               $subject = "GUADEC 2014 Registration";
                $headers = "From: GUADEC 2014 Registration Script <some-address gnome org>";
 
                $wpdb->insert($table_name, array('timeofregistration' => date("Y-m-d H:i:s"),
diff --git a/guadec/ipn.php b/guadec/ipn.php
index 5558026..00252cd 100755
--- a/guadec/ipn.php
+++ b/guadec/ipn.php
@@ -27,8 +27,6 @@ global $wpdb;
 try {
     $listener->requirePostMethod();
     $verified = $listener->processIpn();
-
-    error_log("atleast in try block");
 } catch (Exception $e) {
     error_log($e->getMessage());
     exit(0);
@@ -38,7 +36,6 @@ try {
 
 if ($verified) {
     // : Implement additional fraud checks and MySQL storage
- error_log("verified!\n");   
    
     $errmsg = '';   // stores errors from fraud checks
     
@@ -51,11 +48,6 @@ if ($verified) {
     $ckey = $dsplit[0];
     $cvalue = ($dsplit[1] == null)?'0': $dsplit[1];
     $cvar[$ckey] = $cvalue;
-    error_log("dsjnfsdjnfdjsjbsf\n");   
-    error_log($cvar[$ckey]);
-    error_log($ckey);
-//  error_log($cvalue);
-//  error_log($csplit[$i]);
     $i = $i + 1;
     }    
     $headers = "From: GUADEC 2014 Registration Script <membership-committee gnome org>\n";
@@ -92,15 +84,17 @@ if ($verified) {
     if (!empty($errmsg)) {
     
         // manually investigate errors from the fraud checking
+        $body .= "Registration Payment Successful-with fraud warning ";
         $body = "IPN failed fraud checks: \n$errmsg\n\n";
-        $body .= $listener->getTextReport();
 
-        $body .= "Registration Payment Successful-with fraud warning ";
         //append with the real payment details
         $body .= $cvar['name'];
+        $body .= " with email ";
+        $body .= $cvar['email'];
+        $body .= $listener->getTextReport();
         error_log($body);
         mail($_POST['receiver_email'], 'IPN Fraud Warning', $body, $headers);
-        mail($_POST['payer_email'], 'IPN Fraud Warning', $body, $headers);
+        mail($_POST['payer_email'], 'GUADEC-2014 Registration Payment:Waiting for Confirmation', $body, 
$headers);
         
     } else {
 
@@ -123,9 +117,21 @@ if ($verified) {
         $body .= $cvar['email'];
         $body .= $listener->getTextReport();
         error_log($body);
-        mail($_POST['receiver_email'], 'Registration Successful', $body, $headers);
-        mail($_POST['payer_email'], 'Registration Successful', $body, $headers);
-        mail($cvar['email'], 'Registration Successful', $body, $headers);
+        mail($_POST['receiver_email'], 'GUADEC-2014 Registration Payment Successful', $body, $headers);
+        mail($_POST['payer_email'], 'GUADEC-2014 Registration Successful', $body, $headers);
+        $email_content =
+        "Name: " . $cvar['name'] . "\r\n".
+        "Email: " . $email . "\r\n" .
+        "Time: " . date("Y-m-d H:i:s"). "\r\n".
+        "Arrival: ". $arrive . "\r\n".
+        "Departure: ". $depart . "\r\n".
+        "Entry-Fee Paid: ". $entry ."\r\n".
+        "Lunch-Fee Paid: ".$lamount."\r\n".
+        "Accomodation-Fee Paid: ".$aamount."\r\n".
+        "Total Amount Paid: ".$tamount
+        ;
+        $body .= $email_content;
+        mail($cvar['email'], 'GUADEC-2014 Registration Successful', $body, $headers);
     }
 } 
 else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]