Failed Conditions
Push — develop ( 7def27...16c92d )
by Remco
04:49
created

src/Integration.php (1 issue)

1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\PayNL;
4
5
use Pronamic\WordPress\Pay\Gateways\Common\AbstractIntegration;
6
7
/**
8
 * Title: Pay.nl 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            = 'pay_nl';
20
		$this->name          = 'Pay.nl';
21
		$this->url           = 'https://www.pay.nl/';
22
		$this->product_url   = 'http://www.pay.nl/';
23
		$this->dashboard_url = 'https://admin.pay.nl/';
24
		$this->register_url  = 'https://www.pay.nl/registreren/?id=M-7393-3100';
0 ignored issues
show
Bug Best Practice introduced by
The property register_url does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
25
		$this->provider      = 'pay_nl';
26
	}
27
28
	public function get_config_factory_class() {
29
		return __NAMESPACE__ . '\ConfigFactory';
30
	}
31
32
	/**
33
	 * Get settings fields.
34
	 *
35
	 * @return array
36
	 */
37
	public function get_settings_fields() {
38
		$fields = array();
39
40
		// Intro.
41
		$fields[] = array(
42
			'section' => 'general',
43
			'type'    => 'html',
44
			'html'    => sprintf(
45
				/* translators: 1: Pay.nl */
46
				__( 'Account details are provided by %1$s after registration. These settings need to match with the %1$s dashboard.', 'pronamic_ideal' ),
47
				__( 'Pay.nl', 'pronamic_ideal' )
48
			),
49
		);
50
51
		// Token.
52
		$fields[] = array(
53
			'section'  => 'general',
54
			'filter'   => FILTER_SANITIZE_STRING,
55
			'meta_key' => '_pronamic_gateway_pay_nl_token',
56
			'title'    => __( 'Token', 'pronamic_ideal' ),
57
			'type'     => 'text',
58
			'classes'  => array( 'regular-text', 'code' ),
59
			'tooltip'  => __( 'Token as mentioned at <strong>Merchant » Company data (Connection)</strong> in the payment provider dashboard.', 'pronamic_ideal' ),
60
		);
61
62
		// Service ID.
63
		$fields[] = array(
64
			'section'  => 'general',
65
			'filter'   => FILTER_SANITIZE_STRING,
66
			'meta_key' => '_pronamic_gateway_pay_nl_service_id',
67
			'title'    => __( 'Service ID', 'pronamic_ideal' ),
68
			'type'     => 'text',
69
			'classes'  => array( 'regular-text', 'code' ),
70
			'tooltip'  => __( 'Service ID as mentioned at <strong>Manage » Services</strong> in the payment provider dashboard.', 'pronamic_ideal' ),
71
		);
72
73
		// Return fields.
74
		return $fields;
75
	}
76
}
77