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

modules
 
janim007
Jr. Member
 
Total Posts:  29
Joined:  2008-09-09
 

hi all ,
i have made payment method module
it’s working ok
but it dosent print my texts ,

1- i redirect magento after order to redirectAction which call _toHtml function in processing class
2- this function communicate with my website throw (curl) ,
2- onsuccess i redirect browser by javascript to my successAction an on fail to failureAction
3- it goes to those pages , but no text displayed

protected function failureAction()
    
{
        $session 
$this->getCheckout();
        
$session->getMessages(true);
        
$session->addError('you have an error');

        
$this->loadLayout();
        
$this->_initLayoutMessages('checkout/session');
        
$this->renderLayout();

    
}

and succeessAction is :
protected function successAction()
    
{
        $session 
$this->getCheckout();
        
$session->getMessages(true);
        
$session->unsVcsRealOrderId();
        
$session->setQuoteId($session->getVcsQuoteId(true));
        
$session->getQuote()->setIsActive(false)->save();

    
$session->addSuccess('Done ok');
        
$this->loadLayout();
        
$this->_initLayoutMessages('checkout/session');
        
$this->renderLayout();
        
$this->_order Mage::getModel('sales/order')->loadByIncrementId($_GET['id']);
        
$this->_paymentInst $this->_order->getPayment()->getMethodInstance();
            if (
$this->_order->canInvoice()) {
                $invoice 
$this->_order->prepareInvoice();
                
$invoice->register()->capture();
                
Mage::getModel('core/resource_transaction')
                    ->
addObject($invoice)
                    ->
addObject($invoice->getOrder())
                    ->
save();
            
}
            $this
->_order->save();
            if(
$this->_order->getId() && $this->_sendNewOrderEmail)
                
$this->_order->sendNewOrderEmail();
        
        
$order Mage::getModel('sales/order');
        
$order->load($this->getCheckout()->getLastOrderId());
        
$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_HOLDED);
       
       
    
}
and in line 14 it display error , it can’t recognize getMethodInstance() ,
where is my poblem ,
i want to display my texts
in success.phtml i have a lot of texts and links too , but i can’t see it whyyyyy

Thanx fo any help

 
Magento Community Magento Community
Magento Community
Magento Community
 
janim007
Jr. Member
 
Total Posts:  29
Joined:  2008-09-09
 

where are you guys ?????

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

1) Please print your full error, we need more information.

2) Depending on javascript (esp for redirects) is bad practice.

3) The Zend framework handles getting POST and GET requets (and filters them to stop XSS attackes I believe)
Using something like
$this->getRequest()->getParams(); to get the GET/POST variables (Search around controller code to check it out).

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