Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Custom CC Payment Module Issue in 1.4.0.1
 
Online Stuff
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2010-01-25
Centurion, South Africa
 

Hi friends,

I have a store running in 1.3.2.4, without any issues.  I have spent the past week or so trying to upgrade it to 1.4.0.1, and ran in to a lot of problems and incompatibilities, all of which I solved, except for my custom credit card payment module.  Please understand that I am not an experienced programmer, I know my way around Magento now, but I am by no means an expert.

I have tracked the problem down to the saving of the “info” object in the validate() function in the Model.  This is the old code from 1.3.2.4 that works OK:

public function validate()
    
{
        parent
::validate();
        
$info $this->getInfoInstance();
        
$errorMsg false;
        
$session $this->getCheckout();
        
$session->setInfoInstance($info);
        return 
$this;
    
}

Running this code in 1.4.0.1, it breaks quite spectacularly, completely corrupting the session cookie (or at least that is what I think).  In var/report/ the following report is generated:

a:5:{i:0;s:200:"Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Node no longer exists  in /var/www/magento/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 115";i:1;s:1852:"#0 [internal function]: mageCoreErrorHandler(2, 'session_start()...', '/var/www/magent...', 115, Array)
#1 /var/www/magento/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php(115): session_start()
#2 /var/www/magento/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php(155): Mage_Core_Model_Session_Abstract_Varien->start('frontend')
#3 /var/www/magento/app/code/core/Mage/Core/Model/Session/Abstract.php(84): Mage_Core_Model_Session_Abstract_Varien->init('core', 'frontend')
#4 /var/www/magento/app/code/core/Mage/Core/Model/Session.php(39): Mage_Core_Model_Session_Abstract->init('core', 'frontend')
#5 /var/www/magento/app/code/core/Mage/Core/Model/Config.php(1206): Mage_Core_Model_Session->__construct(Array)
#6 /var/www/magento/app/Mage.php(432): Mage_Core_Model_Config->getModelInstance('core/session', Array)
#7 /var/www/magento/app/Mage.php(446): Mage::getModel('core/session', Array)
#8 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(483): Mage::getSingleton('core/session', Array)
#9 /var/www/magento/app/code/core/Mage/Core/Controller/Front/Action.php(59): Mage_Core_Controller_Varien_Action->preDispatch()
#10 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Core_Controller_Front_Action->preDispatch()
#11 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#12 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(177): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /var/www/magento/app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#14 /var/www/magento/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#15 /var/www/magento/index.php(78): Mage::run('', 'store')
#16 {main}"
;s:3:"url";s:19:"/magento/index.php/";s:11:"script_name";s:18:"/magento/index.php";s:4:"skin";s:3:"aps";}

If I remove the “session” related code from this validate() function, then no crash happens (great!), but then in the payment “redirect” Block module, it fails to retrieve the “info” ($info is NULL):

$session Mage::getSingleton('checkout/session');
$info $session->getInfoInstance();

So my question is, how do I successfully save the credit card info in the Model, to be safely extracted again when we get to the code in Block?  I am not attached to any specific means of doing this, it does not have to be using the Session.  If there is another way to achieve it I would be grateful!

Thank you in advance for your assistance!

Regards,

Andre

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top