Failed Conditions
Push — develop ( bbd286...0a32cc )
by Reüel
03:35
created

Integration   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Test Coverage

Coverage 70%

Importance

Changes 0
Metric Value
wmc 5
eloc 16
dl 0
loc 57
c 0
b 0
f 0
ccs 14
cts 20
cp 0.7
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A get_config_factory_class() 0 2 1
A get_settings_class() 0 2 1
A get_settings() 0 6 1
A __construct() 0 19 2
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