Test Failed
Push — master ( 12f600...60caf1 )
by Remco
20:03 queued 11:56
created

AbstractIntegration::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 31
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 21
nc 2
nop 1
dl 0
loc 31
ccs 0
cts 13
cp 0
crap 6
rs 9.584
c 0
b 0
f 0
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Ingenico;
4
5
use Pronamic\WordPress\Pay\Gateways\Common\AbstractIntegration as Common_AbstractIntegration;
6
7
abstract class AbstractIntegration extends Common_AbstractIntegration {
8
	public function __construct( $args = array() ) {
9
		$args = wp_parse_args(
10
			$args,
11
			array(
12
				'id'            => null,
13
				'name'          => null,
14
				'url'           => 'https://secure.ogone.com/',
15
				'product_url'   => __( 'https://payment-services.ingenico.com/nl/en', 'pronamic_ideal' ),
16
				'dashboard_url' => 'https://secure.ogone.com/',
17
				'provider'      => 'ogone',
18
			)
19
		);
20
21
		$this->id            = $args['id'];
22
		$this->name          = $args['name'];
23
		$this->url           = $args['url'];
24
		$this->product_url   = $args['product_url'];
25
		$this->dashboard_url = $args['dashboard_url'];
26
		$this->provider      = $args['provider'];
27
28
		// Supports.
29
		$this->supports = array(
30
			'webhook',
31
			'webhook_log',
32
		);
33
34
		// Actions.
35
		$function = array( __NAMESPACE__ . '\Listener', 'listen' );
36
37
		if ( ! has_action( 'wp_loaded', $function ) ) {
38
			add_action( 'wp_loaded', $function );
39
		}
40
	}
41
}
42