Laser card custom payment module for Magento

While helping my brother out with bringing his sports shop online, I discovered Magento which is a pretty kick ass piece of php. One thing that Magento doesn’t have at the moment is a payment module for Irish Laser Debit cards, so I decided to write my own.

Some resources that I found useful were this and this, The first being from the Magento wiki and the second from a forum post.

The process is pretty straight forward once you get your head around all the config files, there are basically 10 files needed for the module (Coolbreeze is just the package name I gave the modules akin to the Mage group in magento) :

app/code/local/Coolbreese/LaserPayment/Block/Form.php
the controller for displaying the input form in the store and admin

app/code/local/Coolbreese/LaserPayment/Block/Info.php
the controller for displaying the card details in the store and admin

app/code/local/Coolbreese/LaserPayment/etc/config.xml
config stuff

app/code/local/Coolbreese/LaserPayment/etc/system.xml
more config stuff

app/code/local/Coolbreese/LaserPayment/Model/Laser.php
where the validation etc happens

app/design/adminhtml/default/default/template/laserpayment/form.phtml
the form template for the admin interface

app/design/adminhtml/default/default/template/laserpayment/info.phtml
the details display template for the admin interface

app/design/frontend/default/default/template/laserpayment/form.phtml
form display in the store

app/design/frontend/default/default/template/laserpayment/info.phtml
details display in the store

app/etc/modules/Coolbreeze_LaserPayment.xml
the main config file which tells magento that this module exist.

Here for your viewing pleasure is the module code to download.

To install it in a Magento installation just copy the app folder into the magento root and all the files will be put in the right place. Then go to admin -> System -> Configuration -> Payment Methods and enable the module.

Some cavaets :

I take no responsibility for breaking anything whatsoever so install this at your own risk or better yet look at the code and improve it.

The Laser number validation is pretty simple at the moment with no modulus checks. Something like this would probably be useful also as there is no client side validation just server side which works ok but is not ideal.

I’d love to hear feedback from anyone who uses this or finds it useful.

11 thoughts on “Laser card custom payment module for Magento

  1. andrew Post author

    Sorry Hiten, I dont know what you are asking here please try to phrase your question better. Once installed the module should show up as a payment method in magento admin

    Reply
  2. andrew Post author

    It does a simple validation on number length but no modulus checks currently as I mentioned at the end of the post.

    Reply
  3. Amanda

    Hello,

    I don’t anything about web design but own the above website and i want to take laser cards on my website.

    Would you be able to email regarding this and give me some advice on the best way to do it?

    Please include your rates to intergrate something for me.

    Many Thanks

    Reply
  4. Nilesh

    Hello Andrew!
    I hv three testing modules bt Im confuse when my modules not displaying on frontend site, then I read ur blog & got the right way to implement them Thnx for Detail explination of new payment module integration 🙂

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *