My Custom Payment Module is appearing on front end but its multiselect field is not loading.
config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Magik_Paymentpro>
<version>0.1.0</version>
</Magik_Paymentpro>
</modules>
<global>
<models>
<paymentpro>
<class>Magik_Paymentpro_Model</class>
</paymentpro>
</models>
</global>
<default>
<payment>
<paymentpro>
<active>1</active>
<model>paymentpro/paymentmethod</model>
<order_status>processing</order_status>
<title>TCS Cash Payment Methods</title>
</paymentpro>
</payment>
</default>
</config>
system.xml
<?xml version="1.0"?>
<config>
<sections>
<!-- payment tab -->
<payment>
<groups>
<!-- paymentpro fieldset -->
<paymentpro translate="label" module="paygate">
<!-- will have title 'Cash On Delivery' -->
<label>TCS Cash Payment Methods</label>
<!-- position between other payment methods -->
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<fields>
<!-- is this payment method active for the website? -->
<active translate="label">
<!-- label for the field -->
<label>Enabled</label>
<!-- input type for configuration value -->
<frontend_type>select</frontend_type>
<!-- model to take the option values from -->
<source_model>adminhtml/system_config_source_yesno</source_model>
<!-- field position -->
<sort_order>1</sort_order>
<!-- do not show this field in store scope -->
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</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</source_model>
<!--<source_model>adminhtml/system_config_source_order_status_new</source_model>-->
<!--<source_model>adminhtml/system_config_source_order_status_processing</source_model>-->
<sort_order>2</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</order_status>
<title translate="label">
<label>TCS Cash Payment Methods</label>
<frontend_type>text</frontend_type>
<sort_order>3</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>4</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>1</show_in_store>
</allowspecific>
<specificcountry translate="label">
<label>Payment from Specific countries</label>
<frontend_type>multiselect</frontend_type>
<sort_order>5</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>1</show_in_store>
</specificcountry>
<cashmethod translate="label">
<label>Cash Method</label>
<frontend_type>multiselect</frontend_type>
<sort_order>6</sort_order>
<source_model>paymentpro/paymentmethod</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</cashmethod>
</fields>
</paymentpro>
</groups>
</payment>
</sections>
</config>
Magik/Paymentpro/Model/Paymentmethod.php
<?php
class Magik_Paymentpro_Model_Paymentmethod extends Mage_Payment_Model_Method_Abstract
{
protected $_code = 'paymentpro';
protected $_isGateway = true;
protected $_canAuthorize = true;
protected $_canCapture = true;
protected $_canCapturePartial = false;
protected $_canRefund = true;
protected $_canVoid = true;
protected $_canUseInternal = true;
protected $_canUseCheckout = true;
protected $_canUseForMultishipping = true;
protected $_canSaveCc = false;
//protected $_formBlockType = 'payment/form_checkmo';
//protected $_infoBlockType = 'payment/info_cod';
/**
* Assign data to info model instance
*
* @param mixed $data
* @return Mage_Payment_Model_Method_Checkmo
*/
public function toOptionArray()
{
return array(
array('value' => 0, 'label' => 'Cash On Delivery'),
array('value' => 1, 'label' => 'Cash At Doorstep') );
}
public function authorize(Varien_Object $payment, $amount){
$data = $payment->getData();
/*
$data = array(
store_id,
customer_payment_id,
method,
additional_data,
po_number,
cc_type,
cc_number_enc,
cc_last4,
cc_owner,
cc_exp_month,
cc_exp_year,
cc_number,
cc_cid,
cc_ss_issue,
cc_ss_start_month,
cc_ss_start_year,
parent_id,
amount_ordered,
base_amount_ordered,
shipping_amount,
base_shipping_amount,
method_instance)
*/
}
public function capture(Varien_Object $payment, $amount){
// Grab stored payment data array for processing
$paymentData = unserialize($payment->getAdditionalData());
}
public function void(Varien_Object $payment){
// actions when order is voided occur here
}
public function refund(Varien_Object $payment, $amount){
// actions when order is refunded occur here
}
public function assignData($data){
$details = array();
if ($this->getPayableTo()) {
$details['payable_to'] = $this->getPayableTo();
}
if ($this->getMailingAddress()) {
$details['mailing_address'] = $this->getMailingAddress();
}
if (!empty($details)) {
$this->getInfoInstance()->setAdditionalData(serialize($details));
}
return $this;
}
public function getPayableTo(){
return $this->getConfigData('payable_to');
}
public function getMailingAddress(){
return $this->getConfigData('mailing_address');
}
}
layout/paymentpro.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<catalog_product_view>
<reference name="product.info">
<block type="paymentpro/catalog_product_view_profile" name="product.info.additional.recurring.schedule" as="recurring_info" template="paymentpro/catalog/product/view/profile/schedule.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
<action method="setTitle" translate="value"><value>Recurring Profile</value></action>
</block>
</reference>
<reference name="product.info.options.wrapper">
<block type="paymentpro/catalog_product_view_profile" name="product.info.options.recurring" as="recurring_options" template="paymentpro/catalog/product/view/profile/options.phtml"/>
</reference>
</catalog_product_view>
</layout>
paymentpro/paymentpro.phtml
<?php
// Retrieve order
$_order = new Mage_Sales_Model_Order();
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$_order->loadByIncrementId($orderId);
?>
<form name="paymentproform" method="post" action="http://www.gateway.com/the_url_they_gave_me">
<input type="hidden" name="orderid" value="<?php echo $orderId; ?>">
<input type="hidden" name="grandtotal" value="<?php echo $_order->getBaseGrandTotal(); ?>">
</form>
<script type="text/javascript">
document.paymentproform.submit();
</script>
etc/modules/Magik_Paymentpro.xml
<?xml version="1.0"?>
<config>
<modules>
<!-- declare Magik_Paymentpro module -->
<Magik_Paymentpro>
<!-- this is an active module -->
<active>true</active>
<!-- this module will be located in app/code/local code pool -->
<codePool>local</codePool>
<!-- specify dependencies for correct module loading order -->
<depends>
<Mage_Payment />
</depends>
<!-- declare module's version information for database updates -->
<version>0.1.0</version>
</Magik_Paymentpro>
</modules>
</config>