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

pronamic-ideal.php (1 issue)

Severity
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\RestrictContentPro\Extension::bootstrap',
101
			'\Pronamic\WordPress\Pay\Extensions\NinjaForms\Extension::bootstrap',
102
		),
103
	)
104
);
105
106
add_filter(
107
	'pronamic_pay_plugin_integrations',
108
	function( $integrations ) {
109
		// Restrict Content Pro.
110
		$integrations[] = new \Pronamic\WordPress\Pay\Extensions\RestrictContentPro\Extension(
111
			array(
0 ignored issues
show
The call to Pronamic\WordPress\Pay\E...xtension::__construct() has too many arguments starting with array('requires_at_least...sted_up_to' => '3.1.2'). ( Ignorable by Annotation )

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

111
		$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...
112
				'requires_at_least' => '3.0.0',
113
				'tested_up_to'      => '3.1.2',
114
			)
115
		);
116
117
		// Return integrations.
118
		return $integrations;
119
	}
120
);
121
122
add_filter(
123
	'pronamic_pay_gateways',
124
	function( $gateways ) {
125
		// ABN AMRO - iDEAL Zelfbouw (v3).
126
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
127
			array(
128
				'id'               => 'abnamro-ideal-zelfbouw-v3',
129
				'name'             => 'ABN AMRO - iDEAL Zelfbouw (v3)',
130
				'provider'         => 'abnamro',
131
				'url'              => 'https://abnamro.ideal-payment.de/',
132
				'product_url'      => 'https://www.abnamro.nl/nl/zakelijk/betalen/online-betalen/betaaloplossing/',
133
				'dashboard_url'    => array(
134
					'test' => 'https://abnamro-test.ideal-payment.de/',
135
					'live' => 'https://abnamro.ideal-payment.de/',
136
				),
137
				'aquirer_url'      => 'https://abnamro.ideal-payment.de/ideal/iDEALv3',
138
				'aquirer_test_url' => 'https://abnamro-test.ideal-payment.de/ideal/iDEALv3',
139
				'certificates'     => array(),
140
			)
141
		);
142
143
		// Buckaroo.
144
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Buckaroo\Integration();
145
146
		// Deutsche Bank - iDEAL Expert (v3).
147
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
148
			array(
149
				'id'               => 'deutschebank-ideal-expert-v3',
150
				'name'             => 'Deutsche Bank - iDEAL Expert (v3)',
151
				'provider'         => 'deutschebank',
152
				'product_url'      => 'https://www.deutschebank.nl/nl/content/producten_en_services_commercial_banking_cash_management_betalen_ideal.html',
153
				'dashboard_url'    => array(
154
					'test' => 'https://myideal.test.db.com/',
155
					'live' => 'https://myideal.db.com/',
156
				),
157
				'aquirer_url'      => 'https://myideal.db.com/ideal/iDealv3',
158
				'aquirer_test_url' => null,
159
				'certificates'     => array(),
160
			)
161
		);
162
163
		// EMS - eCommerce.
164
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\EMS\ECommerce\Integration();
165
166
		// Fibonacci ORANGE.
167
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Icepay\Integration(
168
			array(
169
				'id'          => 'fibonacciorange',
170
				'name'        => 'Fibonacci ORANGE',
171
				'provider'    => 'fibonacciorange',
172
				'product_url' => 'http://www.fibonacciorange.nl/',
173
			)
174
		);
175
176
		// ICEPAY.
177
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Icepay\Integration();
178
179
		// iDEAL Simulator - iDEAL Professional / Advanced / Zelfbouw (v3).
180
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
181
			array(
182
				'id'               => 'ideal-simulator-ideal-advanced-v3',
183
				'name'             => 'iDEAL Simulator - iDEAL Professional / Advanced',
184
				'provider'         => 'ideal-simulator',
185
				'product_url'      => 'https://www.ideal-checkout.nl/support/ideal-simulator',
186
				'aquirer_url'      => 'https://www.ideal-checkout.nl/simulator/',
187
				'aquirer_test_url' => null,
188
				'certificates'     => array(),
189
			)
190
		);
191
192
		// ING - iDEAL Basic.
193
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealBasic\Integration(
194
			array(
195
				'id'               => 'ing-ideal-basic',
196
				'name'             => 'ING - iDEAL Basic',
197
				'provider'         => 'ing',
198
				'product_url'      => 'https://www.ing.nl/zakelijk/betalen/geld-ontvangen/ideal/',
199
				'manual_url'       => __( 'https://www.pronamic.eu/support/how-to-connect-ing-ideal-basic-with-wordpress-via-pronamic-pay/', 'pronamic_ideal' ),
200
				'dashboard_url'    => array(
201
					'test' => 'https://idealtest.secure-ing.com/',
202
					'live' => 'https://ideal.secure-ing.com/',
203
				),
204
				'aquirer_url'      => 'https://ideal.secure-ing.com/ideal/mpiPayInitIng.do',
205
				'aquirer_test_url' => 'https://idealtest.secure-ing.com/ideal/mpiPayInitIng.do',
206
			)
207
		);
