Payment Gateway Information

Overview
If you would like to add a new gateway, read this page carefully. If you don't understand it, please find a developer who can help. Adding a new gateway is not easy and should be avoided if you are a beginner. Gateways should support statics and subscription payments.

If you need a new gateway adding, please contact me for a quote.
1 Preparation
1. Get the gatewayID from your admin area.

2. Copy the 'control/gateways/1' folder and name the folder with your new ID. The '1' folder is the Paypal files, which can be used for reference.

3. Open the 'control/callback.php' file and add a reference for the new gateway. You must reference a unique POST var for the gateway so that the callback knows which gateway is sending the call. Use the other statements as reference.

'GW_CALLBACK' and 'GW_CALLBACK_REF' MUST exist and be populated correctly with a string value.
2 Modify Gateway Class
Open 'control/gateways/NEWID/class.gateway.php' file. The functions below must be changed for your own values. Refer to the new gateway docs for help and also to the existing values for reference.

payment() - contains the data sent back from the gateway. Array keys must not be changed.

validate() - validates the callback. Should return 'OK' or 'ERR'.

fields() - returns the field array containing the post vars to send to the payment gateway. Refer to your gateway docs for the correct names and formatting.

server() - the gateway post url to receive the data. Can be hard coded or referenced from a parameter.
3 Parameters
Any parameters you add for your gateway in the admin CP can be referenced in the '$this->params' array in the payment gateway class. This is global in scope in the gateway class. Example:

Gateway ID: 3
Name: var1, Value: 'Some Value'

echo $this->params[3]['var1'];

or in the gateway class you can also use:

echo $this->params[$this->gateID]['var1'];
4 Modify Callback Ops
Open 'control/gateways/NEWID/callback.php' file. You should change the routines based on the '$paymentStatus' value. Look in the file you copied for reference. You can use the same vars as Paypal, but you`ll need to adjust the calculations for each status. Look at lines 148 through to 185. No further changes should be required in this file.

To reference parameters in this file use the '$GATE->params' object.
5 Custom Callback Ops
Open 'control/gateways/NEWID/custom-ops.php' file and see the notes.
Help & Support
If you need a quote for a gateway integration, please contact me.