Fixed issues in paypal payment procession
authorMarcel Werk <burntime@woltlab.com>
Mon, 6 Oct 2014 13:59:46 +0000 (15:59 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 6 Oct 2014 13:59:46 +0000 (15:59 +0200)
wcfsetup/install/files/lib/action/PaypalCallbackAction.class.php

index d5af4a4a3e06a4e4a56f09ac4f43d74e5c3bdc5b..7e8ac4775aa36e75fd7904eb8f2baca916cd696b 100644 (file)
@@ -69,16 +69,19 @@ class PaypalCallbackAction extends AbstractAction {
                        $processor = $objectType->getProcessor();
                        
                        // get status
+                       $transactionType = (!empty($_POST['txn_type']) ? $_POST['txn_type'] : '');
+                       $paymentStatus = (!empty($_POST['payment_status']) ? $_POST['payment_status'] : '');
+                       
                        $status = '';
-                       if ($_POST['txn_type'] == 'web_accept' || $_POST['txn_type'] == 'subscr_payment') {
-                               if ($_POST['payment_status'] == 'Completed') {
+                       if ($transactionType == 'web_accept' || $transactionType == 'subscr_payment') {
+                               if ($paymentStatus == 'Completed') {
                                        $status = 'completed';
                                }  
                        }
-                       if ($_POST['payment_status'] == 'Refunded' || $_POST['payment_status'] == 'Reversed') {
+                       if ($paymentStatus == 'Refunded' || $paymentStatus == 'Reversed') {
                                $status = 'reversed';
                        }
-                       if ($_POST['payment_status'] == 'Canceled_Reversal') {
+                       if ($paymentStatus == 'Canceled_Reversal') {
                                $status = 'canceled_reversal';
                        }