enter the pirate

A poorly maintained blog of technology

Archive for August, 2009

Magento Payment Methods

Let’s talk about Magento payment methods, three words that strike fear in the hearts of many.

Recently I was contracted to develop a payment method for Magento that would have very similar functionality to PayPal Standard, with a bit of a ghetto rigged twist. Because of the insane amount of OOP, creating the methods can be a bit of a chore, especially considering the lack of good documentation.

There are many pieces involved in creating a payment method. This is an example of the file structure of my working method:

/root
  /app
    /code
      /local
         /Mage
           /MyMethod
              /Block
                 /Standard
                    /Form.php
                    /Redirect.php
              /controllers
                 /StandardController.php

Hate yourself yet? If not, there are four (4) more folders in the “MyMethod” directory that are full of adventure and hell. Keep in mind that these folder names are case sensitive. I’ll post a tutorial on how to create your own payment method soon enough.

All in all, as far as open source eCommerce goes, Magento is incredibly robust and feature rich. Once you learn the black magic of Magento, it can be a pretty powerful tool.