3 month of free 24/7 email support for buyers.
Developer manual: Adding payment gateway
CafeEngine can be easily integrate with most of payment gateways. To add new
Payment Gateway to CafeEngine you would create one PHP class only.
Each payment gateway class would be located at
/classes/gateways/. This class would have one property only:
var $name='<Gateway name>';
It just a name that will appear in admin area. Constructor of this class
usually does nothing.
Payment gateway class would have following methods:
| Method |
Description |
| button() |
Return Smarty code that show button that will appear on checkout
page. id of button would be the same as class name.
|
| form() |
Return Smarty code of form that appear on the billing page. You may make
form with hidden elements only that will be automatically submitted to
Payment gateway URL. We're highly recommend to keep no credit card data
on the same server where CafeEngine is hosted by security reasons.
|
| action() |
Called to handle data submitted to from returned by form() method. Here you
may call Payment gateway API to process the payment.
|
| settings_form() |
Return a part of form(Smarty code) that appear in admin area on
Settings->Payment Gateways page. This form would have all settings for this
Payment Gateway. Payment Gateway settings supposed to store in
include/options.php with other CafeEngine settings. All fields of this form
looking like o[<name of parameter>] will be stored in CafeEngine settings
automatically and will be accessible in $options variable. You may use
this method to check that gateway installed and make some install actions if no.
|
| settings_manage() |
Method called to manage data submitted to form returned by
settings_form(). This metod called before $options will be saved.
You need to write code here in additional settings processing required.
|
| details($orderID) |
Return payment-related data as a Smarty code. Called to show payment data for
given order. Called from admin area only.
|
|