Skip to content

Commit e17742b

Browse files
committed
card details full bank name fix
1 parent 17032fc commit e17742b

4 files changed

Lines changed: 45 additions & 2 deletions

File tree

src/CardDetails.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class CardDetails implements CardDetailsInterface
4141
/** @var string Банк, выпустивший карту */
4242
private string $cardIssuerBank;
4343

44+
/** @var string Банк, выпустивший карту (полное наименование) */
45+
private string $cardIssuerBankFullName;
46+
4447
/** Protobuf generation Trait */
4548
use ProtobufSerializable;
4649

@@ -69,6 +72,7 @@ public function getExpiryMonth(): ?int
6972
public function setExpiryMonth(int $expiryMonth): self
7073
{
7174
$this->expiryMonth = $expiryMonth;
75+
7276
return $this;
7377
}
7478

@@ -84,8 +88,8 @@ public function setYear(int $year): self
8488
if ( $year< 1900) {
8589
throw new PaymentException('Проверьте год выпуска карты');
8690
}
87-
8891
$this->year = $year;
92+
8993
return $this;
9094
}
9195

@@ -99,6 +103,7 @@ public function getExpiryYear(): ?int
99103
public function setExpiryYear(int $expiryYear): self
100104
{
101105
$this->expiryYear = $expiryYear;
106+
102107
return $this;
103108
}
104109

@@ -112,6 +117,7 @@ public function getCvv(): ?string
112117
public function setCvv(string $cvv): self
113118
{
114119
$this->cvv = $cvv;
120+
115121
return $this;
116122
}
117123

@@ -125,6 +131,7 @@ public function getOwner(): ?string
125131
public function setOwner(string $owner): self
126132
{
127133
$this->owner = $owner;
134+
128135
return $this;
129136
}
130137

@@ -138,6 +145,7 @@ public function getTimeSpentTypingNumber(): ?int
138145
public function setTimeSpentTypingNumber(int $timeSpentTypingNumber): self
139146
{
140147
$this->timeSpentTypingNumber = $timeSpentTypingNumber;
148+
141149
return $this;
142150
}
143151

@@ -151,6 +159,7 @@ public function getTimeSpentTypingOwner(): ?int
151159
public function setTimeSpentTypingOwner(int $timeSpentTypingOwner): self
152160
{
153161
$this->timeSpentTypingOwner = $timeSpentTypingOwner;
162+
154163
return $this;
155164
}
156165

@@ -164,6 +173,7 @@ public function getBin(): ?int
164173
public function setBin(int $bin): self
165174
{
166175
$this->bin = $bin;
176+
167177
return $this;
168178
}
169179

@@ -177,6 +187,7 @@ public function getPan(): ?string
177187
public function setPan(string $pan): self
178188
{
179189
$this->pan = $pan;
190+
180191
return $this;
181192
}
182193

@@ -190,6 +201,7 @@ public function getType(): ?string
190201
public function setType(string $type): self
191202
{
192203
$this->type = $type;
204+
193205
return $this;
194206
}
195207

@@ -203,6 +215,21 @@ public function getCardIssuerBank(): ?string
203215
public function setCardIssuerBank(string $cardIssuerBank): self
204216
{
205217
$this->cardIssuerBank = $cardIssuerBank;
218+
219+
return $this;
220+
}
221+
222+
/** @inheritDoc */
223+
public function getCardIssuerBankFullName(): ?string
224+
{
225+
return $this->cardIssuerBankFullName ?? null;
226+
}
227+
228+
/** @inheritDoc */
229+
public function setCardIssuerBankFullName(string $cardIssuerBankFullName): CardDetails
230+
{
231+
$this->cardIssuerBankFullName = $cardIssuerBankFullName;
232+
206233
return $this;
207234
}
208235

src/CardDetailsInterface.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,19 @@ public function setCardIssuerBank(string $cardIssuerBank) : self;
138138
*/
139139
public function getCardIssuerBank() : ?string;
140140

141+
/**
142+
* Установить Полное наименование Банка, выпустившего карту
143+
* @param string $cardIssuerBankFullName
144+
* @return CardDetails
145+
*/
146+
public function setCardIssuerBankFullName(string $cardIssuerBankFullName): CardDetails;
147+
148+
/**
149+
* Получить Полное наименование Банка, выпустившего карту
150+
* @return string|null Полное наименование Банка, выпустившего карту
151+
*/
152+
public function getCardIssuerBankFullName(): ?string;
153+
141154
/**
142155
* Получить Год Карты
143156
* @return int|null Год Карты

src/Examples/start.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@
1616
* Убедитесь, что эти адреса разрешены в Firewall вашего приложения
1717
*/
1818
$merchant = new Merchant('gitttest', 'vk0!K4(~9)1d69@0p4&N');
19-
//$merchant = new Merchant('CLD_FUL', 'SECRET_KEY');

src/Webhook.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ public function catchJsonRequest(): self
9090
$cardDetails->setCardIssuerBank($request['paymentResult']['cardDetails']['cardIssuerBank']);
9191
}
9292

93+
if (!empty($request['paymentResult']['cardDetails']['cardIssuerBankFullName'])) {
94+
$cardDetails->setCardIssuerBankFullName($request['paymentResult']['cardDetails']['cardIssuerBankFullName']);
95+
}
96+
9397
$this->paymentResult = new PaymentResult;
9498
$this->paymentResult->setCardDetails($cardDetails);
9599

0 commit comments

Comments
 (0)