Failed Conditions
Push — develop ( abd8c7...e6c5de )
by Remco
04:31
created

Integration   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 42
ccs 0
cts 28
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A get_config_factory_class() 0 2 1
A __construct() 0 6 1
A get_settings_fields() 0 24 1
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\TargetPay;
4
5
use Pronamic\WordPress\Pay\Gateways\Common\AbstractIntegration;
6
7
/**
8
 * Title: TargetPay integration
9
 * Description:
10
 * Copyright: 2005-2019 Pronamic
11
 * Company: Pronamic
12
 *
13
 * @author  Remco Tolsma
14
 * @version 2.0.0
15
 * @since   1.0.0
16
 */
17
class Integration extends AbstractIntegration {
18
	public function __construct() {
19
		$this->id            = 'targetpay-ideal';
20
		$this->name          = 'TargetPay - iDEAL';
21
		$this->product_url   = __( 'https://www.targetpay.com/info/ideal?setlang=en', 'pronamic_ideal' );
22
		$this->dashboard_url = 'https://www.targetpay.com/login';
23
		$this->provider      = 'targetpay';
24
	}
25
26
	public function get_config_factory_class() {
27
		return __NAMESPACE__ . '\ConfigFactory';
28
	}
29
30
	/**
31
	 * Get settings fields.
32
	 *
33
	 * @return array
34
	 */
35
	public function get_settings_fields() {
36
		$fields = array();
37
38
		// Intro.
39
		$fields[] = array(
40
			'type' => 'html',
41
			'html' => sprintf(
42
				/* translators: 1: TargetPay */
43
				__( 'Account details are provided by %1$s after registration. These settings need to match with the %1$s dashboard.', 'pronamic_ideal' ),
44
				__( 'TargetPay', 'pronamic_ideal' )
45
			),
46
		);
47
48
		// Layout Code.
49
		$fields[] = array(
50
			'filter'   => FILTER_SANITIZE_STRING,
51
			'section'  => 'general',
52
			'meta_key' => '_pronamic_gateway_targetpay_layoutcode',
53
			'title'    => __( 'Layout Code', 'pronamic_ideal' ),
54
			'type'     => 'text',
55
			'tooltip'  => __( 'Layout code as mentioned at <strong>Sub accounts</strong> in the TargetPay dashboard.', 'pronamic_ideal' ),
56
		);
57
58
		return $fields;
59
	}
60
}
61