Test Failed
Push — develop ( 1009b1...0ad1b1 )
by Reüel
02:49
created

src/Settings.php (5 issues)

1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\IDealBasic;
4
5
use Pronamic\WordPress\Pay\Core\GatewaySettings;
6
7
/**
8
 * Title: iDEAL Basic settings
9
 * Description:
10
 * Copyright: 2005-2019 Pronamic
11
 * Company: Pronamic
12
 *
13
 * @author  Remco Tolsma
14
 * @version 2.0.0
15
 * @since   1.1.0
16
 */
17
class Settings extends GatewaySettings {
18
	public function __construct() {
19
		add_filter( 'pronamic_pay_gateway_sections', array( $this, 'sections' ) );
0 ignored issues
show
The function add_filter was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
		/** @scrutinizer ignore-call */ 
20
  add_filter( 'pronamic_pay_gateway_sections', array( $this, 'sections' ) );
Loading history...
20
		add_filter( 'pronamic_pay_gateway_fields', array( $this, 'fields' ) );
21
	}
22
23
	public function sections( array $sections ) {
24
		// Transaction feedback
25
		$sections['IDealBasic_feedback'] = array(
26
			'title'       => __( 'Transaction feedback', 'pronamic_ideal' ),
0 ignored issues
show
The function __ was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
			'title'       => /** @scrutinizer ignore-call */ __( 'Transaction feedback', 'pronamic_ideal' ),
Loading history...
27
			'methods'     => array( 'ideal-basic' ),
28
			'description' => __( 'The URL below needs to be copied to the payment provider dashboard to receive automatic transaction status updates.', 'pronamic_ideal' ),
29
		);
30
31
		// Return sections
32
		return $sections;
33
	}
34
35
	public function fields( array $fields ) {
36
		// Hash Key
37
		$fields[] = array(
38
			'filter'   => FILTER_SANITIZE_STRING,
39
			'section'  => 'ideal',
40
			'meta_key' => '_pronamic_gateway_ideal_hash_key',
41
			'title'    => __( 'Hash Key', 'pronamic_ideal' ),
0 ignored issues
show
The function __ was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

41
			'title'    => /** @scrutinizer ignore-call */ __( 'Hash Key', 'pronamic_ideal' ),
Loading history...
42
			'type'     => 'text',
43
			'classes'  => array( 'regular-text', 'code' ),
44
			'tooltip'  => __( 'Hash key (also known as: key or secret key) as mentioned in the payment provider dashboard.', 'pronamic_ideal' ),
45
			'methods'  => array( 'ideal-basic' ),
46
		);
47
48
		// Transaction feedback
49
		$fields[] = array(
50
			'section' => 'ideal',
51
			'methods' => array( 'ideal-basic' ),
52
			'title'   => __( 'Transaction feedback', 'pronamic_ideal' ),
53
			'type'    => 'description',
54
			'html'    => sprintf(
55
				'<span class="dashicons dashicons-warning"></span> %s',
56
				__( 'Receiving payment status updates needs additional configuration, if not yet completed.', 'pronamic_ideal' )
57
			),
58
		);
59
60
		// XML Notification URL
61
		$fields[] = array(
62
			'section'  => 'IDealBasic_feedback',
63
			'title'    => __( 'XML Notification URL', 'pronamic_ideal' ),
64
			'type'     => 'text',
65
			'classes'  => array( 'regular-text', 'code' ),
66
			'value'    => add_query_arg( array(
0 ignored issues
show
The function add_query_arg was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

66
			'value'    => /** @scrutinizer ignore-call */ add_query_arg( array(
Loading history...
67
				'gateway'          => 'IDealBasic',
68
				'xml_notification' => 'true',
69
			), site_url( '/' ) ),
0 ignored issues
show
The function site_url was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

69
			), /** @scrutinizer ignore-call */ site_url( '/' ) ),
Loading history...
70
			'methods'  => array( 'ideal-basic' ),
71
			'readonly' => true,
72
			'size'     => 200,
73
			'tooltip'  => __( 'Copy the XML notification URL to the payment provider dashboard to receive automatic transaction status updates.', 'pronamic_ideal' ),
74
		);
75
76
		// Return fields
77
		return $fields;
78
	}
79
}
80