1

I'm trying to create a new payment method for our Magento EE 1.12 installation. I followed this tutorial and gotten as far as making the payment method with its options appear in the admin, and also the payment method's name as an option in the Checkout page. Unfortunately, the tutorial stops there.

I was wondering what file I should create (and where to put it), so that when the user clicks on my payment method's radio button in the Checkout page, it will show textboxes for the credit card number, CVV, and dropdowns for expiry date and card type (VISA, etc). Note that this is for the Checkout page. Once I get to add these textboxes and dropdown, how do I get their values so I can process them in during the authorize() method?

Lastly, is there an official documentation from Magento about creating a new payment method module? I find the Magento documentation too overwhelming for a beginner like myself. Could you point me to some useful references, like the tutorial above, but more complete?

1 Answer 1

2

It seams that you are trying to replicate the behavior of the payment methods CC (credit card). Magento already has this. You can can look for guidance in the files used for this method:

  • app/code/core/Mage/Payment/Block/Form/Cc.php
  • app/code/core/Mage/Payment/Block/Info/Cc.php
  • app/code/core/Mage/Payment/Model/Method/Cc.php
  • app/design/frontend/base/default/template/payment/form/cc.phtml
  • app/design/adminhtml/default/default/template/payment/form/cc.phtml
  • app/code/core/Mage/Payment/etc/config.xml - look for tags named <cc>
4
  • Should I modify the codes for those files, or do I need to create new ones and pattern them after those files you listed? (Are there any guides in configuring those files?) I need to implement the payment gateway's ... umm.. API. That is, send an XML request in a specific format and get response, etc.
    – Obay
    Mar 27, 2013 at 12:21
  • Do not modify the core code. you can try to model your payment method using the files for the credit card methods. you asked how can you add credit card fields in the checkout. The files I listed should give you an idea on what you need to do. You should also be able to get the values of the fields to use in your authorize() method. Good luck :).
    – Marius
    Mar 27, 2013 at 12:35
  • Where can I find a complete list of the files? Or is that it?
    – Obay
    Mar 27, 2013 at 12:49
  • I think this is it. I hope I didn't miss any of them.
    – Marius
    Mar 27, 2013 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.