|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Integration |
|
4
|
|
|
* |
|
5
|
|
|
* @author Pronamic <[email protected]> |
|
6
|
|
|
* @copyright 2005-2019 Pronamic |
|
7
|
|
|
* @license GPL-3.0-or-later |
|
8
|
|
|
* @package Pronamic\WordPress\Pay\Gateways\Adyen |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
namespace Pronamic\WordPress\Pay\Gateways\Adyen; |
|
12
|
|
|
|
|
13
|
|
|
use Pronamic\WordPress\Pay\Gateways\Common\AbstractIntegration; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Integration |
|
17
|
|
|
* |
|
18
|
|
|
* @author Remco Tolsma |
|
19
|
|
|
* @version 1.0.0 |
|
20
|
|
|
* @since 1.0.0 |
|
21
|
|
|
*/ |
|
22
|
|
|
class Integration extends AbstractIntegration { |
|
23
|
|
|
/** |
|
24
|
|
|
* Integration constructor. |
|
25
|
|
|
*/ |
|
26
|
1 |
|
public function __construct() { |
|
27
|
1 |
|
$this->id = 'adyen'; |
|
28
|
1 |
|
$this->name = 'Adyen'; |
|
29
|
1 |
|
$this->provider = 'adyen'; |
|
30
|
1 |
|
$this->url = 'https://www.adyen.com/'; |
|
31
|
1 |
|
$this->dashboard_url = array( |
|
32
|
1 |
|
__( 'test', 'pronamic_ideal' ) => 'https://ca-test.adyen.com/ca/ca/login.shtml', |
|
33
|
1 |
|
__( 'live', 'pronamic_ideal' ) => 'https://ca-live.adyen.com/ca/ca/login.shtml', |
|
34
|
|
|
); |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* Webhook listener function. |
|
38
|
|
|
* |
|
39
|
|
|
* @var callable $webhook_listener_function |
|
40
|
|
|
*/ |
|
41
|
1 |
|
$webhook_listener_function = array( __NAMESPACE__ . '\WebhookListener', 'listen' ); |
|
42
|
|
|
|
|
43
|
1 |
|
if ( ! has_action( 'wp_loaded', $webhook_listener_function ) ) { |
|
44
|
1 |
|
add_action( 'wp_loaded', $webhook_listener_function ); |
|
45
|
|
|
} |
|
46
|
1 |
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* Get config factory class. |
|
50
|
|
|
* |
|
51
|
|
|
* @return string |
|
52
|
|
|
*/ |
|
53
|
1 |
|
public function get_config_factory_class() { |
|
54
|
1 |
|
return __NAMESPACE__ . '\ConfigFactory'; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* Get settings class. |
|
59
|
|
|
* |
|
60
|
|
|
* @return string |
|
61
|
|
|
*/ |
|
62
|
|
|
public function get_settings_class() { |
|
63
|
|
|
return __NAMESPACE__ . '\Settings'; |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* Get required settings for this integration. |
|
68
|
|
|
* |
|
69
|
|
|
* @link https://github.com/wp-premium/gravityforms/blob/1.9.16/includes/fields/class-gf-field-multiselect.php#L21-L42 |
|
70
|
|
|
* @since 1.1.6 |
|
71
|
|
|
* @return array |
|
72
|
|
|
*/ |
|
73
|
|
|
public function get_settings() { |
|
74
|
|
|
$settings = parent::get_settings(); |
|
75
|
|
|
|
|
76
|
|
|
$settings[] = 'adyen'; |
|
77
|
|
|
|
|
78
|
|
|
return $settings; |
|
79
|
|
|
} |
|
80
|
|
|
} |
|
81
|
|
|
|