-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwoo-paypal-here.php
119 lines (103 loc) · 3.69 KB
/
woo-paypal-here.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
/**
* @link https://www.angelleye.com
* @since 0.1.0
* @package Woo_PayPal_Here
*
* @wordpress-plugin
* Plugin Name: PayPal Here for WooCommerce
* Plugin URI: https://www.angelleye.com/woo-paypal-here
* Description: Process WooCommerce orders with PayPal Here, or create new orders from the mobile app using WooCommerce data and sync the order back to WooCommerce.
* Version: 0.5.5
* Author: Angell EYE
* Author URI: https://www.angelleye.com
* License: GPL-3.0+
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
* Text Domain: woo-paypal-here
* Domain Path: /languages
* Tested up to: 5.3.2
* WC requires at least: 3.0.0
* WC tested up to: 3.8.1
*/
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
define('WOO_PAYPAL_HERE_VERSION', '0.5.5');
if (!defined('WOO_PAYPAL_HERE_PLUGIN_DIR')) {
define('WOO_PAYPAL_HERE_PLUGIN_DIR', dirname(__FILE__));
}
if (!defined('WOO_PAYPAL_HERE_ASSET_URL')) {
define('WOO_PAYPAL_HERE_ASSET_URL', plugin_dir_url(__FILE__));
}
if (!defined('WOO_PAYPAL_HERE_PLUGIN_FILE')) {
define('WOO_PAYPAL_HERE_PLUGIN_FILE', __FILE__);
}
if (!defined('WOO_PAYPAL_HERE_PLUGIN_BASENAME')) {
define('WOO_PAYPAL_HERE_PLUGIN_BASENAME', plugin_basename(__FILE__));
}
if (!defined('AEU_ZIP_URL')) {
define('AEU_ZIP_URL', 'https://updates.angelleye.com/ae-updater/angelleye-updater/angelleye-updater.zip');
}
if (!defined('PAYPAL_FOR_WOOCOMMERCE_PUSH_NOTIFICATION_WEB_URL')) {
define('PAYPAL_FOR_WOOCOMMERCE_PUSH_NOTIFICATION_WEB_URL', 'https://www.angelleye.com/');
}
/**
* Required functions
*/
if (!function_exists('angelleye_queue_update')) {
require_once( 'includes/angelleye-functions.php' );
}
/**
* The code that runs during plugin activation.
* This action is documented in includes/class-woo-paypal-here-activator.php
*/
function activate_woo_paypal_here() {
require_once plugin_dir_path(__FILE__) . 'includes/class-woo-paypal-here-activator.php';
Woo_PayPal_Here_Activator::activate();
}
/**
* The code that runs during plugin deactivation.
* This action is documented in includes/class-woo-paypal-here-deactivator.php
*/
function deactivate_woo_paypal_here() {
require_once plugin_dir_path(__FILE__) . 'includes/class-woo-paypal-here-deactivator.php';
Woo_PayPal_Here_Deactivator::deactivate();
}
register_activation_hook(__FILE__, 'activate_woo_paypal_here');
register_deactivation_hook(__FILE__, 'deactivate_woo_paypal_here');
/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path(__FILE__) . 'includes/class-woo-paypal-here.php';
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 0.1.0
*/
function run_woo_paypal_here() {
$plugin = new Woo_PayPal_Here();
$plugin->run();
}
add_action('plugins_loaded', 'load_angelleye_woo_paypal_here');
add_action('init', 'angelleye_woo_paypal_here_load_end_point', 0);
function load_angelleye_woo_paypal_here() {
if (class_exists('WC_Payment_Gateway')) {
run_woo_paypal_here();
}
}
function angelleye_woo_paypal_here_load_end_point() {
require plugin_dir_path(__FILE__) . 'includes/class-woo-paypal-here-end-point.php';
run_woo_paypal_here_end_point();
}
function run_woo_paypal_here_end_point() {
if (class_exists('Woo_PayPal_Here_End_Point')) {
$end_point = new Woo_PayPal_Here_End_Point();
$end_point->angelleye_woo_paypal_here_add_endpoints();
}
}