Failed Conditions
Push — develop ( af8aa2...7450c3 )
by Reüel
17:39
created

src/SecureDataHelper.php (1 issue)

1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Ingenico;
4
5
/**
6
 * Title: Ingenico 3D Secure data helper
7
 * Description:
8
 * Copyright: 2005-2021 Pronamic
9
 * Company: Pronamic
10
 *
11
 * @author  Remco Tolsma
12
 * @version 2.0.0
13
 * @since   1.0.0
14
 */
15
class SecureDataHelper {
16
	/**
17
	 * Data
18
	 *
19
	 * @var array
20
	 */
21
	private $data;
22
23
	/**
24
	 * Constructs and initialize a Ogone data default helper class
25
	 *
26
	 * @param Data $data Data.
27
	 */
28
	public function __construct( Data $data ) {
29
		$this->data = $data;
0 ignored issues
show
Documentation Bug introduced by
It seems like $data of type Pronamic\WordPress\Pay\Gateways\Ingenico\Data is incompatible with the declared type array of property $data.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
30
	}
31
32
	/**
33
	 * Set 3-D Secure flag
34
	 *
35
	 * @param string $flag 3-D Secure flag.
36
	 *
37
	 * @return SecureDataHelper
38
	 */
39
	public function set_3d_secure_flag( $flag ) {
40
		$this->data->set_field( 'FLAG3D', $flag ? 'Y' : 'N' );
41
42
		return $this;
43
	}
44
45
	/**
46
	 * Set HTTP Accept
47
	 *
48
	 * @param string $http_accept HTTP accept.
49
	 *
50
	 * @return SecureDataHelper
51
	 */
52
	public function set_http_accept( $http_accept ) {
53
		$this->data->set_field( 'HTTP_ACCEPT', $http_accept );
54
55
		return $this;
56
	}
57
58
	/**
59
	 * Set HTTP User-Agent
60
	 *
61
	 * @param string $user_agent User agent.
62
	 *
63
	 * @return SecureDataHelper
64
	 */
65
	public function set_http_user_agent( $user_agent ) {
66
		$this->data->set_field( 'HTTP_USER_AGENT', $user_agent );
67
68
		return $this;
69
	}
70
71
	/**
72
	 * Set window
73
	 *
74
	 * @param string $window Window.
75
	 *
76
	 * @return SecureDataHelper
77
	 */
78
	public function set_window( $window ) {
79
		$this->data->set_field( 'WIN3DS', $window );
80
81
		return $this;
82
	}
83
}
84