AbstractIntegration::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 25
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 2
eloc 17
c 3
b 0
f 0
nc 2
nop 1
dl 0
loc 25
ccs 0
cts 21
cp 0
crap 6
rs 9.7
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Ingenico;
4
5
use Pronamic\WordPress\Pay\AbstractGatewayIntegration;
6
7
abstract class AbstractIntegration extends AbstractGatewayIntegration {
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
				'manual_url'    => \__( 'https://www.pronamic.eu/support/how-to-connect-ingenico-with-wordpress-via-pronamic-pay/', 'pronamic_ideal' ),
17
				'dashboard_url' => 'https://secure.ogone.com/',
18
				'provider'      => 'ogone',
19
				'supports'      => array(
20
					'webhook',
21
					'webhook_log',
22
				),
23
			)
24
		);
25
26
		parent::__construct( $args );
27
28
		// Actions.
29
		$function = array( __NAMESPACE__ . '\Listener', 'listen' );
30
31
		if ( ! has_action( 'wp_loaded', $function ) ) {
32
			add_action( 'wp_loaded', $function );
33
		}
34
	}
35
}
36