Monday, September 10, 2012

How to create custom magento payment module - Part 4

app\design\frontend\default\default\etc\mycustom.xml


<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
    </default>
    < mycustom _index_index>
        <reference name="content">
        <block type="mycustom/ mycustom " name=" mycustom " template=" mycustom / mycustom .phtml" />
        </reference>
    </ mycustom _index_index>
</layout>

app\design\frontend\default\default\template\mycustom\form\mycustom.phtml

This is options to add your custom card number and expiry date in the payment methos step while you select your custom payment method.


<?php $_code=$this->getMethodCode() ?>
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
    <li>
        <label for="<?php echo $_code ?>_check_no" class="required"><em>*</em><?php echo $this->__('Mycustom Card Number:') ?></label>
        <span class="input-box">
            <input type="text" title="<?php echo $this->__('Check No#') ?>" class="input-text required-entry" id="<?php echo $_code ?>_check_no" name="payment[check_no]" value="<?php echo $this->htmlEscape($this->getInfoData('check_no')) ?>" />
        </span>
    </li>
  <li>
        <label for="<?php //echo $_code ?>_check_date" class="required"><em>*</em><?php echo $this->__('Expire At (format 2012-08-01 ):') ?></label>
        <span class="input-box">
            <input type="text" title="<?php echo $this->__('Check Date:') ?>" class="input-text required-entry" id="<?php echo $_code ?>_check_date" name="payment[check_date]" value="<?php echo $this->htmlEscape($this->getInfoData('check_date')) ?>" />
        </span>
    </li>
</ul>
<div>
<?php echo $this->getMethod()->getConfigData('message');?>
</div>

Finally when you select the custom payment in the checkout page and give the custom card number, expire date and click to submit the final step it will redirect your custom payment form.And fill the details and redirect to the site to finsih the payment successfully.

Implement and give your feedback's!!!!cheers!!!

No comments:

Post a Comment