PluginProbe
Gravity Forms Eway / 2.4.1
Gravity Forms Eway v2.4.1
2.7.0 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.8.0 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 All 56 releases
gravityforms-eway / includes / bootstrap.php

bootstrap.php in Gravity Forms Eway 2.4.1, at includes/bootstrap.php

53 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5
6 const GFEWAY_PLUGIN_OPTIONS = 'gfeway_plugin';
7
8 // error message names
9 const GFEWAY_ERROR_ALREADY_SUBMITTED = 'gfeway_err_already';
10 const GFEWAY_ERROR_NO_AMOUNT = 'gfeway_err_no_amount';
11 const GFEWAY_ERROR_REQ_CARD_HOLDER = 'gfeway_err_req_card_holder';
12 const GFEWAY_ERROR_REQ_CARD_NAME = 'gfeway_err_req_card_name';
13 const GFEWAY_ERROR_EWAY_FAIL = 'gfeway_err_eway_fail';
14
15 // custom fields
16 const GFEWAY_FIELD_RECURRING = 'gfewayrecurring';
17
18 // minimum versions required
19 const GFEWAY_MIN_VERSION_GF = '1.9.15';
20
21 /**
22 * custom exception types
23 */
24 class GFEwayException extends Exception {}
25 class GFEwayCurlException extends Exception {}
26
27 /**
28 * kick start the plugin
29 */
30 add_action('plugins_loaded', function() {
31 require GFEWAY_PLUGIN_ROOT . 'includes/functions.php';
32 require GFEWAY_PLUGIN_ROOT . 'includes/class.GFEwayPlugin.php';
33 GFEwayPlugin::getInstance()->addHooks();
34 }, 5);
35
36 /**
37 * autoload classes as/when needed
38 * @param string $class_name name of class to attempt to load
39 */
40 spl_autoload_register(function($class_name) {
41 static $classMap = [
42 'GFEwayPayment' => 'includes/class.GFEwayPayment.php',
43 'GFEwayRapidAPI' => 'includes/class.GFEwayRapidAPI.php',
44 'GFEwayRapidAPIResponse' => 'includes/class.GFEwayRapidAPIResponse.php',
45 'GFEwayRecurringPayment' => 'includes/class.GFEwayRecurringPayment.php',
46 'GFEwayStoredPayment' => 'includes/class.GFEwayStoredPayment.php',
47 ];
48
49 if (isset($classMap[$class_name])) {
50 require GFEWAY_PLUGIN_ROOT . $classMap[$class_name];
51 }
52 });
53