Failed Conditions
Push — develop ( 649960...2d37a2 )
by Reüel
07:37
created

pronamic-ideal.php (2 issues)

1
<?php
2
/**
3
 * Plugin Name: Pronamic Pay
4
 * Plugin URI: https://www.pronamic.eu/plugins/pronamic-ideal/
5
 * Description: The Pronamic Pay plugin adds payment methods like iDEAL, Bancontact, credit card and more to your WordPress site for a variety of payment providers.
6
 *
7
 * Version: 5.9.0
8
 * Requires at least: 4.7
9
 *
10
 * Author: Pronamic
11
 * Author URI: https://www.pronamic.eu/
12
 *
13
 * Text Domain: pronamic_ideal
14
 * Domain Path: /languages/
15
 *
16
 * Provides: wp-pay/core
17
 *
18
 * License: GPL-3.0-or-later
19
 *
20
 * GitHub URI: https://github.com/pronamic/wp-pronamic-ideal
21
 *
22
 * @author    Pronamic <[email protected]>
23
 * @copyright 2005-2020 Pronamic
24
 * @license   GPL-3.0-or-later
25
 * @package   Pronamic\WordPress\Pay
26
 */
27
28
/**
29
 * Autoload.
30
 */
31
if ( ! defined( 'PRONAMIC_PAY_DEBUG' ) ) {
32
	define( 'PRONAMIC_PAY_DEBUG', false );
33
}
34
35
if ( PRONAMIC_PAY_DEBUG ) {
36
	foreach ( glob( __DIR__ . '/repositories/wp-pay/*/vendor/composer/autoload_files.php' ) as $file ) {
37
		$files = require $file;
38
39
		foreach ( $files as $identifier => $filepath ) {
40
			if ( ! empty( $GLOBALS['__composer_autoload_files'][ $identifier ] ) ) {
41
				continue;
42
			}
43
44
			require $filepath;
45
46
			$GLOBALS['__composer_autoload_files'][ $identifier ] = true;
47
		}
48
	}
49
}
50
51
$loader = require plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
52
53
if ( PRONAMIC_PAY_DEBUG ) {
54
	foreach ( glob( __DIR__ . '/repositories/*/*/composer.json' ) as $file ) {
55
		$content = file_get_contents( $file );
56
57
		$object = json_decode( $content );
58
59
		if ( ! isset( $object->autoload ) ) {
60
			continue;
61
		}
62
63
		foreach ( $object->autoload as $autoload_type => $classmap ) {
64
			if ( 'psr-4' !== $autoload_type ) {
65
				continue;
66
			}
67
68
			foreach ( $classmap as $prefix => $filepath ) {
69
				$loader->addPsr4( $prefix, dirname( $file ) . '/' . $filepath, true );
70
			}
71
		}
72
	}
73
}
74
75
/**
76
 * Bootstrap.
77
 */
