Skip to content

Instantly share code, notes, and snippets.

@LeeSaferite
Created November 4, 2010 12:36
Show Gist options
  • Save LeeSaferite/662396 to your computer and use it in GitHub Desktop.
Save LeeSaferite/662396 to your computer and use it in GitHub Desktop.
Mage_PayPal fix for versions prior to 1.4
diff --git a/app/code/core/Mage/Paypal/Model/Standard.php b/app/code/core/Mage/Paypal/Model/Standard.php
index e77e3d8..e70efea 100644
--- a/app/code/core/Mage/Paypal/Model/Standard.php
+++ b/app/code/core/Mage/Paypal/Model/Standard.php
@@ -368,8 +368,16 @@ class Mage_Paypal_Model_Standard extends Mage_Payment_Model_Method_Abstract
*/
} else {
-
- if ($this->getIpnFormData('mc_gross')!=$order->getBaseGrandTotal()) {
+ $businessAccount = Mage::getStoreConfig('paypal/wps/business_account', $order->getStoreId());
+ $receiver = ($this->getIpnFormData('business') ? $this->getIpnFormData('business') : $this->getIpnFormData('receiver_email'));
+ if ($receiver != $businessAccount) {
+ $order->addStatusToHistory(
+ $order->getStatus(),//continue setting current order status
+ Mage::helper('paypal')->__('Paypal IPN Invalid %s.', 'Invalid account')
+ );
+ $order->save();
+ }
+ else if ($this->getIpnFormData('mc_gross')!=$order->getBaseGrandTotal()) {
//when grand total does not equal, need to have some logic to take care
$order->addStatusToHistory(
$order->getStatus(),//continue setting current order status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment