Skip to main content
added 9088 characters in body
Source Link
Sid
  • 186
  • 11

how do i redirect to specific url when i click the place order button.. right now, I it is redirecting me to the place where I don't want to?

Unable to redirect to the third party site after clicking place order.. I think I am having problem with my controller and .phtml file. Help me with the controller and .phtml files.. How do I write corresponding controller and .phtml code for this one?

config.xml
<?xml version="1.0" ?>
<config>
    <modules>
        <MyModule_ESewa>
            <version>1.0.0</version>    
        </MyModule_ESewa>   
    </modules>
    <global>
        <!-- declare helper class -->
        <helpers>
            <esewa>
                <class>MyModule_ESewa_Helper</class>
            </esewa>
        </helpers>
        <!-- model -->
        <models>
            <esewa>
                <class>MyModule_ESewa_Model</class>
            </esewa>
        </models>
        <blocks>
            <esewa>
                <class>MyModule_ESewa_Block</class>
            </esewa>
        </blocks>
        <!-- end of model -->
    </global>   
    <!-- start start of declaretion of payment -->
    <!-- declare default configuration values for this module -->
    <default>
    <!-- 'payment' configuration section (tab) -->
        <payment>
    <!-- 'newmodule' configuration group (fieldset) -->
            <esewa>
    <!-- by default this payment method is inactive -->
                <active>0</active>
    <!-- model to handle logic for this payment method -->          
                <model>esewa/standard</model>
                <!-- order status for new orders paid by this payment method -->
                <order_status>pending</order_status>
                <!-- set payment title to -->
                <title>Custom Payment</title>
                <allowspecific>0</allowspecific>

            </esewa>        
        </payment>
    </default>
</config> 




system.xml

<?xml version="1.0"?>
<config>
        <sections>
                <!-- goto  Payment Section -->
                <payment>
                        <!-- now goto payment group -->
                        <groups>
                                <esewa  translate="label" module="esewa">
                                    <label>eSewa</label>
                                    <sort_order>999</sort_order>
                                    <show_in_default>1</show_in_default>
                                    <show_in_website>1</show_in_website>
                                    <show_in_store>1</show_in_store>
                                    <fields>
                                        <active translate="label">
                                            <label>Enable</label>
                                            <frontend_type>select</frontend_type>
                                            <source_model>adminhtml/system_config_source_yesno</source_model>   
                                            <sort_order>1</sort_order>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website></show_in_website>
                                            <show_in_store>1</show_in_store>
                                        </active>   
                                        <order_status translate="label">
                                            <label>New Order Status</label>
                                            <frontend_type>select</frontend_type>
                                            <source_model>adminhtml/system_config_source_order_status_newprocessing</source_model>
                                            <sort_order>2</sort_order>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website>1</show_in_website>
                                            <show_in_store>1</show_in_store>
                                        </order_status>
                                        <title translate="label">
                                            <label>Title</label>
                                            <frontend_type>text</frontend_type>
                                            <sort_order>1</sort_order>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website>1</show_in_website>
                                            <show_in_store>1</show_in_store>
                                        </title>
                                        <allowspecific translate="label">
                                            <label>Payment from Applicable Countries</label>
                                            <frontend_type>allowspecific</frontend_type>
                                            <sort_order>50</sort_order>
                                            <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website>1</show_in_website>
                                            <show_in_store>0</show_in_store>
                                        </allowspecific>
                                        <specificcountry translate="label">
                                            <label>Payment from Specific Countries</label>
                                            <frontend_type>multiselect</frontend_type>
                                            <sort_order>51</sort_order>
                                            <source_model>adminhtml/system_config_source_country</source_model>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website>1</show_in_website>
                                            <show_in_store>0</show_in_store>
                                            <can_be_empty>1</can_be_empty>
                                        </specificcountry>
                                        <sort_order translate="label">
                                            <label>Sort Order</label>
                                            <frontend_type>text</frontend_type>
                                            <sort_order>100</sort_order>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website>1</show_in_website>
                                            <show_in_store>0</show_in_store>
                                            <frontend_class>validate-number</frontend_class>
                                        </sort_order>

                                        <submit_url>
                                            <label>Gateway URL</label>
                                                <frontend_type>text</frontend_type>
                                                    <sort_order>58</sort_order>
                                                    <show_in_default>1</show_in_default>
                                                    <show_in_website>1</show_in_website>
                                                    <show_in_store>0</show_in_store>
                                        </submit_url>

                                        <merchant_id>
                                            <label>Merchant ID</label>
                                            <frontend_type>text</frontend_type>
                                            <sort_order>59</sort_order>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website>1</show_in_website>
                                            <show_in_store>0</show_in_store>
                                        </merchant_id>  
                                </fields>
                                </esewa>
                        </groups>   
                </payment>
        </sections>
