0

I am working with Paypal 1.4.2

I have extended Paypal Standard module to allow for some custom coding

My config.xml file looks like the following:

<?xml version="1.0"?>
<config>
<modules>
    <XYZ_Paypal>
        <version>1.0.0</version>
    </XYZ_Paypal>
</modules>

<global>
    <models>
        <paypal>
            <rewrite>
                <standard>XYZ_Paypal_Model_Standard</standard>
            </rewrite>

            <rewrite>
                <ipn>XYZ_Paypal_Model_Ipn</ipn>
            </rewrite>
        </paypal>
    </models>
</global>

Now When i am trying to checkout using paypal i am getting the following error:

Fatal error: Call to a member function getPaypalUrl() on a non-object in /var/www/magento/app/code/core/Mage/Paypal/Block/Standard/Redirect.php on line 33

Looks like it can't instantiate Standard Class object as Line 33 is as follows:

$form->setAction($standard->getConfig()->getpaypalUrl())
Adam Wagner
  • 15,469
  • 7
  • 52
  • 66

1 Answers1

0

Please merge the two rewrite statements:

...
    <paypal>
        <rewrite>
            <standard>XYZ_Paypal_Model_Standard</standard>
            <ipn>XYZ_Paypal_Model_Ipn</ipn>
        </rewrite>
    </paypal>
...

Also make sure that:

  1. The classname of your model matches exactly (case sensitive)
  2. The path to your class matches exactly (case sensitive)
  3. You are extending from the original class.
Daniel Sloof
  • 12,568
  • 14
  • 72
  • 106