78
\Pronamic\WordPress\Pay\Plugin::instance(
79
	array(
80
		'file'       => __FILE__,
81
		'options'    => array(
82
			'about_page_file' => __DIR__ . '/admin/page-about.php',
83
		)
84
	)
85
);
86
87
add_filter(
88
	'pronamic_pay_plugin_integrations',
89
	function( $integrations ) {
90
		// Charitable.
91
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\Charitable\Extension();
92
93
		// Easy Digital Downloads.
94
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\EasyDigitalDownloads\Extension();
95
96
		// Event Espresso.
97
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\EventEspressoLegacy\Extension();
98
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\EventEspresso\Extension();
99
100
		// Give.
101
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\Give\Extension();
102
103
		// WooCommerce.
104
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\WooCommerce\Extension();
105
106
		// Gravity Forms.
107
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\GravityForms\Extension();
108
109
		// FormidableForms.
110
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\FormidableForms\Extension();
111
112
		// MemberPress.
113
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\MemberPress\Extension();
114
115
		// NinjaForms.
116
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\NinjaForms\Extension();
117
118
		// Restrict Content Pro.
119
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\RestrictContentPro\Extension(
120
			array(
121
				'slug'                => 'restrict-content-pro',
122
				'version_option_name' => 'pronamic_pay_restrictcontentpro_db_version',
123
				'name'                => 'Restrict Content Pro',
124
				'manual_url'          => null,
125
				/**
126
				 * Affiliate link.
127
				 *
128
				 * @link https://restrictcontentpro.com/affiliates/
129
				 * @link https://restrictcontentpro.com/affiliate-agreement/
130
				 * @todo Request a Restrict Content Pro affiliate link.
131
				 */
132
				'affiliate_url'       => null,
133
				/**
134
				 * Requirements.
135
				 *
136
				 * @link https://github.com/dsawardekar/wp-requirements
137
				 * @link https://github.com/afragen/wp-dependency-installer
138
				 * @link https://github.com/wearerequired/wp-requirements-check
139
				 * @link https://github.com/ultraleettech/wp-requirements-checker
140
				 * @link https://waclawjacek.com/check-wordpress-plugin-dependencies/
141
				 * @link https://github.com/xwp/wp-plugin-dependencies
142
				 * @link https://wordpress.org/plugins/plugin-dependencies/
143
				 * @link https://github.com/joshbetz/wp-plugin-dependencies
144
				 * @link https://github.com/jrfnl/wp-known-plugin-dependencies
145
				 * @link https://github.com/xwp/wp-plugin-dependencies/issues/34
146
				 * @link https://github.com/WordPress/WordPress/blob/master/wp-includes/class.wp-dependencies.php
147
				 * @link https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-dependency.php
148
				 * @link https://github.com/Yoast/yoast-acf-analysis/blob/2.3.0/inc/ac-yoast-seo-acf-content-analysis.php#L30-L32
149
				 * @link https://github.com/Yoast/yoast-acf-analysis/blob/2.3.0/inc/requirements.php
150
				 */
151
				'requirements'        => array(
152
					array(
153
						'type'              => 'php',
154
						'requires_at_least' => '5.6.20',
155
					),
156
					array(
157
						'type'      => 'php-ext',
158
						'name'      => 'Internationalization',
159
						'slug'      => 'intl',
160
						'is_active' => function() {
161
							return \extension_loaded( 'intl' );
162
						},
163
					),
164
					array(
165
						'type'              => 'wp',
166
						'requires_at_least' => '4.7',
167
					),
168
					array(
169
						'type'              => 'wp-plugin',
170
						'name'              => 'Restrict Content Pro',
171
						'slug'              => 'restrict-content-pro',
172
						'uri'               => 'https://restrictcontentpro.com/',
173
						'requires_at_least' => '3.0.0',
174
						'tested_up_to'      => '3.1.2',
175
						'is_active'         => function() {
176
							return \defined( 'RCP_PLUGIN_VERSION' );
177
						},
178
						'get_version'       => function() {
179
							if ( \defined( 'RCP_PLUGIN_VERSION' ) ) {
180
								return RCP_PLUGIN_VERSION;
1 ignored issue
show
The constant RCP_PLUGIN_VERSION was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
181
							}
182
						},
183
					),
184
				),
185
			)
186
		);
187
188
		// s2Member.
189
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\S2Member\Extension();
190
191
		// WP e-Commerce.
192
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\WPeCommerce\Extension();
193
194
		// Return integrations.
195
		return $integrations;
196
	}
197
);
198
199
add_filter(
200
	'pronamic_pay_gateways',
201
	function( $gateways ) {
202
		// ABN AMRO - iDEAL Zelfbouw (v3).
203
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
204
			array(
205
				'id'               => 'abnamro-ideal-zelfbouw-v3',
206
				'name'             => 'ABN AMRO - iDEAL Zelfbouw (v3)',
207
				'provider'         => 'abnamro',
208
				'url'              => 'https://abnamro.ideal-payment.de/',
209
				'product_url'      => 'https://www.abnamro.nl/nl/zakelijk/betalen/online-betalen/betaaloplossing/',
210
				'dashboard_url'    => array(
211
					'test' => 'https://abnamro-test.ideal-payment.de/',
212
					'live' => 'https://abnamro.ideal-payment.de/',
213
				),
214
				'aquirer_url'      => 'https://abnamro.ideal-payment.de/ideal/iDEALv3',
215
				'aquirer_test_url' => 'https://abnamro-test.ideal-payment.de/ideal/iDEALv3',
216
				'certificates'     => array(),
217
			)
218
		);
219
220
		// Buckaroo.
221
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Buckaroo\Integration();
222
223
		// Deutsche Bank - iDEAL Expert (v3).
224
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
225
			array(
226
				'id'               => 'deutschebank-ideal-expert-v3',
227
				'name'             => 'Deutsche Bank - iDEAL Expert (v3)',
228
				'provider'         => 'deutschebank',
229
				'product_url'      => 'https://www.deutschebank.nl/nl/content/producten_en_services_commercial_banking_cash_management_betalen_ideal.html',
230
				'dashboard_url'    => array(
231
					'test' => 'https://myideal.test.db.com/',
232
					'live' => 'https://myideal.db.com/',
233
				),
234
				'aquirer_url'      => 'https://myideal.db.com/ideal/iDealv3',
235
				'aquirer_test_url' => null,
236
				'certificates'     => array(),
237
			)
238
		);