208
209
		// ING - iDEAL Advanced (v3).
210
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
211
			array(
212
				'id'               => 'ing-ideal-advanced-v3',
213
				'name'             => 'ING - iDEAL Advanced (v3)',
214
				'provider'         => 'ing',
215
				'product_url'      => 'https://www.ing.nl/zakelijk/betalen/geld-ontvangen/ideal/',
216
				'manual_url'       => __( 'https://www.pronamic.eu/support/how-to-connect-ing-ideal-advanced-v3-with-wordpress-via-pronamic-pay/', 'pronamic_ideal' ),
217
				'dashboard_url'    => array(
218
					'test' => 'https://idealtest.secure-ing.com/',
219
					'live' => 'https://ideal.secure-ing.com/',
220
				),
221
				'aquirer_url'      => 'https://ideal.secure-ing.com/ideal/iDEALv3',
222
				'aquirer_test_url' => 'https://idealtest.secure-ing.com/ideal/iDEALv3',
223
				'certificates'     => array(),
224
			)
225
		);
226
227
		// ING - Kassa Compleet.
228
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\ING\KassaCompleet\Integration();
229
230
		// Mollie.
231
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Mollie\Integration();
232
233
		// Mollie - iDEAL.
234
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\MollieIDeal\Integration();
235
236
		// Mollie - iDEAL Basic.
237
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealBasic\Integration(
238
			array(
239
				'id'               => 'mollie-ideal-basic',
240
				'name'             => 'Mollie - iDEAL Basic',
241
				'provider'         => 'mollie',
242
				'dashboard_url'    => 'http://www.mollie.nl/beheer/',
243
				'deprecated'       => true,
244
				'aquirer_url'      => 'https://secure.mollie.nl/xml/idealAcquirer/lite/',
245
				'aquirer_test_url' => 'https://secure.mollie.nl/xml/idealAcquirer/testmode/lite/',
246
			)
247
		);
248
249
		// MultiSafePay - Connect.
250
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\MultiSafepay\Integration();
251
252
		// Nocks.
253
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Nocks\Integration();
254
255
		// Ingenico - DirectLink.
256
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Ingenico\DirectLink\Integration();
257
258
		// Ingenico - OrderStandard.
259
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Ingenico\OrderStandard\Integration();
260
261
		// Rabobank - OmniKassa.
262
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\OmniKassa\Integration();
263
264
		// Rabobank - OmniKassa 2.0.
265
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\OmniKassa2\Integration();
266
267
		// Pay.nl.
268
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\PayNL\Integration();
269
270
		// Rabobank - iDEAL Professional (v3).
271
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Integration(
272
			array(
273
				'id'               => 'rabobank-ideal-professional-v3',
274
				'name'             => 'Rabobank - iDEAL Professional (v3)',
275
				'provider'         => 'rabobank',
276
				'product_url'      => 'https://www.rabobank.nl/bedrijven/betalen/geld-ontvangen/ideal-professional/',
277
				'manual_url'       => __( 'https://www.pronamic.eu/support/how-to-connect-rabobank-ideal-professional-v3-with-wordpress-via-pronamic-pay/', 'pronamic_ideal' ),
278
				'dashboard_url'    => array(
279
					'test' => 'https://idealtest.rabobank.nl/',
280
					'live' => 'https://ideal.rabobank.nl/',
281
				),
282
				'aquirer_url'      => 'https://ideal.rabobank.nl/ideal/iDEALv3',
283
				'aquirer_test_url' => 'https://idealtest.rabobank.nl/ideal/iDEALv3',
284
				'certificates'     => array(),
285
			)
286
		);
287
288
		// Sisow.
289
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Sisow\Integration();
290
291
		// Sisow - iDEAL Basic.
292
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\IDealBasic\Integration(
293
			array(
294
				'id'               => 'sisow-ideal-basic',
295
				'name'             => 'Sisow - iDEAL Basic',
296
				'provider'         => 'sisow',
297
				'url'              => 'https://www.sisow.nl/',
298
				'dashboard_url'    => 'https://www.sisow.nl/Sisow/iDeal/Login.aspx',
299
				'deprecated'       => true,
300
				'aquirer_url'      => 'https://www.sisow.nl/Sisow/iDeal/IssuerHandler.ashx',
301
				'aquirer_test_url' => 'https://www.sisow.nl/Sisow/iDeal/IssuerHandler.ashx/test',
302
			)
303
		);
304
305
		// TargetPay.
306
		$gateways[] = new \Pronamic\WordPress\Pay\Gateways\TargetPay\Integration();
307
308
		// Return gateways.
309
		return $gateways;
310
	}
311
);
312
313
/**
314
 * Backward compatibility.
315
 */
316
global $pronamic_ideal;
317
318
$pronamic_ideal = pronamic_pay_plugin();
319