|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Plugin Name: Pronamic Pay Adyen Add-On |
|
4
|
|
|
* Plugin URI: https://www.pronamic.eu/plugins/pronamic-pay-adyen/ |
|
5
|
|
|
* Description: Extend the Pronamic Pay plugin with the Adyen gateway to receive payments with Adyen through a variety of WordPress plugins. |
|
6
|
|
|
* |
|
7
|
|
|
* Version: 2.0.0 |
|
8
|
|
|
* Requires at least: 4.7 |
|
9
|
|
|
* |
|
10
|
|
|
* Author: Pronamic |
|
11
|
|
|
* Author URI: https://www.pronamic.eu/ |
|
12
|
|
|
* |
|
13
|
|
|
* Text Domain: pronamic-pay-adyen |
|
14
|
|
|
* Domain Path: /languages/ |
|
15
|
|
|
* |
|
16
|
|
|
* License: GPL-3.0-or-later |
|
17
|
|
|
* |
|
18
|
|
|
* GitHub URI: https://github.com/wp-pay-gateways/adyen |
|
19
|
|
|
* |
|
20
|
|
|
* @author Pronamic <[email protected]> |
|
21
|
|
|
* @copyright 2005-2019 Pronamic |
|
22
|
|
|
* @license GPL-3.0-or-later |
|
23
|
|
|
* @package Pronamic\WordPress\Pay\Gateways\Adyen |
|
24
|
|
|
*/ |
|
25
|
|
|
|
|
26
|
|
|
namespace Pronamic\WordPress\Pay\Gateways\Adyen; |
|
27
|
|
|
|
|
28
|
|
|
use Pronamic\WordPress\Pay\AddOn; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* Function to block activation of the plugin. |
|
32
|
|
|
*/ |
|
33
|
|
|
function block_activation() { |
|
34
|
|
|
$message = sprintf( |
|
35
|
|
|
/* translators: 1: http://www.wpupdatephp.com/update/, 2: _blank */ |
|
36
|
|
|
__( |
|
37
|
|
|
'The Pronamic Pay Adyen Add-On requires at least PHP 5.3. Read more information about how you can <a href="%1$s" target="%2$s">update your PHP version</a>.', |
|
38
|
|
|
'pronamic_ideal' |
|
39
|
|
|
), |
|
40
|
|
|
esc_attr__( 'http://www.wpupdatephp.com/update/', 'pronamic_ideal' ), |
|
41
|
|
|
esc_attr( '_blank' ) |
|
42
|
|
|
); |
|
43
|
|
|
|
|
44
|
|
|
wp_die( |
|
45
|
|
|
wp_kses( |
|
46
|
|
|
$message, |
|
47
|
|
|
array( |
|
48
|
|
|
'a' => array( |
|
49
|
|
|
'href' => true, |
|
50
|
|
|
'target' => true, |
|
51
|
|
|
), |
|
52
|
|
|
) |
|
53
|
|
|
) |
|
54
|
|
|
); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* Deactive Pronamic Pay add-on. |
|
59
|
|
|
*/ |
|
60
|
|
|
function deactivate_plugin() { |
|
61
|
|
|
deactivate_plugins( plugin_basename( __FILE__ ) ); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
if ( version_compare( PHP_VERSION, '5.3', '<' ) ) { |
|
65
|
|
|
register_activation_hook( __FILE__, __NAMESPACE__ . '\block_activation' ); |
|
66
|
|
|
|
|
67
|
|
|
add_action( 'admin_init', __NAMESPACE__ . '\deactivate_plugin' ); |
|
68
|
|
|
|
|
69
|
|
|
return; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
// Load Pronamic Pay add-on. |
|
73
|
|
|
require plugin_dir_path( __FILE__ ) . '/vendor/wp-pay/core/src/AddOn.php'; |
|
74
|
|
|
|
|
75
|
|
|
$addon = new AddOn( __FILE__ ); |
|
76
|
|
|
|
|
77
|
|
|
$addon->add_gateways( |
|
78
|
|
|
array( |
|
79
|
|
|
'Pronamic\WordPress\Pay\Gateways\Adyen\Integration', |
|
80
|
|
|
) |
|
81
|
|
|
); |
|
82
|
|
|
|