239
240
		// EMS - eCommerce.
241
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\EMS\ECommerce\Integration();
242
243
		// Fibonacci ORANGE.
244
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Icepay\Integration(
245
			array(
246
				'id'          => 'fibonacciorange',
247
				'name'        => 'Fibonacci ORANGE',
248
				'provider'    => 'fibonacciorange',
249
				'product_url' => 'http://www.fibonacciorange.nl/',
250
			)
251
		);
252
253
		// ICEPAY.
254
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Icepay\Integration();
255
256
		// iDEAL Simulator - iDEAL Professional / Advanced / Zelfbouw (v3).
257
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
258
			array(
259
				'id'               => 'ideal-simulator-ideal-advanced-v3',
260
				'name'             => 'iDEAL Simulator - iDEAL Professional / Advanced',
261
				'provider'         => 'ideal-simulator',
262
				'product_url'      => 'https://www.ideal-checkout.nl/support/ideal-simulator',
263
				'aquirer_url'      => 'https://www.ideal-checkout.nl/simulator/',
264
				'aquirer_test_url' => null,
265
				'certificates'     => array(),
266
			)
267
		);
268
269
		// ING - iDEAL Basic.
270
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealBasic\Integration(
271
			array(
272
				'id'               => 'ing-ideal-basic',
273
				'name'             => 'ING - iDEAL Basic',
274
				'provider'         => 'ing',
275
				'product_url'      => 'https://www.ing.nl/zakelijk/betalen/geld-ontvangen/ideal/',
276
				'manual_url'       => __( 'https://www.pronamic.eu/support/how-to-connect-ing-ideal-basic-with-wordpress-via-pronamic-pay/', 'pronamic_ideal' ),
277
				'dashboard_url'    => array(
278
					'test' => 'https://idealtest.secure-ing.com/',
279
					'live' => 'https://ideal.secure-ing.com/',
280
				),
281
				'aquirer_url'      => 'https://ideal.secure-ing.com/ideal/mpiPayInitIng.do',
282
				'aquirer_test_url' => 'https://idealtest.secure-ing.com/ideal/mpiPayInitIng.do',
283
			)
284
		);
285
286
		// ING - iDEAL Advanced (v3).
287
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
288
			array(
289
				'id'               => 'ing-ideal-advanced-v3',
290
				'name'             => 'ING - iDEAL Advanced (v3)',
291
				'provider'         => 'ing',
292
				'product_url'      => 'https://www.ing.nl/zakelijk/betalen/geld-ontvangen/ideal/',
293
				'manual_url'       => __( 'https://www.pronamic.eu/support/how-to-connect-ing-ideal-advanced-v3-with-wordpress-via-pronamic-pay/', 'pronamic_ideal' ),
294
				'dashboard_url'    => array(
295
					'test' => 'https://idealtest.secure-ing.com/',
296
					'live' => 'https://ideal.secure-ing.com/',
297
				),
298
				'aquirer_url'      => 'https://ideal.secure-ing.com/ideal/iDEALv3',
299
				'aquirer_test_url' => 'https://idealtest.secure-ing.com/ideal/iDEALv3',
300
				'certificates'     => array(),
301
			)
302
		);
303
304
		// ING - Kassa Compleet.
305
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\ING\KassaCompleet\Integration();
306
307
		// Mollie.
