1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This software may be modified and distributed under the terms |
7
|
|
|
* of the MIT license. See the LICENSE file for details. |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
namespace Shapin\Stripe\Model\BankAccount; |
11
|
|
|
|
12
|
|
|
use Money\Currency; |
13
|
|
|
use Shapin\Stripe\Model\ContainsMetadata; |
14
|
|
|
use Shapin\Stripe\Model\CreatableFromArray; |
15
|
|
|
use Shapin\Stripe\Model\MetadataCollection; |
16
|
|
|
use Shapin\Stripe\Model\MetadataTrait; |
17
|
|
|
|
18
|
|
|
final class BankAccount implements CreatableFromArray, ContainsMetadata |
19
|
|
|
{ |
20
|
|
|
use MetadataTrait; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var string |
24
|
|
|
*/ |
25
|
|
|
private $id; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var string |
29
|
|
|
*/ |
30
|
|
|
private $account; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var string |
34
|
|
|
*/ |
35
|
|
|
private $accountHolderName; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var string |
39
|
|
|
*/ |
40
|
|
|
private $accountHolderType; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var string |
44
|
|
|
*/ |
45
|
|
|
private $bankName; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var string |
49
|
|
|
*/ |
50
|
|
|
private $country; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var Currency |
54
|
|
|
*/ |
55
|
|
|
private $currency; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var ?string |
59
|
|
|
*/ |
60
|
|
|
private $customer; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var string |
64
|
|
|
*/ |
65
|
|
|
private $fingerprint; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @var string |
69
|
|
|
*/ |
70
|
|
|
private $lastFour; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @var string |
74
|
|
|
*/ |
75
|
|
|
private $routingNumber; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @var string |
79
|
|
|
*/ |
80
|
|
|
private $status; |
81
|
|
|
|
82
|
7 |
|
public static function createFromArray(array $data): self |
83
|
|
|
{ |
84
|
7 |
|
$model = new self(); |
85
|
7 |
|
$model->id = $data['id']; |
86
|
7 |
|
$model->account = $data['account'] ?? null; |
87
|
7 |
|
$model->accountHolderName = $data['account_holder_name']; |
88
|
7 |
|
$model->accountHolderType = $data['account_holder_type']; |
89
|
7 |
|
$model->bankName = $data['bank_name']; |
90
|
7 |
|
$model->country = $data['country']; |
91
|
7 |
|
$model->currency = new Currency(strtoupper($data['currency'])); |
92
|
7 |
|
$model->customer = $data['customer'] ?? null; |
93
|
7 |
|
$model->fingerprint = $data['fingerprint']; |
94
|
7 |
|
$model->lastFour = $data['last4']; |
95
|
7 |
|
$model->metadata = MetadataCollection::createFromArray($data['metadata']); |
|
|
|
|
96
|
7 |
|
$model->routingNumber = $data['routing_number']; |
97
|
7 |
|
$model->status = $data['status']; |
98
|
|
|
|
99
|
7 |
|
return $model; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
public function getId(): string |
103
|
|
|
{ |
104
|
|
|
return $this->id; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
public function getAccount(): ?string |
108
|
|
|
{ |
109
|
|
|
return $this->account; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
public function getAccountHolderName(): string |
113
|
|
|
{ |
114
|
|
|
return $this->accountHolderName; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
public function getAccountHolderType(): string |
118
|
|
|
{ |
119
|
|
|
return $this->accountHolderType; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
public function getBankName(): string |
123
|
|
|
{ |
124
|
|
|
return $this->bankName; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
public function getCountry(): string |
128
|
|
|
{ |
129
|
|
|
return $this->country; |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
public function getCurrency(): Currency |
133
|
|
|
{ |
134
|
|
|
return $this->currency; |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
public function getCustomer(): ?string |
138
|
|
|
{ |
139
|
|
|
return $this->customer; |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
public function getFingerprint(): string |
143
|
|
|
{ |
144
|
|
|
return $this->fingerprint; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
public function getLastFour(): string |
148
|
|
|
{ |
149
|
|
|
return $this->lastFour; |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
public function getRoutingNumber(): string |
153
|
|
|
{ |
154
|
|
|
return $this->routingNumber; |
155
|
|
|
} |
156
|
|
|
|
157
|
|
|
public function getStatus(): string |
158
|
|
|
{ |
159
|
|
|
return $this->status; |
160
|
|
|
} |
161
|
|
|
} |
162
|
|
|
|
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..