Magento Extending Paypal Standard - Can't instantiate Model
I am working with Paypal 1.4.2
I have extended Paypal S开发者_开发技巧tandard 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())
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:
- The classname of your model matches exactly (case sensitive)
- The path to your class matches exactly (case sensitive)
- You are extending from the original class.
精彩评论