| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Gravity Forms eWAY |
| 4 |
Plugin URI: http://shop.webaware.com.au/downloads/gravity-forms-eway/ |
| 5 |
Description: Integrates Gravity Forms with eWAY payment gateway, enabling end users to purchase goods and services through Gravity Forms. |
| 6 |
Version: 1.6.0 |
| 7 |
Author: WebAware |
| 8 |
Author URI: http://webaware.com.au/ |
| 9 |
*/ |
| 10 |
|
| 11 |
/* |
| 12 |
copyright (c) 2012-2014 WebAware Pty Ltd (email : support@webaware.com.au) |
| 13 |
|
| 14 |
This program is free software; you can redistribute it and/or |
| 15 |
modify it under the terms of the GNU General Public License |
| 16 |
as published by the Free Software Foundation; either version 2 |
| 17 |
of the License, or (at your option) any later version. |
| 18 |
|
| 19 |
This program is distributed in the hope that it will be useful, |
| 20 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
GNU General Public License for more details. |
| 23 |
|
| 24 |
You should have received a copy of the GNU General Public License |
| 25 |
along with this program; if not, write to the Free Software |
| 26 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 27 |
*/ |
| 28 |
|
| 29 |
if (!defined('GFEWAY_PLUGIN_ROOT')) { |
| 30 |
define('GFEWAY_PLUGIN_ROOT', dirname(__FILE__) . '/'); |
| 31 |
define('GFEWAY_PLUGIN_NAME', basename(dirname(__FILE__)) . '/' . basename(__FILE__)); |
| 32 |
define('GFEWAY_PLUGIN_FILE', __FILE__); |
| 33 |
define('GFEWAY_PLUGIN_OPTIONS', 'gfeway_plugin'); |
| 34 |
define('GFEWAY_PLUGIN_VERSION', '1.6.0'); |
| 35 |
|
| 36 |
// error message names |
| 37 |
define('GFEWAY_ERROR_ALREADY_SUBMITTED', 'gfeway_err_already'); |
| 38 |
define('GFEWAY_ERROR_NO_AMOUNT', 'gfeway_err_no_amount'); |
| 39 |
define('GFEWAY_ERROR_REQ_CARD_HOLDER', 'gfeway_err_req_card_holder'); |
| 40 |
define('GFEWAY_ERROR_REQ_CARD_NAME', 'gfeway_err_req_card_name'); |
| 41 |
define('GFEWAY_ERROR_EWAY_FAIL', 'gfeway_err_eway_fail'); |
| 42 |
|
| 43 |
// custom fields |
| 44 |
define('GFEWAY_FIELD_RECURRING', 'gfewayrecurring'); |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* autoload classes as/when needed |
| 49 |
* |
| 50 |
* @param string $class_name name of class to attempt to load |
| 51 |
*/ |
| 52 |
function gfeway_autoload($class_name) { |
| 53 |
static $classMap = array ( |
| 54 |
'GFEwayAdmin' => 'includes/class.GFEwayAdmin.php', |
| 55 |
'GFEwayFormData' => 'includes/class.GFEwayFormData.php', |
| 56 |
'GFEwayOptionsAdmin' => 'includes/class.GFEwayOptionsAdmin.php', |
| 57 |
'GFEwayPayment' => 'includes/class.GFEwayPayment.php', |
| 58 |
'GFEwayPlugin' => 'includes/class.GFEwayPlugin.php', |
| 59 |
'GFEwayRecurringField' => 'includes/class.GFEwayRecurringField.php', |
| 60 |
'GFEwayRecurringPayment' => 'includes/class.GFEwayRecurringPayment.php', |
| 61 |
'GFEwayStoredPayment' => 'includes/class.GFEwayStoredPayment.php', |
| 62 |
); |
| 63 |
|
| 64 |
if (isset($classMap[$class_name])) { |
| 65 |
require GFEWAY_PLUGIN_ROOT . $classMap[$class_name]; |
| 66 |
} |
| 67 |
} |
| 68 |
spl_autoload_register('gfeway_autoload'); |
| 69 |
|
| 70 |
// instantiate the plug-in |
| 71 |
GFEwayPlugin::getInstance(); |
| 72 |
|