1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Pronamic\WordPress\Pay\Gateways\IDealBasic; |
4
|
|
|
|
5
|
|
|
use Pronamic\WordPress\Pay\Gateways\IDeal\AbstractIntegration; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Title: 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
|
|
|
/** |
19
|
|
|
* Construct and initialize integration. |
20
|
|
|
*/ |
21
|
|
|
public function __construct() { |
22
|
|
|
$this->supports = array( |
|
|
|
|
23
|
|
|
'webhook', |
24
|
|
|
); |
25
|
|
|
|
26
|
|
|
// Actions. |
27
|
|
|
$function = array( __NAMESPACE__ . '\Listener', 'listen' ); |
28
|
|
|
|
29
|
|
|
if ( ! has_action( 'wp_loaded', $function ) ) { |
30
|
|
|
add_action( 'wp_loaded', $function ); |
31
|
|
|
} |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function get_config_factory_class() { |
35
|
|
|
return __NAMESPACE__ . '\ConfigFactory'; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function get_settings_fields() { |
39
|
|
|
$fields = parent::get_settings_fields(); |
|
|
|
|
40
|
|
|
|
41
|
|
|
// Hash Key |
42
|
|
|
$fields[] = array( |
43
|
|
|
'section' => 'general', |
44
|
|
|
'filter' => FILTER_SANITIZE_STRING, |
45
|
|
|
'meta_key' => '_pronamic_gateway_ideal_hash_key', |
46
|
|
|
'title' => __( 'Hash Key', 'pronamic_ideal' ), |
47
|
|
|
'type' => 'text', |
48
|
|
|
'classes' => array( 'regular-text', 'code' ), |
49
|
|
|
'tooltip' => __( 'Hash key (also known as: key or secret key) as mentioned in the payment provider dashboard.', 'pronamic_ideal' ), |
50
|
|
|
'methods' => array( 'ideal-basic' ), |
51
|
|
|
); |
52
|
|
|
|
53
|
|
|
// XML Notification URL. |
54
|
|
|
$fields[] = array( |
55
|
|
|
'section' => 'feedback', |
56
|
|
|
'title' => __( 'XML Notification URL', 'pronamic_ideal' ), |
57
|
|
|
'type' => 'text', |
58
|
|
|
'classes' => array( 'regular-text', 'code' ), |
59
|
|
|
'value' => add_query_arg( |
60
|
|
|
array( |
61
|
|
|
'gateway' => 'IDealBasic', |
62
|
|
|
'xml_notification' => 'true', |
63
|
|
|
), |
64
|
|
|
site_url( '/' ) |
65
|
|
|
), |
66
|
|
|
'methods' => array( 'ideal-basic' ), |
67
|
|
|
'readonly' => true, |
68
|
|
|
'size' => 200, |
69
|
|
|
'tooltip' => __( 'Copy the XML notification URL to the payment provider dashboard to receive automatic transaction status updates.', 'pronamic_ideal' ), |
70
|
|
|
); |
71
|
|
|
|
72
|
|
|
// Return fields. |
73
|
|
|
return $fields; |
74
|
|
|
} |
75
|
|
|
} |
76
|
|
|
|