Failed Conditions
Push — develop ( a0bfaa...253c21 )
by Remco
03:31
created

pronamic-ideal.php (8 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.8.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
 * License: GPL-3.0-or-later
17
 *
18
 * GitHub URI: https://github.com/pronamic/wp-pronamic-ideal
19
 *
20
 * @author    Pronamic <[email protected]>
21
 * @copyright 2005-2019 Pronamic
22
 * @license   GPL-3.0-or-later
23
 * @package   Pronamic\WordPress\Pay
24
 */
25
26
/**
27
 * Autoload.
28
 */
29
if ( ! defined( 'PRONAMIC_PAY_DEBUG' ) ) {
30
	define( 'PRONAMIC_PAY_DEBUG', false );
31
}
32
33
if ( PRONAMIC_PAY_DEBUG ) {
34
	foreach ( glob( __DIR__ . '/repositories/wp-pay/*/vendor/composer/autoload_files.php' ) as $file ) {
35
		$files = require $file;
36
37
		foreach ( $files as $identifier => $filepath ) {
38
			if ( ! empty( $GLOBALS['__composer_autoload_files'][ $identifier ] ) ) {
39
				continue;
40
			}
41
42
			require $filepath;
43
44
			$GLOBALS['__composer_autoload_files'][ $identifier ] = true;
45
		}
46
	}
47
}
48
49
$loader = require plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
50
51
if ( PRONAMIC_PAY_DEBUG ) {
52
	foreach ( glob( __DIR__ . '/repositories/*/*/composer.json' ) as $file ) {
53
		$content = file_get_contents( $file );
54
55
		$object = json_decode( $content );
56
57
		if ( ! isset( $object->autoload ) ) {
58
			continue;
59
		}
60
61
		foreach ( $object->autoload as $autoload_type => $classmap ) {
62
			if ( 'psr-4' !== $autoload_type ) {
63
				continue;
64
			}
65
66
			foreach ( $classmap as $prefix => $filepath ) {
67
				$loader->addPsr4( $prefix, dirname( $file ) . '/' . $filepath, true );
68
			}
69
		}
70
	}
71
}
72
73
/**
74
 * Bootstrap.
75
 */
76
\Pronamic\WordPress\Pay\Plugin::instance(
77
	array(
78
		'file'       => __FILE__,
79
		'options'    => array(
80
			'about_page_file' => __DIR__ . '/admin/page-about.php',
81
		),
82
		'extensions' => array(
83
			'\Pronamic\WordPress\Pay\Extensions\Charitable\Extension::bootstrap',
84
			'\Pronamic\WordPress\Pay\Extensions\Give\Extension::bootstrap',
85
			'\Pronamic\WordPress\Pay\Extensions\WooCommerce\Extension::bootstrap',
86
			'\Pronamic\WordPress\Pay\Extensions\GravityForms\Extension::bootstrap',
87
			'\Pronamic\WordPress\Pay\Extensions\Shopp\Extension::bootstrap',
88
			'\Pronamic\WordPress\Pay\Extensions\Jigoshop\Extension::bootstrap',
89
			'\Pronamic\WordPress\Pay\Extensions\WPeCommerce\Extension::bootstrap',
90
			'\Pronamic\WordPress\Pay\Extensions\ClassiPress\Extension::bootstrap',
91
			'\Pronamic\WordPress\Pay\Extensions\EventEspressoLegacy\Extension::bootstrap',
92
			'\Pronamic\WordPress\Pay\Extensions\EventEspresso\Extension::bootstrap',
93
			'\Pronamic\WordPress\Pay\Extensions\AppThemes\Extension::bootstrap',
94
			'\Pronamic\WordPress\Pay\Extensions\S2Member\Extension::bootstrap',
95
			'\Pronamic\WordPress\Pay\Extensions\Membership\Extension::bootstrap',
96
			'\Pronamic\WordPress\Pay\Extensions\EasyDigitalDownloads\Extension::bootstrap',
97
			'\Pronamic\WordPress\Pay\Extensions\IThemesExchange\Extension::bootstrap',
98
			'\Pronamic\WordPress\Pay\Extensions\MemberPress\Extension::bootstrap',
99
			'\Pronamic\WordPress\Pay\Extensions\FormidableForms\Extension::bootstrap',
100
			'\Pronamic\WordPress\Pay\Extensions\NinjaForms\Extension::bootstrap',
101
		),
102
	)
103
);
104
105
add_filter(
106
	'pronamic_pay_plugin_integrations',
107
	function( $integrations ) {
108
		// Restrict Content Pro.
109
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\RestrictContentPro\Extension(
110
			array(
0 ignored issues
show
The call to Pronamic\WordPress\Pay\E...xtension::__construct() has too many arguments starting with array('requirements' => ...n(...) { /* ... */ }))). ( Ignorable by Annotation )

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

110
		$integrations[] = /** @scrutinizer ignore-call */ new \Pronamic\WordPress\Pay\Extensions\RestrictContentPro\Extension(

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...
111
				/**
112
				 * Requirements.
113
				 *
114
				 * @link https://github.com/dsawardekar/wp-requirements
115
				 * @link https://github.com/afragen/wp-dependency-installer
116
				 * @link https://github.com/wearerequired/wp-requirements-check
117
				 * @link https://github.com/ultraleettech/wp-requirements-checker
118
				 */
119
				'requirements' => array(
120
					array(
121
						'type'              => 'php',
122
						'requires_at_least' => '5.6.20',
123
					),
124
					array(
125
						'type'              => 'php-ext',
0 ignored issues
show
Array double arrow not aligned correctly; expected 6 space(s) between "'type'" and double arrow, but found 14.
Loading history...
126
						'name'              => 'Internationalization',
0 ignored issues
show
Array double arrow not aligned correctly; expected 6 space(s) between "'name'" and double arrow, but found 14.
Loading history...
127
						'slug'              => 'intl',
0 ignored issues
show
Array double arrow not aligned correctly; expected 6 space(s) between "'slug'" and double arrow, but found 14.
Loading history...
128
						'is_active'         => function() {
0 ignored issues
show
Array double arrow not aligned correctly; expected 1 space(s) between "'is_active'" and double arrow, but found 9.
Loading history...
129
							return \extension_loaded( 'intl' );
130
						}
0 ignored issues
show
Each array item in a multi-line array declaration must end in a comma
Loading history...
131
					),
132
					array(
133
						'type'              => 'wp',
134
						'requires_at_least' => '4.7',
135
					),
136
					array(
137
						'type'              => 'wp-plugin',
138
						'name'              => 'Restrict Content Pro',
139
						'slug'              => 'restrict-content-pro',
140
						'uri'               => 'https://restrictcontentpro.com/',
141
						'requires_at_least' => '3.0.0',
142
						'tested_up_to'      => '3.1.2',
143
						'is_active'         => function() {
144
							return \defined( 'RCP_PLUGIN_VERSION' );
145
						},
146
						'get_version'       => function() {
147
							if ( \defined( 'RCP_PLUGIN_VERSION' ) ) {
148
								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...
149
							}
150
						}
0 ignored issues
show
Each array item in a multi-line array declaration must end in a comma
Loading history...
151
					),
152
				),
153
			)
154
		);
155
156
		// Return integrations.
157
		return $integrations;
158
	}
159
);
160
161
add_filter(
162
	'pronamic_pay_gateways',
163
	function( $gateways ) {
164
		// ABN AMRO - iDEAL Zelfbouw (v3).
165
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
166
			array(
167
				'id'               => 'abnamro-ideal-zelfbouw-v3',
168
				'name'             => 'ABN AMRO - iDEAL Zelfbouw (v3)',
169
				'provider'         => 'abnamro',
170
				'url'              => 'https://abnamro.ideal-payment.de/',
171
				'product_url'      => 'https://www.abnamro.nl/nl/zakelijk/betalen/online-betalen/betaaloplossing/',
172
				'dashboard_url'    => array(
173
					'test' => 'https://abnamro-test.ideal-payment.de/',
174
					'live' => 'https://abnamro.ideal-payment.de/',
175
				),
176
				'aquirer_url'      => 'https://abnamro.ideal-payment.de/ideal/iDEALv3',
177
				'aquirer_test_url' => 'https://abnamro-test.ideal-payment.de/ideal/iDEALv3',
178
				'certificates'     => array(),
179
			)
180
		);
181
182
		// Buckaroo.
183
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Buckaroo\Integration();
184
185
		// Deutsche Bank - iDEAL Expert (v3).
186
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
187
			array(
188
				'id'               => 'deutschebank-ideal-expert-v3',
189
				'name'             => 'Deutsche Bank - iDEAL Expert (v3)',
190
				'provider'         => 'deutschebank',
191
				'product_url'      => 'https://www.deutschebank.nl/nl/content/producten_en_services_commercial_banking_cash_management_betalen_ideal.html',
192
				'dashboard_url'    => array(
193
					'test' => 'https://myideal.test.db.com/',
194
					'live' => 'https://myideal.db.com/',
195
				),
196
				'aquirer_url'      => 'https://myideal.db.com/ideal/iDealv3',
197
				'aquirer_test_url' => null,
198
				'certificates'     => array(),
199
			)
200
		);