</config>  



standard.php
<?php
class MyModule_ESewa_Model_Standard extends Mage_Payment_Model_Method_Abstract
{
    protected $_code = 'esewa';
    protected $_canAuthorize = true;
    protected $_isGateway = true;

    
    public function getOrderPlaceRedirectUrl()
    {
        
        return Mage::getUrl('esewa/standard/redirect', array('_secure' => true));
    }
    
}
?> 

how do i redirect to specific url when i click the place order button.. right now, I it is redirecting me to the place where I don't want to?

Unable to redirect to the third party site after clicking place order.. I think I am having problem with my controller and .phtml file. Help me with the controller and .phtml files.. How do I write corresponding controller and .phtml code for this one?

config.xml
<?xml version="1.0" ?>
<config>
    <modules>
        <MyModule_ESewa>
            <version>1.0.0</version>    
        </MyModule_ESewa>   
    </modules>
    <global>
        <!-- declare helper class -->
        <helpers>
            <esewa>
                <class>MyModule_ESewa_Helper</class>
            </esewa>
        </helpers>
        <!-- model -->
        <models>
            <esewa>
                <class>MyModule_ESewa_Model</class>
            </esewa>
        </models>
        <blocks>
            <esewa>
                <class>MyModule_ESewa_Block</class>
            </esewa>
        </blocks>
        <!-- end of model -->
    </global>   
    <!-- start start of declaretion of payment -->
    <!-- declare default configuration values for this module -->
    <default>
    <!-- 'payment' configuration section (tab) -->
        <payment>
    <!-- 'newmodule' configuration group (fieldset) -->
            <esewa>
    <!-- by default this payment method is inactive -->
                <active>0</active>
    <!-- model to handle logic for this payment method -->          
                <model>esewa/standard</model>
                <!-- order status for new orders paid by this payment method -->
                <order_status>pending</order_status>
                <!-- set payment title to -->
                <title>Custom Payment</title>
                <allowspecific>0</allowspecific>

            </esewa>        
        </payment>
    </default>
</config> 




system.xml

