forked from aubreypwd-old/gravityforms-firstdata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
93 lines (71 loc) · 2.55 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/*
Plugin Name: Gravity Forms + First Data Global Gateway e4
Plugin URI: https://wordpress.org/plugins/gravity-forms-first-data-global-gateway-addon/
Description: Gravity Forms + First Data Global Gateway e4 is a plugin and addon for Gravity Forms that will allow you to process products using the First Data Global Gateway e4 API.
Version: 1.1
Author: Aubrey Portwood of Excion
Author URI: http://excion.co
License: GPL2
*/
/* Copyright 2013 Aubrey Portwood (email : [email protected])
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// Load up the basic setup, which will allow others
// to hack it's use without Gravity Forms using the
// request-method.
//
// Gravity forms integration should load only
// if the class exists.
// == First Data Integration ==
// First Data e4 PHP Wrapper
// https://github.com/VinceG/php-first-data-api
require_once "php-first-data-api/src/VinceG/FirstDataApi/FirstData.php";
// Primary API functions for FirstData.
// Can be used w/out GF
require_once "gffd-fd.php";
// Include the request method.
// Can be used with or w/out GF.
require_once "gffd-fd-request-method.php";
// Include debugging.
require_once "gffd-fd-debugging.php";
// == Gravity Forms Integration ==
// Fixes the __FILE__ issue with symlinked
// plugins in WP.
require_once('fix-__FILE__.php');
// First, check that we have the requirements,
// if not stop (this way we don't throw an error).
function gffd_check_requirements(){
if(
// These are the Gravity Forms classes we use
// to do things.
class_exists("RGForms")
&& class_exists("RGFormsModel")
&& class_exists("GFCommon")
){
// If we have the requirements,
// let's prepare everything:
// Integrate with Gravity Forms
function gffd_load(){
require_once "gffd-gf.php";
}
function gffd_check_n_load(){
gffd_load();
}
add_action('init','gffd_check_n_load');
}else{
// Right now, just do nothing if all
// the requirements aren't met.
}
}
add_action('plugins_loaded','gffd_check_requirements');
?>