-
Notifications
You must be signed in to change notification settings - Fork 17
/
stripe-checkout.php
120 lines (99 loc) · 3.25 KB
/
stripe-checkout.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
120
<?php
/**
* Plugin Name: WP Simple Pay Lite
* Plugin URI: https://wpsimplepay.com
* Description: Add high conversion Stripe payment forms to your WordPress site in minutes.
* Author: WP Simple Pay
* Author URI: https://wpsimplepay.com
* Version: 4.11.1
* Text Domain: stripe
* Domain Path: /languages
*/
namespace SimplePay;
use SimplePay\Core\Plugin;
use SimplePay\Core\Bootstrap\Compatibility;
/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright 2014-2022 Sandhills Development, LLC. All rights reserved.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Don't run if Pro has been installed.
if ( ! defined( 'SIMPLE_PAY_VERSION' ) ) {
//
// Shared
//
if ( ! defined( 'SIMPLE_PAY_STORE_URL' ) ) {
define( 'SIMPLE_PAY_STORE_URL', 'https://wpsimplepay.com/' );
}
if ( ! defined( 'SIMPLE_PAY_ITEM_ID' ) ) {
define( 'SIMPLE_PAY_ITEM_ID', 177993 );
}
//
// Lite/Pro-specific.
//
define( 'SIMPLE_PAY_VERSION', '4.11.1' );
if ( ! defined( 'SIMPLE_PAY_PLUGIN_NAME' ) ) {
define( 'SIMPLE_PAY_PLUGIN_NAME', 'WP Simple Pay Lite' );
}
if ( ! defined( 'SIMPLE_PAY_ITEM_NAME' ) ) {
define( 'SIMPLE_PAY_ITEM_NAME', 'WP Simple Pay Lite' );
}
//
// Stripe.
//
if ( ! defined( 'SIMPLE_PAY_STRIPE_API_VERSION' ) ) {
define( 'SIMPLE_PAY_STRIPE_API_VERSION', '2023-10-16' );
}
if ( ! defined( 'SIMPLE_PAY_STRIPE_PARTNER_ID' ) ) {
define( 'SIMPLE_PAY_STRIPE_PARTNER_ID', 'pp_partner_DKkf27LbiCjOYt' );
}
//
// Helpers.
//
if ( ! defined( 'SIMPLE_PAY_MAIN_FILE' ) ) {
define( 'SIMPLE_PAY_MAIN_FILE', __FILE__ );
}
if ( ! defined( 'SIMPLE_PAY_URL' ) ) {
define( 'SIMPLE_PAY_URL', plugin_dir_url( SIMPLE_PAY_MAIN_FILE ) );
}
if ( ! defined( 'SIMPLE_PAY_DIR' ) ) {
define( 'SIMPLE_PAY_DIR', plugin_dir_path( SIMPLE_PAY_MAIN_FILE ) );
}
if ( ! defined( 'SIMPLE_PAY_INC' ) ) {
define( 'SIMPLE_PAY_INC', plugin_dir_path( SIMPLE_PAY_MAIN_FILE ) . 'includes/' );
}
if ( ! defined( 'SIMPLE_PAY_INC_URL' ) ) {
define( 'SIMPLE_PAY_INC_URL', plugin_dir_url( SIMPLE_PAY_MAIN_FILE ) . 'includes/' );
}
// Compatibility files.
require_once SIMPLE_PAY_DIR . 'includes/core/bootstrap/compatibility.php';
if ( Compatibility\server_requirements_met() ) {
// Autoloader.
require_once SIMPLE_PAY_DIR . 'vendor/autoload.php';
require_once SIMPLE_PAY_DIR . 'includes/core/bootstrap/autoload.php';
// Plugin files.
require_once SIMPLE_PAY_DIR . 'includes/core/class-simplepay.php';
// New plugin container.
$plugin = new Plugin( __FILE__ );
$plugin->load();
} else {
Compatibility\show_admin_notices();
}
} else {
deactivate_plugins( plugin_basename( SIMPLE_PAY_MAIN_FILE ) );
}