<?xml version="1.0"?>
<config>
        <sections>
                <!-- goto  Payment Section -->
                <payment>
                        <!-- now goto payment group -->
                        <groups>
                                <esewa  translate="label" module="esewa">
                                    <label>eSewa</label>
                                    <sort_order>999</sort_order>
                                    <show_in_default>1</show_in_default>
                                    <show_in_website>1</show_in_website>
                                    <show_in_store>1</show_in_store>
                                    <fields>
                                        <active translate="label">
                                            <label>Enable</label>
                                            <frontend_type>select</frontend_type>
                                            <source_model>adminhtml/system_config_source_yesno</source_model>   
                                            <sort_order>1</sort_order>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website></show_in_website>
                                            <show_in_store>1</show_in_store>
                                        </active>   
                                        <order_status translate="label">
                                            <label>New Order Status</label>
                                            <frontend_type>select</frontend_type>
                                            <source_model>adminhtml/system_config_source_order_status_newprocessing</source_model>
                                            <sort_order>2</sort_order>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website>1</show_in_website>
                                            <show_in_store>1</show_in_store>
                                        </order_status>
                                        <title translate="label">
                                            <label>Title</label>
                                            <frontend_type>text</frontend_type>
                                            <sort_order>1</sort_order>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website>1</show_in_website>
                                            <show_in_store>1</show_in_store>
                                        </title>
                                        <allowspecific translate="label">
                                            <label>Payment from Applicable Countries</label>
                                            <frontend_type>allowspecific</frontend_type>
                                            <sort_order>50</sort_order>
                                            <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website>1</show_in_website>
                                            <show_in_store>0</show_in_store>
                                        </allowspecific>
                                        <specificcountry translate="label">
                                            <label>Payment from Specific Countries</label>
                                            <frontend_type>multiselect</frontend_type>
                                            <sort_order>51</sort_order>
                                            <source_model>adminhtml/system_config_source_country</source_model>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website>1</show_in_website>
                                            <show_in_store>0</show_in_store>
                                            <can_be_empty>1</can_be_empty>
                                        </specificcountry>
                                        <sort_order translate="label">
                                            <label>Sort Order</label>
                                            <frontend_type>text</frontend_type>
                                            <sort_order>100</sort_order>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website>1</show_in_website>
                                            <show_in_store>0</show_in_store>
                                            <frontend_class>validate-number</frontend_class>
                                        </sort_order>

                                        <submit_url>
                                            <label>Gateway URL</label>
                                                <frontend_type>text</frontend_type>
                                                    <sort_order>58</sort_order>
                                                    <show_in_default>1</show_in_default>
                                                    <show_in_website>1</show_in_website>
                                                    <show_in_store>0</show_in_store>
                                        </submit_url>

                                        <merchant_id>
                                            <label>Merchant ID</label>
                                            <frontend_type>text</frontend_type>
                                            <sort_order>59</sort_order>
                                            <show_in_default>1</show_in_default>
                                            <show_in_website>1</show_in_website>
                                            <show_in_store>0</show_in_store>
                                        </merchant_id>  
                                </fields>
                                </esewa>
                        </groups>   
                </payment>
        </sections>
</config>  



standard.php
<?php
class MyModule_ESewa_Model_Standard extends Mage_Payment_Model_Method_Abstract
{
    protected $_code = 'esewa';
    protected $_canAuthorize = true;
    protected $_isGateway = true;

    
    public function getOrderPlaceRedirectUrl()
    {
        
        return Mage::getUrl('esewa/standard/redirect', array('_secure' => true));
    }
    
}
?> 
deleted 733 characters in body
Source Link
Sid
  • 186
  • 11

I am tryinghow do i redirect to create custom payment module in magento following http://inchoo.net/magento/how-to-create-magento-payment-module/ this tutorial.I have done exactly same as mentioned byspecific url when i click the blog but I am not able to see it in my admin sectionplace order button. Below is the system.xml right now, config.xml and standard.php files that I created for this module. Is there something I am missing or thereit is another wayredirecting me to make it work. However when I delete this below code from app/etc/modules/MyModules_ESewa.xml, then the Payment Methods Tab works fine.. but obviously, i cannot see my module on System -> Configuration -> advanced tab. Is there something wrong with the below codeplace where I don't want to?

<config>
    <modules>
        <MyModule_ESewa>
            <active>true</active>
            <codePool>local</codePool>
        </MyModule_ESewa>
    </modules>
</config>

I am trying to create custom payment module in magento following http://inchoo.net/magento/how-to-create-magento-payment-module/ this tutorial.I have done exactly same as mentioned by the blog but I am not able to see it in my admin section. Below is the system.xml, config.xml and standard.php files that I created for this module. Is there something I am missing or there is another way to make it work. However when I delete this below code from app/etc/modules/MyModules_ESewa.xml, then the Payment Methods Tab works fine.. but obviously, i cannot see my module on System -> Configuration -> advanced tab. Is there something wrong with the below code?

<config>
    <modules>
        <MyModule_ESewa>
            <active>true</active>
            <codePool>local</codePool>
        </MyModule_ESewa>
    </modules>
</config>

how do i redirect to specific url when i click the place order button.. right now, I it is redirecting me to the place where I don't want to?

deleted 4790 characters in body
Source Link
Sid
  • 186
  • 11
Loading
Source Link
Sid
  • 186
  • 11
Loading