/
Transaction.php
371 lines (331 loc) · 6.61 KB
/
Transaction.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
<?php
/**
* Transaction.
*
* @author Pronamic <info@pronamic.eu>
* @copyright 2005-2021 Pronamic
* @license GPL-3.0-or-later
* @package Pronamic\WordPress\Pay
*/
namespace Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3;
/**
* Title: Transaction
* Description:
* Copyright: 2005-2021 Pronamic
* Company: Pronamic
*
* @author Remco Tolsma
* @version 2.0.0
*/
class Transaction {
/**
* Transaction ID
*
* @var string|null
*/
private $id;
/**
* Purchase ID
*
* @var string|null
*/
private $purchase_id;
/**
* Amount
*
* @var string|null
*/
private $amount;
/**
* Currency
*
* @var string|null
*/
private $currency;
/**
* Timeframe during which the transaction is allowed to take
* place. Notation PnYnMnDTnHnMnS, where every n
* indicates the number of years, months, days, hours, minutes
* and seconds respectively. E.g. PT1H indicates an expiration
* period of 1 hour. PT3M30S indicates a period of 3 and a half
* minutes. Maximum allowed is PT1H; minimum allowed is
* PT1M.
*
* @var string|null
*/
private $expiration_period;
/**
* Language
*
* @var string|null
*/
private $language;
/**
* Description
*
* @var string|null
*/
private $description;
/**
* Mandatory code to identify the customer when he/she is
* redirected back to the merchantReturnURL
*
* @var string|null
*/
private $entrance_code;
/**
* The status of this transaction
*
* @var string|null
*/
private $status;
/**
* The consumer name
*
* @var string|null
*/
private $consumer_name;
/**
* Consumer IBAN
*
* @var string|null
*/
private $consumer_iban;
/**
* Consumer BIC
*
* @var string|null
*/
private $consumer_bic;
/**
* Constructs and initializes an transaction
*
* @return void
*/
public function __construct() {
}
/**
* Get the ID of this transaction
*
* @return string|null
*/
public function get_id() {
return $this->id;
}
/**
* Set the ID of this transaction
*
* @param string|null $id Transaction ID.
* @return void
*/
public function set_id( $id ) {
$this->id = $id;
}
/**
* Get the purchase ID of this transaction
*
* The purchase number according to the online shop’s system
*
* @return string|null
*/
public function get_purchase_id() {
return $this->purchase_id;
}
/**
* Set the purchase id of this transaction
*
* The purchase number according to the online shop’s system
*
* @param string|null $id Purchase ID.
* @return void
*/
public function set_purchase_id( $id ) {
$this->purchase_id = $id;
}
/**
* Get the amount of this transaction
*
* @return string|null
*/
public function get_amount() {
return $this->amount;
}
/**
* Set the amount of this transaction
*
* @param string|null $amount Amount.
* @return void
*/
public function set_amount( $amount ) {
$this->amount = $amount;
}
/**
* Get the currency of this transaction
*
* @return string|null
*/
public function get_currency() {
return $this->currency;
}
/**
* Set the currency of this transaction
*
* @param string|null $currency Currency.
* @return void
*/
public function set_currency( $currency ) {
$this->currency = $currency;
}
/**
* Get the expiration period of this transaction
*
* @return string|null
*/
public function get_expiration_period() {
return $this->expiration_period;
}
/**
* Set the expiration period of this transaction
*
* @param string|null $expiration_period Expiration period in date interval specification notation (e.g. `PT30M`).
* @return void
*/
public function set_expiration_period( $expiration_period ) {
$this->expiration_period = $expiration_period;
}
/**
* Get the language of this transaction
*
* @return string|null
*/
public function get_language() {
return $this->language;
}
/**
* Set the language of this transaction
*
* @param string|null $language Language.
* @return void
*/
public function set_language( $language ) {
$this->language = $language;
}
/**
* Get the description of this transaction
*
* @return string|null
*/
public function get_description() {
return $this->description;
}
/**
* Set the description of this transaction
* AN..max32 (AN = Alphanumerical, free text)
*
* @param string|null $description Description.
* @return void
*/
public function set_description( $description ) {
if ( null !== $description ) {
$description = substr( $description, 0, 32 );
}
$this->description = $description;
}
/**
* Get the entrance code of this transaction
*
* A code determined by the online shop with which the purchase can be
* authenticated upon redirection to the online shop (see section 4.2.2
* for details).
*
* @return string|null
*/
public function get_entrance_code() {
return $this->entrance_code;
}
/**
* Set the entrance code
* ANS..max40 (ANS = Strictly alphanumerical (letters and numbers only))
*
* A code determined by the online shop with which the purchase can be
* authenticated upon redirection to the online shop (see section 4.2.2
* for details).
*
* @param string|null $entrance_code Entrance code.
* @return void
*/
public function set_entrance_code( $entrance_code ) {
if ( null !== $entrance_code ) {
$entrance_code = substr( $entrance_code, 0, 40 );
}
$this->entrance_code = $entrance_code;
}
/**
* Get the status of this transaction
*
* @return string|null
*/
public function get_status() {
return $this->status;
}
/**
* Set the status
*
* @param string|null $status Status.
* @return void
*/
public function set_status( $status ) {
$this->status = $status;
}
/**
* Get the consumer name
*
* @return string|null
*/
public function get_consumer_name() {
return $this->consumer_name;
}
/**
* Set the consumer name
*
* @param string|null $name Consumer name.
* @return void
*/
public function set_consumer_name( $name ) {
$this->consumer_name = $name;
}
/**
* Get the consumer IBAN number
*
* @return string|null
*/
public function get_consumer_iban() {
return $this->consumer_iban;
}
/**
* Set the consumer IBAN number
*
* @param string|null $iban Consumer IBAN.
* @return void
*/
public function set_consumer_iban( $iban ) {
$this->consumer_iban = $iban;
}
/**
* Get the consumer BIC number
*
* @return string|null
*/
public function get_consumer_bic() {
return $this->consumer_bic;
}
/**
* Set the consumer BIC number
*
* @param string|null $bic Consumer BIC.
* @return void
*/
public function set_consumer_bic( $bic ) {
$this->consumer_bic = $bic;
}
}