308
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Mollie\Integration(
309
			array(
0 ignored issues
show
The call to Pronamic\WordPress\Pay\G...egration::__construct() has too many arguments starting with array('register_url' => ...pay_mollie_db_version'). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

309
		$gateways[] = /** @scrutinizer ignore-call */ new \Pronamic\WordPress\Pay\Gateways\Mollie\Integration(

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
310
				'register_url'        => 'https://www.mollie.com/nl/signup/665327',
311
				'manual_url'          => \__( 'https://www.pronamic.eu/support/how-to-connect-mollie-with-wordpress-via-pronamic-pay/', 'pronamic_ideal' ),
312
				'version_option_name' => 'pronamic_pay_mollie_db_version',
313
			)
314
		);
315
316
		// Mollie - iDEAL.
317
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\MollieIDeal\Integration();
318
319
		// Mollie - iDEAL Basic.
320
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealBasic\Integration(
321
			array(
322
				'id'               => 'mollie-ideal-basic',
323
				'name'             => 'Mollie - iDEAL Basic',
324
				'provider'         => 'mollie',
325
				'dashboard_url'    => 'http://www.mollie.nl/beheer/',
326
				'deprecated'       => true,
327
				'aquirer_url'      => 'https://secure.mollie.nl/xml/idealAcquirer/lite/',
328
				'aquirer_test_url' => 'https://secure.mollie.nl/xml/idealAcquirer/testmode/lite/',
329
			)
330
		);
331
332
		// MultiSafePay - Connect.
333
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\MultiSafepay\Integration();
334
335
		// Nocks.
336
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Nocks\Integration();
337
338
		// Ingenico - DirectLink.
339
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Ingenico\DirectLink\Integration();
340
341
		// Ingenico - OrderStandard.
342
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Ingenico\OrderStandard\Integration();
343
344
		// Rabobank - OmniKassa.
345
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\OmniKassa\Integration();
346
347
		// Rabobank - OmniKassa 2.0.
348
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\OmniKassa2\Integration();
349
350
		// Pay.nl.
351
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\PayNL\Integration();
352
353
		// Rabobank - iDEAL Professional (v3).
354
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
355
			array(
356
				'id'               => 'rabobank-ideal-professional-v3',
357
				'name'             => 'Rabobank - iDEAL Professional (v3)',
358
				'provider'         => 'rabobank',
359
				'product_url'      => 'https://www.rabobank.nl/bedrijven/betalen/geld-ontvangen/ideal-professional/',
360
				'manual_url'       => __( 'https://www.pronamic.eu/support/how-to-connect-rabobank-ideal-professional-v3-with-wordpress-via-pronamic-pay/', 'pronamic_ideal' ),
361
				'dashboard_url'    => array(
362
					'test' => 'https://idealtest.rabobank.nl/',
363
					'live' => 'https://ideal.rabobank.nl/',
364
				),
365
				'aquirer_url'      => 'https://ideal.rabobank.nl/ideal/iDEALv3',
366
				'aquirer_test_url' => 'https://idealtest.rabobank.nl/ideal/iDEALv3',
367
				'certificates'     => array(),
368
			)
369
		);
370
371
		// Sisow.
372
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Sisow\Integration();
373
374
		// Sisow - iDEAL Basic.
375
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealBasic\Integration(
376
			array(
377
				'id'               => 'sisow-ideal-basic',
378
				'name'             => 'Sisow - iDEAL Basic',
379
				'provider'         => 'sisow',
380
				'url'              => 'https://www.sisow.nl/',
381
				'dashboard_url'    => 'https://www.sisow.nl/Sisow/iDeal/Login.aspx',
382
				'deprecated'       => true,
383
				'aquirer_url'      => 'https://www.sisow.nl/Sisow/iDeal/IssuerHandler.ashx',
384
				'aquirer_test_url' => 'https://www.sisow.nl/Sisow/iDeal/IssuerHandler.ashx/test',
385
			)
386
		);
387
388
		// TargetPay.
389
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\TargetPay\Integration();
390
391
		// Return gateways.
392
		return $gateways;
393
	}
394
);
395
396
/**
397
 * Backward compatibility.
398
 */
399
global $pronamic_ideal;
400
401
$pronamic_ideal = pronamic_pay_plugin();
402