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

Integration::get_settings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
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