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));
}
}
?>