201
202
		// EMS - eCommerce.
203
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\EMS\ECommerce\Integration();
204
205
		// Fibonacci ORANGE.
206
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Icepay\Integration(
207
			array(
208
				'id'          => 'fibonacciorange',
209
				'name'        => 'Fibonacci ORANGE',
210
				'provider'    => 'fibonacciorange',
211
				'product_url' => 'http://www.fibonacciorange.nl/',
212
			)
213
		);
214
215
		// ICEPAY.
216
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Icepay\Integration();
217
218
		// iDEAL Simulator - iDEAL Professional / Advanced / Zelfbouw (v3).
219
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
220
			array(
221
				'id'               => 'ideal-simulator-ideal-advanced-v3',
222
				'name'             => 'iDEAL Simulator - iDEAL Professional / Advanced',
223
				'provider'         => 'ideal-simulator',
224
				'product_url'      => 'https://www.ideal-checkout.nl/support/ideal-simulator',
225
				'aquirer_url'      => 'https://www.ideal-checkout.nl/simulator/',
226
				'aquirer_test_url' => null,
227
				'certificates'     => array(),
228
			)
229
		);
230
231
		// ING - iDEAL Basic.
232
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealBasic\Integration(
233
			array(
234
				'id'               => 'ing-ideal-basic',
235
				'name'             => 'ING - iDEAL Basic',
236
				'provider'         => 'ing',
237
				'product_url'      => 'https://www.ing.nl/zakelijk/betalen/geld-ontvangen/ideal/',
238
				'manual_url'       => __( 'https://www.pronamic.eu/support/how-to-connect-ing-ideal-basic-with-wordpress-via-pronamic-pay/', 'pronamic_ideal' ),
239
				'dashboard_url'    => array(
240
					'test' => 'https://idealtest.secure-ing.com/',
241
					'live' => 'https://ideal.secure-ing.com/',
242
				),
243
				'aquirer_url'      => 'https://ideal.secure-ing.com/ideal/mpiPayInitIng.do',
244
				'aquirer_test_url' => 'https://idealtest.secure-ing.com/ideal/mpiPayInitIng.do',
245
			)
246
		);
