Fix “Notice: Undefined property:” in PayPal Advanced

While reviewing your system logs, you may see a “Notice: Undefined property” message if you’re using Magento with PayPal’s advanced payment methods.

The message would be something like this:

Notice: Undefined property: Mage_Paypal_PayflowadvancedController::$_configType in …/app/code/core/Mage/Paypal/Controller/Express/Abstract.php on line 53
Notice: Undefined property: Mage_Paypal_PayflowadvancedController::$_configMethod in …/app/code/core/Mage/Paypal/Controller/Express/Abstract.php on line 53

After doing some searching, the fix is pretty straightforward –

OPEN: app/code/core/Mage/PayPal/controllers/PayflowadvancedController.php

COPY TO:
app/code/local/Mage/PayPal/controllers/PayflowadvancedController.php

add the following lines:


class Mage_Paypal_PayflowadvancedController extends Mage_Paypal_Controller_Express_Abstract
{

// added to avoid ERR (3): Notice: Undefined property: Mage_Paypal_PayflowadvancedController::$_configType in .../app/code/core/Mage/Paypal/Controller/Express/Abstract.php on line 53
protected $_configType = 'paypal/config';
protected $_configMethod = Mage_Paypal_Model_Config::METHOD_PAYFLOWADVANCED;

/**
* When a customer cancel payment from payflow gateway.
*
* @return void
*/
public function cancelPaymentAction()
{

Upload your changes and checkout via PayPal and the error message should be gone!

Many thanks to Marius for highlighting the fix

 

Leave a Reply