PluginProbe
seQura / 4.0.0
seQura v4.0.0
4.3.4 4.3.3 4.3.2 4.3.1 trunk 2.0.0 2.0.10 2.0.11 2.0.12 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 3.0.0 3.0.2 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 4.0.0 All 30 releases
sequra / src / Services / Constants / class-constants.php

class-constants.php in seQura 4.0.0, at src/Services/Constants/class-constants.php

260 lines 5.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Constants
4 *
5 * @package SeQura/WC
6 * @subpackage SeQura/WC/Services
7 */
8
9 namespace SeQura\WC\Services\Constants;
10
11 /**
12 * Provides methods access application Constants.
13 */
14 class Constants implements Interface_Constants {
15
16 /**
17 * Plugin directory path.
18 *
19 * @var string
20 */
21 private $plugin_dir_path;
22
23 /**
24 * Plugin file path.
25 *
26 * @var string
27 */
28 private $plugin_file_path;
29
30 /**
31 * Plugin log file path.
32 *
33 * @var string
34 */
35 private $plugin_log_file_path;
36
37 /**
38 * Plugin basename.
39 *
40 * @var string
41 */
42 private $plugin_basename;
43
44 /**
45 * Plugin directory URL.
46 *
47 * @var string
48 */
49 private $plugin_dir_url;
50
51 /**
52 * Plugin rest namespace.
53 *
54 * @var string
55 */
56 private $plugin_rest_namespace;
57
58 /**
59 * Plugin data.
60 *
61 * @var array
62 */
63 private $plugin_data;
64
65 /**
66 * WooCommerce data.
67 *
68 * @var array
69 */
70 private $woocommerce_data;
71
72 /**
73 * Environment data.
74 *
75 * @var array
76 */
77 private $environment_data;
78
79 /**
80 * Plugin templates path.
81 *
82 * @var string
83 */
84 private $plugin_templates_path;
85
86 /**
87 * Plugin assets path.
88 *
89 * @var string
90 */
91 private $plugin_assets_path;
92
93 /**
94 * Plugin assets URL.
95 *
96 * @var string
97 */
98 private $plugin_assets_url;
99
100 /**
101 * Constructor.
102 *
103 * @param string $plugin_dir_path The plugin directory path.
104 * @param string $plugin_file_path The plugin file path.
105 * @param string $plugin_log_file_path The plugin log file path.
106 * @param string $plugin_basename The plugin basename.
107 * @param string $plugin_dir_url The plugin directory URL.
108 * @param string $plugin_rest_namespace The plugin rest namespace.
109 * @param array $plugin_data The plugin data.
110 * @param array $woocommerce_data The WooCommerce data.
111 * @param array $environment_data The environment data.
112 * @param string $plugin_templates_path The plugin templates path.
113 * @param string $plugin_assets_path The plugin assets path.
114 * @param string $plugin_assets_url The plugin assets URL.
115 */
116 public function __construct(
117 $plugin_dir_path,
118 $plugin_file_path,
119 $plugin_log_file_path,
120 $plugin_basename,
121 $plugin_dir_url,
122 $plugin_rest_namespace,
123 $plugin_data,
124 $woocommerce_data,
125 $environment_data,
126 $plugin_templates_path,
127 $plugin_assets_path,
128 $plugin_assets_url
129 ) {
130 $this->plugin_dir_path = (string) $plugin_dir_path;
131 $this->plugin_file_path = (string) $plugin_file_path;
132 $this->plugin_log_file_path = (string) $plugin_log_file_path;
133 $this->plugin_basename = (string) $plugin_basename;
134 $this->plugin_dir_url = (string) $plugin_dir_url;
135 $this->plugin_rest_namespace = (string) $plugin_rest_namespace;
136 $this->plugin_data = (array) $plugin_data;
137 $this->woocommerce_data = (array) $woocommerce_data;
138 $this->environment_data = (array) $environment_data;
139 $this->plugin_templates_path = (string) $plugin_templates_path;
140 $this->plugin_assets_path = (string) $plugin_assets_path;
141 $this->plugin_assets_url = (string) $plugin_assets_url;
142 }
143
144 /**
145 * Get the integration name.
146 */
147 public function get_integration_name(): string {
148 return 'WooCommerce';
149 }
150
151 /**
152 * Get the plugin directory path.
153 */
154 public function get_plugin_dir_path(): string {
155 return $this->plugin_dir_path;
156 }
157 /**
158 * Get the plugin file path.
159 */
160 public function get_plugin_file_path(): string {
161 return $this->plugin_file_path;
162 }
163 /**
164 * Get the plugin log file path.
165 */
166 public function get_plugin_log_file_path(): string {
167 return $this->plugin_log_file_path;
168 }
169 /**
170 * Get the plugin basename.
171 */
172 public function get_plugin_basename(): string {
173 return $this->plugin_basename;
174 }
175 /**
176 * Get the plugin directory URL.
177 */
178 public function get_plugin_dir_url(): string {
179 return $this->plugin_dir_url;
180 }
181 /**
182 * Get the plugin rest namespace.
183 */
184 public function get_plugin_rest_namespace(): string {
185 return $this->plugin_rest_namespace;
186 }
187 /**
188 * Get the WooCommerce data.
189 */
190 public function get_woocommerce_data(): array {
191 return $this->woocommerce_data;
192 }
193
194 /**
195 * Get the plugin data.
196 */
197 public function get_plugin_data(): array {
198 return $this->plugin_data;
199 }
200 /**
201 * Get the plugin rest version.
202 */
203 public function get_environment_data(): array {
204 return $this->environment_data;
205 }
206 /**
207 * Get the plugin templates path.
208 */
209 public function get_plugin_templates_path(): string {
210 return $this->plugin_templates_path;
211 }
212 /**
213 * Get the plugin assets path.
214 */
215 public function get_plugin_assets_path(): string {
216 return $this->plugin_assets_path;
217 }
218 /**
219 * Get the plugin assets URL.
220 */
221 public function get_plugin_assets_url(): string {
222 return $this->plugin_assets_url;
223 }
224
225 /**
226 * Hook for adding order indexes.
227 */
228 public function get_hook_add_order_indexes(): string {
229 return 'sequra_order_migration_add_indexes';
230 }
231
232 /**
233 * Get payment gateway ID
234 */
235 public function get_payment_gateway_id(): string {
236 return 'sequra';
237 }
238
239 /**
240 * Get payment gateway webhook identifier
241 */
242 public function get_event_webhook(): string {
243 return 'woocommerce_' . $this->get_payment_gateway_id();
244 }
245
246 /**
247 * Get IPN webhook identifier
248 */
249 public function get_ipn_webhook(): string {
250 return 'woocommerce_' . $this->get_payment_gateway_id() . '_ipn';
251 }
252
253 /**
254 * Get return URL webhook identifier
255 */
256 public function get_return_webhook(): string {
257 return 'woocommerce_' . $this->get_payment_gateway_id() . '_return';
258 }
259 }
260