-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasiccardrequest.php
More file actions
69 lines (57 loc) · 1.25 KB
/
basiccardrequest.php
File metadata and controls
69 lines (57 loc) · 1.25 KB
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
<?php
namespace SuperUserDev\PaymentAPI;
final class BasicCardRequest implements \JsonSerializable
{
const METHODS = [
'basic-card',
];
const NETWORKS = [
'visa',
'mastercard',
'amex',
'jcb',
'diners',
'discover',
'mir',
'unionpay',
];
const TYPES = [
'credit',
'debit',
];
private $_methods = [];
private $_networks = [];
private $_types = [];
public function __construct(
Array $supported_methods = self::METHODS,
Array $supported_networks = self::NETWORKS,
Array $supported_types = self::TYPES
)
{
$this->_methods = $supported_methods;
$this->_networks = $supported_networks;
$this->_types = $supported_types;
}
public function addSupportedMethod(String $method): Void
{
$this->_methods[] = $method;
}
public function addSupportedNetwork(String $network): Void
{
$this->_networks[] = $network;
}
public function addSupportedType(String $type): Void
{
$this->_types[] = $type;
}
public function jsonSerialize(): Array
{
return [
'supportedMethods' => join(', ', $this->_methods),
'data' => [
'supportedNetwords' => $this->_networks,
'supportedTypes' => $this->_types,
],
];
}
}