247
248
		// ING - iDEAL Advanced (v3).
249
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
250
			array(
251
				'id'               => 'ing-ideal-advanced-v3',
252
				'name'             => 'ING - iDEAL Advanced (v3)',
253
				'provider'         => 'ing',
254
				'product_url'      => 'https://www.ing.nl/zakelijk/betalen/geld-ontvangen/ideal/',
255
				'manual_url'       => __( 'https://www.pronamic.eu/support/how-to-connect-ing-ideal-advanced-v3-with-wordpress-via-pronamic-pay/', 'pronamic_ideal' ),
256
				'dashboard_url'    => array(
257
					'test' => 'https://idealtest.secure-ing.com/',
258
					'live' => 'https://ideal.secure-ing.com/',
259
				),
260
				'aquirer_url'      => 'https://ideal.secure-ing.com/ideal/iDEALv3',
261
				'aquirer_test_url' => 'https://idealtest.secure-ing.com/ideal/iDEALv3',
262
				'certificates'     => array(),
263
			)
264
		);
265
266
		// ING - Kassa Compleet.
267
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\ING\KassaCompleet\Integration();
268
269
		// Mollie.
270
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Mollie\Integration();
271
272
		// Mollie - iDEAL.
273
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\MollieIDeal\Integration();
274
275
		// Mollie - iDEAL Basic.
