1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* PHP version 5.4 and 8 |
5
|
|
|
* |
6
|
|
|
* @category MessageEntity |
7
|
|
|
* @package Payever\Payments |
8
|
|
|
* @author payever GmbH <[email protected]> |
9
|
|
|
* @copyright 2017-2021 payever GmbH |
10
|
|
|
* @license MIT <https://opensource.org/licenses/MIT> |
11
|
|
|
* @link https://docs.payever.org/shopsystems/api/getting-started |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Payever\ExternalIntegration\Payments\Http\MessageEntity; |
15
|
|
|
|
16
|
|
|
use Payever\ExternalIntegration\Core\Base\MessageEntity; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* This class represents Payment Data Entity |
20
|
|
|
* |
21
|
|
|
* @method \DateTime|false getBirthdate() |
22
|
|
|
* @method bool getConditionsAccepted() |
23
|
|
|
* @method string getRiskSessionId() |
24
|
|
|
* @method string getFrontendFinishUrl() |
25
|
|
|
* @method string getFrontendCancelUrl() |
26
|
|
|
* @method bool getForceRedirect() |
27
|
|
|
* @method string getFloor() |
28
|
|
|
* @method string getDoor() |
29
|
|
|
* @method string getBlock() |
30
|
|
|
* @method self setConditionsAccepted(bool $conditionsAccepted) |
31
|
|
|
* @method self setRiskSessionId(string $riskSessionId) |
32
|
|
|
* @method self setFrontendFinishUrl(string $frontendFinishUrl) |
33
|
|
|
* @method self setFrontendCancelUrl(string $frontendCancelUrl) |
34
|
|
|
* @method self setFloor(string $floor) |
35
|
|
|
* @method self setDoor(string $door) |
36
|
|
|
* @method self setBlock(string $block) |
37
|
|
|
*/ |
38
|
|
|
class PaymentDataEntity extends MessageEntity |
39
|
|
|
{ |
40
|
|
|
/** @var \DateTime|bool $birthdate */ |
41
|
|
|
protected $birthdate; |
42
|
|
|
|
43
|
|
|
/** @var bool $conditionsAccepted */ |
44
|
|
|
protected $conditionsAccepted; |
45
|
|
|
|
46
|
|
|
/** @var string $riskSessionId */ |
47
|
|
|
protected $riskSessionId; |
48
|
|
|
|
49
|
|
|
/** @var string $frontendFinishUrl */ |
50
|
|
|
protected $frontendFinishUrl; |
51
|
|
|
|
52
|
|
|
/** @var string frontendCancelUrl */ |
53
|
|
|
protected $frontendCancelUrl; |
54
|
|
|
|
55
|
|
|
/** @var boolean $force_redirect */ |
56
|
|
|
protected $force_redirect; |
57
|
|
|
|
58
|
|
|
/** @var string $organization_name */ |
59
|
|
|
protected $organization_name; |
60
|
|
|
|
61
|
|
|
/** @var string $street_type */ |
62
|
|
|
protected $street_type; |
63
|
|
|
|
64
|
|
|
/** @var string $floor */ |
65
|
|
|
protected $floor; |
66
|
|
|
|
67
|
|
|
/** @var string $door */ |
68
|
|
|
protected $door; |
69
|
|
|
|
70
|
|
|
/** @var string $block */ |
71
|
|
|
protected $block; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Sets Birthdate |
75
|
|
|
* |
76
|
|
|
* @param string $birthdate |
77
|
|
|
* |
78
|
|
|
* @return $this |
79
|
|
|
*/ |
80
|
|
|
public function setBirthdate($birthdate) |
81
|
|
|
{ |
82
|
|
|
$this->birthdate = date_create($birthdate); |
83
|
|
|
|
84
|
|
|
return $this; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Sets force redirect value |
89
|
|
|
* |
90
|
|
|
* @param string $forceRedirect |
91
|
|
|
* |
92
|
|
|
* @return $this |
93
|
|
|
*/ |
94
|
|
|
public function setForceRedirect($forceRedirect) |
95
|
|
|
{ |
96
|
|
|
$this->force_redirect = $forceRedirect; |
|
|
|
|
97
|
|
|
|
98
|
|
|
return $this; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* Gets Organization name value |
103
|
|
|
* |
104
|
|
|
* @return string |
105
|
|
|
*/ |
106
|
|
|
public function getOrganizationName() |
107
|
|
|
{ |
108
|
|
|
return $this->organization_name; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* Sets Organization name value |
113
|
|
|
* |
114
|
|
|
* @param string $organizationName |
115
|
|
|
* |
116
|
|
|
* @return $this |
117
|
|
|
*/ |
118
|
|
|
public function setOrganizationName($organizationName) |
119
|
|
|
{ |
120
|
|
|
$this->organization_name = $organizationName; |
121
|
|
|
|
122
|
|
|
return $this; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* Gets Street Type value |
127
|
|
|
* |
128
|
|
|
* @return string |
129
|
|
|
*/ |
130
|
|
|
public function getStreetType() |
131
|
|
|
{ |
132
|
|
|
return $this->street_type; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* Sets Street Type value |
137
|
|
|
* |
138
|
|
|
* @param string $streetType |
139
|
|
|
* |
140
|
|
|
* @return $this |
141
|
|
|
*/ |
142
|
|
|
public function setStreetType($streetType) |
143
|
|
|
{ |
144
|
|
|
$this->street_type = $streetType; |
145
|
|
|
|
146
|
|
|
return $this; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* {@inheritdoc} |
151
|
|
|
*/ |
152
|
|
|
public function toArray($object = null) |
153
|
|
|
{ |
154
|
|
|
return $object ? get_object_vars($object) : get_object_vars($this); |
155
|
|
|
} |
156
|
|
|
} |
157
|
|
|
|
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.