[guadec-web] Log error before exiting on non completed ipn



commit ab87fd71ddde085cd20b15794fed57128161ba82
Author: Pascal Terjan <pterjan gmail com>
Date:   Thu Jul 17 09:13:37 2014 +0000

    Log error before exiting on non completed ipn

 guadec/ipn.php |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/guadec/ipn.php b/guadec/ipn.php
index 3e0be83..df862c3 100755
--- a/guadec/ipn.php
+++ b/guadec/ipn.php
@@ -52,8 +52,6 @@ if ($verified) {
         $errmsg .= "'Payment status' does not match: ";
         $errmsg .= $_POST['payment_status']."\n";
         $errmsg .= $_POST['receiver_email']."\n";
-        // simply ignore any IPN that is not completed
-        exit(0); 
     }
 
     // 2. Make sure seller email matches your primary account email.
@@ -61,7 +59,13 @@ if ($verified) {
         $errmsg .= "'receiver_email' does not match: ";
         $errmsg .= $_POST['receiver_email']."\n";
     }
-    
+
+    // If payment was not for us or failed, ignore it
+    if (!empty($errmsg)) {
+        error_log($listener->getTextReport());
+        exit(0);
+    }
+
     // 3. Make sure the amount(s) paid match
     $total_fee = floatval($cvar['totalfee']);
     if ($_POST['mc_gross'] != $total_fee) {


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