-
Notifications
You must be signed in to change notification settings - Fork 24
/
PaymentResponseCardAccount.php
581 lines (518 loc) · 13.6 KB
/
PaymentResponseCardAccount.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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
<?php
/**
* PHP SDK for Unlimit API v3. All rights reserved.
*/
namespace Cardpay\model;
use \ArrayAccess;
use \Cardpay\ObjectSerializer;
class PaymentResponseCardAccount implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'PaymentResponseCardAccount';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'acct_type' => 'string',
'card_brand' => 'string',
'card_type' => 'string',
'expiration' => 'string',
'holder' => 'string',
'issuer' => 'string',
'issuing_country_code' => 'string',
'masked_pan' => 'string',
'token' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
'acct_type' => null,
'card_brand' => null,
'card_type' => null,
'expiration' => null,
'holder' => null,
'issuer' => null,
'issuing_country_code' => null,
'masked_pan' => null,
'token' => null
];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerTypes()
{
return self::$swaggerTypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function swaggerFormats()
{
return self::$swaggerFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'acct_type' => 'acct_type',
'card_brand' => 'card_brand',
'card_type' => 'card_type',
'expiration' => 'expiration',
'holder' => 'holder',
'issuer' => 'issuer',
'issuing_country_code' => 'issuing_country_code',
'masked_pan' => 'masked_pan',
'token' => 'token'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'acct_type' => 'setAcctType',
'card_brand' => 'setCardBrand',
'card_type' => 'setCardType',
'expiration' => 'setExpiration',
'holder' => 'setHolder',
'issuer' => 'setIssuer',
'issuing_country_code' => 'setIssuingCountryCode',
'masked_pan' => 'setMaskedPan',
'token' => 'setToken'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'acct_type' => 'getAcctType',
'card_brand' => 'getCardBrand',
'card_type' => 'getCardType',
'expiration' => 'getExpiration',
'holder' => 'getHolder',
'issuer' => 'getIssuer',
'issuing_country_code' => 'getIssuingCountryCode',
'masked_pan' => 'getMaskedPan',
'token' => 'getToken'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$swaggerModelName;
}
const ACCT_TYPE__01 = '01';
const ACCT_TYPE__02 = '02';
const ACCT_TYPE__03 = '03';
const CARD_TYPE_DEBIT = 'DEBIT';
const CARD_TYPE_CREDIT = 'CREDIT';
const CARD_TYPE_PREPAID = 'PREPAID';
const CARD_TYPE_OTHER = 'OTHER';
const CARD_TYPE_UNKNOWN = 'UNKNOWN';
/**
* Gets allowable values of the enum
*
* @return string[]
*/
public function getAcctTypeAllowableValues()
{
return [
self::ACCT_TYPE__01,
self::ACCT_TYPE__02,
self::ACCT_TYPE__03,
];
}
/**
* Gets allowable values of the enum
*
* @return string[]
*/
public function getCardTypeAllowableValues()
{
return [
self::CARD_TYPE_DEBIT,
self::CARD_TYPE_CREDIT,
self::CARD_TYPE_PREPAID,
self::CARD_TYPE_OTHER,
self::CARD_TYPE_UNKNOWN,
];
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[] $data Associated array of property values
* initializing the model
*/
public function __construct(array $data = null)
{
$this->container['acct_type'] = isset($data['acct_type']) ? $data['acct_type'] : null;
$this->container['card_brand'] = isset($data['card_brand']) ? $data['card_brand'] : null;
$this->container['card_type'] = isset($data['card_type']) ? $data['card_type'] : null;
$this->container['expiration'] = isset($data['expiration']) ? $data['expiration'] : null;
$this->container['holder'] = isset($data['holder']) ? $data['holder'] : null;
$this->container['issuer'] = isset($data['issuer']) ? $data['issuer'] : null;
$this->container['issuing_country_code'] = isset($data['issuing_country_code']) ? $data['issuing_country_code'] : null;
$this->container['masked_pan'] = isset($data['masked_pan']) ? $data['masked_pan'] : null;
$this->container['token'] = isset($data['token']) ? $data['token'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
$allowedValues = $this->getAcctTypeAllowableValues();
if (!is_null($this->container['acct_type']) && !in_array($this->container['acct_type'], $allowedValues, true)) {
$invalidProperties[] = sprintf(
"invalid value for 'acct_type', must be one of '%s'",
implode("', '", $allowedValues)
);
}
$allowedValues = $this->getCardTypeAllowableValues();
if (!is_null($this->container['card_type']) && !in_array($this->container['card_type'], $allowedValues, true)) {
$invalidProperties[] = sprintf(
"invalid value for 'card_type', must be one of '%s'",
implode("', '", $allowedValues)
);
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets acct_type
*
* @return string
*/
public function getAcctType()
{
return $this->container['acct_type'];
}
/**
* Sets acct_type
*
* @param string $acct_type acct_type
*
* @return $this
*/
public function setAcctType($acct_type)
{
$allowedValues = $this->getAcctTypeAllowableValues();
if (!is_null($acct_type) && !in_array($acct_type, $allowedValues, true)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'acct_type', must be one of '%s'",
implode("', '", $allowedValues)
)
);
}
$this->container['acct_type'] = $acct_type;
return $this;
}
/**
* Gets card_brand
*
* @return string
*/
public function getCardBrand()
{
return $this->container['card_brand'];
}
/**
* Sets card_brand
*
* @param string $card_brand Card brand
*
* @return $this
*/
public function setCardBrand($card_brand)
{
$this->container['card_brand'] = $card_brand;
return $this;
}
/**
* Gets card_type
*
* @return string
*/
public function getCardType()
{
return $this->container['card_type'];
}
/**
* Sets card_type
*
* @param string $card_type Card type
*
* @return $this
*/
public function setCardType($card_type)
{
$allowedValues = $this->getCardTypeAllowableValues();
if (!is_null($card_type) && !in_array($card_type, $allowedValues, true)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'card_type', must be one of '%s'",
implode("', '", $allowedValues)
)
);
}
$this->container['card_type'] = $card_type;
return $this;
}
/**
* Gets expiration
*
* @return string
*/
public function getExpiration()
{
return $this->container['expiration'];
}
/**
* Sets expiration
*
* @param string $expiration Customer’s card expiration date. Format: `mm/yyyy`
*
* @return $this
*/
public function setExpiration($expiration)
{
$this->container['expiration'] = $expiration;
return $this;
}
/**
* Gets holder
*
* @return string
*/
public function getHolder()
{
return $this->container['holder'];
}
/**
* Sets holder
*
* @param string $holder Customer's cardholder name. Any valid cardholder name. Not present by default, ask CardPay manager to enable it if needed.
*
* @return $this
*/
public function setHolder($holder)
{
$this->container['holder'] = $holder;
return $this;
}
/**
* Gets issuer
*
* @return string
*/
public function getIssuer()
{
return $this->container['issuer'];
}
/**
* Sets issuer
*
* @param string $issuer Card issuer
*
* @return $this
*/
public function setIssuer($issuer)
{
$this->container['issuer'] = $issuer;
return $this;
}
/**
* Gets issuing_country_code
*
* @return string
*/
public function getIssuingCountryCode()
{
return $this->container['issuing_country_code'];
}
/**
* Sets issuing_country_code
*
* @param string $issuing_country_code Country code of issuing card country
*
* @return $this
*/
public function setIssuingCountryCode($issuing_country_code)
{
$this->container['issuing_country_code'] = $issuing_country_code;
return $this;
}
/**
* Gets masked_pan
*
* @return string
*/
public function getMaskedPan()
{
return $this->container['masked_pan'];
}
/**
* Sets masked_pan
*
* @param string $masked_pan Masked PAN (shows first 6 digits and 4 last digits)
*
* @return $this
*/
public function setMaskedPan($masked_pan)
{
$this->container['masked_pan'] = $masked_pan;
return $this;
}
/**
* Gets token
*
* @return string
*/
public function getToken()
{
return $this->container['token'];
}
/**
* Sets token
*
* @param string $token Generated card token value. Token can be returned only for successful transactions (not for declined transactions). For payment: PaymentResponsePaymentData, for recurring: RecurringResponseRecurringData.
*
* @return $this
*/
public function setToken($token)
{
$this->container['token'] = $token;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return isset($this->container[$offset]) ? $this->container[$offset] : null;
}
/**
* Sets value based on offset.
*
* @param integer $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}