Implementing a Payment Gateway requires PHP knowledge and is not part of support, this documentation is written for programmers. Already available Gateways can be seen here.
For your basic Payment Gateway you will need to create at least the following files:
You can download a sample Gateway here (a mockup)
<extension folder="pay_example" type="gateway" method="upgrade"> <name>Example Payment Gateway</name> </extension>
The Folder value should match the name you plan to use for your extension. Do not use space or punctuation.
Use the Joomla Form XML Standards to set up witch fields you need the user to setup in order to post payments to the gateway. For instance you might need the Seller email:
<?xml version="1.0" encoding="UTF-8"?> <form> <fieldset> <field default="change@me.com" required="true" size="30" class="inputbox" description="" label="Paypal Email" type="text" name="selleremail"/> </fieldset> </form>
defined('_JEXEC') or die('Restricted access'); require_once(realpath(dirname(__FILE__).DS.'..'.DS.'..'.DS.'..'.DS.'classes'.DS.'gateways.php')); class Pay_Example extends TheFactoryPaymentGateway { var $name='pay_paypal'; var $fullname='Paypal Payment Gateway'; function getPaymentForm($order,$items,$urls,$shipping=null,$tax=null) { $model=&JModel::getInstance('Gateways','JTheFactoryModel'); $params=$model->loadGatewayParams($this->name); $result = 'your html for the form payment here'; return $result; } function processIPN() { $model=&JModel::getInstance('Gateways','JTheFactoryModel'); $params=$model->loadGatewayParams($this->name); $paylog=&JTable::getInstance('PaymentLogTable','JTheFactory'); //paylog data here //validate IPN $paylog->store(); return $paylog; } }
Your Controller Class must be named exactly as the folder value in the Manifest File. This is why it is important to use only acceptable characters for a class name.
There are several functions you should/could implement:
function getPaymentForm - should return the HTML code for the payment gateway. This will be displayed when an user checks out an order using this particular gateway.
Parameters are:
function processIPN - is called when the Payment gateway has processed the payment (instant payment notification)
function processTask - function is called for the frontend task orderprocessor.gateway with your gateway as parameter. Used for instance in multi step processings check the Bankwire Gateway
function getLogo - returns the url to the gateway logo (default is the logo.png in your gateway folder)
function saveAdminForm - called when the Admin setup form is saved
function showAdminForm - called when the Admin setup form is displayed
Pack all files needed into a zip archive (make sure manifest.xml is in the top folder). This will be the Installation zip.
In Administrator Backend go to Components>Auction Factory>Settings
Then click on "Payment Methods Config" and choose "Install New Item" from the toolbar.
Upload the gateway installation zip and then you should see it in the gateways list.