276
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealBasic\Integration(
277
			array(
278
				'id'               => 'mollie-ideal-basic',
279
				'name'             => 'Mollie - iDEAL Basic',
280
				'provider'         => 'mollie',
281
				'dashboard_url'    => 'http://www.mollie.nl/beheer/',
282
				'deprecated'       => true,
283
				'aquirer_url'      => 'https://secure.mollie.nl/xml/idealAcquirer/lite/',
284
				'aquirer_test_url' => 'https://secure.mollie.nl/xml/idealAcquirer/testmode/lite/',
285
			)
286
		);
287
288
		// MultiSafePay - Connect.
289
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\MultiSafepay\Integration();
290
291
		// Nocks.
292
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Nocks\Integration();
293
294
		// Ingenico - DirectLink.
295
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Ingenico\DirectLink\Integration();
296
297
		// Ingenico - OrderStandard.
298
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Ingenico\OrderStandard\Integration();
299
300
		// Rabobank - OmniKassa.
301
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\OmniKassa\Integration();
302
303
		// Rabobank - OmniKassa 2.0.
304
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\OmniKassa2\Integration();
305
306
		// Pay.nl.
307
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\PayNL\Integration();
308
309
		// Rabobank - iDEAL Professional (v3).
310
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
311
			array(
312
				'id'               => 'rabobank-ideal-professional-v3',
313
				'name'             => 'Rabobank - iDEAL Professional (v3)',
314
				'provider'         => 'rabobank',
315
				'product_url'      => 'https://www.rabobank.nl/bedrijven/betalen/geld-ontvangen/ideal-professional/',
316
				'manual_url'       => __( 'https://www.pronamic.eu/support/how-to-connect-rabobank-ideal-professional-v3-with-wordpress-via-pronamic-pay/', 'pronamic_ideal' ),
317
				'dashboard_url'    => array(
318
					'test' => 'https://idealtest.rabobank.nl/',
319
					'live' => 'https://ideal.rabobank.nl/',
320
				),
321
				'aquirer_url'      => 'https://ideal.rabobank.nl/ideal/iDEALv3',
322
				'aquirer_test_url' => 'https://idealtest.rabobank.nl/ideal/iDEALv3',
323
				'certificates'     => array(),
324
			)
325
		);
326
327
		// Sisow.
328
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Sisow\Integration();
329
330
		// Sisow - iDEAL Basic.
331
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealBasic\Integration(
332
			array(
333
				'id'               => 'sisow-ideal-basic',
334
				'name'             => 'Sisow - iDEAL Basic',
335
				'provider'         => 'sisow',
336
				'url'              => 'https://www.sisow.nl/',
337
				'dashboard_url'    => 'https://www.sisow.nl/Sisow/iDeal/Login.aspx',
338
				'deprecated'       => true,
339
				'aquirer_url'      => 'https://www.sisow.nl/Sisow/iDeal/IssuerHandler.ashx',
340
				'aquirer_test_url' => 'https://www.sisow.nl/Sisow/iDeal/IssuerHandler.ashx/test',
341
			)
342
		);
343
344
		// TargetPay.
345
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\TargetPay\Integration();
346
347
		// Return gateways.
348
		return $gateways;
349
	}
350
);
351
352
/**
353
 * Backward compatibility.
354
 */
355
global $pronamic_ideal;
356
357
$pronamic_ideal = pronamic_pay_plugin();
358