Skip to content

Commit 6a82f95

Browse files
committed
Merge branch 'FIX__webhookNonRequiredFields' into 'main'
Fix webhook non required fields See merge request ypmn-public/php-api-client!25
2 parents d1ef171 + 286b274 commit 6a82f95

15 files changed

+416
-199
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ composer require yourpayments/php-api-client
1313
```shell
1414
composer update yourpayments/php-api-client
1515
```
16-
(если на вашем проекте нет composer, слонируйте или скачайте, а затем подключите ([require](https://www.php.net/manual/ru/function.require.php)) файлы этого репозитория)
16+
(если на вашем проекте нет composer, склонируйте или скачайте, а затем подключите файлы этого репозитория ([файл автозагрузки](src/Examples/autoload.php)))
1717

1818
## Запуск в контейнере docker
1919
Создайте и запустите docker контейнер следующей командой:

src/Billing.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ class Billing implements BillingInterface
4747
private ?IdentityDocumentInterface $identityDocument = null;
4848

4949
/** @inheritDoc */
50-
public function getFirstName(): string
50+
public function getFirstName(): ?string
5151
{
52-
return $this->firstName;
52+
return $this->firstName ?? null;
5353
}
5454

5555
/** @inheritDoc */
@@ -60,9 +60,9 @@ public function setFirstName(string $firstName): self
6060
}
6161

6262
/** @inheritDoc */
63-
public function getLastName(): string
63+
public function getLastName(): ?string
6464
{
65-
return $this->lastName;
65+
return $this->lastName ?? null;
6666
}
6767

6868
/** @inheritDoc */
@@ -75,7 +75,7 @@ public function setLastName(string $lastName): self
7575
/** @inheritDoc */
7676
public function getEmail(): ?string
7777
{
78-
return $this->email;
78+
return $this->email ?? null;
7979
}
8080

8181
/** @inheritDoc */
@@ -218,7 +218,7 @@ public function getIdentityDocument(): ?IdentityDocumentInterface
218218
}
219219

220220
/** @inheritdoc */
221-
public function getType(): string
221+
public function getType(): ?string
222222
{
223223
return $this->type;
224224
}

src/BillingInterface.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public function setFirstName(string $firstName) : self;
1313

1414
/**
1515
* Получить Имя
16-
* @return string
16+
* @return string|null
1717
*/
18-
public function getFirstName() : string;
18+
public function getFirstName() : ?string;
1919

2020
/**
2121
* Установить Фамилия
@@ -26,9 +26,9 @@ public function setLastName(string $lastName) : self;
2626

2727
/**
2828
* Получить Фамилия
29-
* @return string
29+
* @return string|null
3030
*/
31-
public function getLastName() : string;
31+
public function getLastName() : ?string;
3232

3333
/**
3434
* Установить Email
@@ -52,7 +52,7 @@ public function setPhone(string $phone) : self;
5252

5353
/**
5454
* Получить Номер Телефона
55-
* @return string
55+
* @return string|null
5656
*/
5757
public function getPhone() : ?string;
5858

@@ -65,7 +65,7 @@ public function setCountryCode(string $countryCode) : self;
6565

6666
/**
6767
* Получить Код Страны
68-
* @return string
68+
* @return string|null
6969
*/
7070
public function getCountryCode() : ?string;
7171

@@ -78,7 +78,7 @@ public function setCity(string $city) : self;
7878

7979
/**
8080
* Получить Город
81-
* @return string
81+
* @return string|null
8282
*/
8383
public function getCity() : ?string;
8484

@@ -91,7 +91,7 @@ public function setState(string $state) : self;
9191

9292
/**
9393
* Получить Регион
94-
* @return string
94+
* @return string|null
9595
*/
9696
public function getState() : ?string;
9797

@@ -176,9 +176,9 @@ public function getIdentityDocument(): ?IdentityDocumentInterface;
176176

177177
/**
178178
* Получить тип биллинга
179-
* @return string
179+
* @return string|null
180180
*/
181-
public function getType(): string;
181+
public function getType(): ?string;
182182

183183
/**
184184
* Установить тип биллинга

src/CardDetails.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CardDetails implements CardDetailsInterface
3838
private string $cardIssuerBank;
3939

4040
/** @inheritDoc */
41-
public function getNumber(): string
41+
public function getNumber(): ?string
4242
{
4343
return $this->number;
4444
}
@@ -53,9 +53,9 @@ public function setNumber(string $number): self
5353
}
5454

5555
/** @inheritDoc */
56-
public function getExpiryMonth(): int
56+
public function getExpiryMonth(): ?int
5757
{
58-
return $this->expiryMonth;
58+
return $this->expiryMonth ?? null;
5959
}
6060

6161
/** @inheritDoc */
@@ -66,9 +66,9 @@ public function setExpiryMonth(int $expiryMonth): self
6666
}
6767

6868
/** @inheritDoc */
69-
public function getYear(): int
69+
public function getYear(): ?int
7070
{
71-
return $this->year;
71+
return $this->year ?? null;
7272
}
7373

7474
/** @inheritDoc */
@@ -83,9 +83,9 @@ public function setYear(int $year): self
8383
}
8484

8585
/** @inheritDoc */
86-
public function getExpiryYear(): int
86+
public function getExpiryYear(): ?int
8787
{
88-
return $this->expiryYear;
88+
return $this->expiryYear ?? null;
8989
}
9090

9191
/** @inheritDoc */
@@ -96,9 +96,9 @@ public function setExpiryYear(int $expiryYear): self
9696
}
9797

9898
/** @inheritDoc */
99-
public function getCvv(): string
99+
public function getCvv(): ?string
100100
{
101-
return $this->cvv;
101+
return $this->cvv ?? null;
102102
}
103103

104104
/** @inheritDoc */
@@ -109,9 +109,9 @@ public function setCvv(string $cvv): self
109109
}
110110

111111
/** @inheritDoc */
112-
public function getOwner(): string
112+
public function getOwner(): ?string
113113
{
114-
return $this->owner;
114+
return $this->owner ?? null;
115115
}
116116

117117
/** @inheritDoc */
@@ -122,9 +122,9 @@ public function setOwner(string $owner): self
122122
}
123123

124124
/** @inheritDoc */
125-
public function getTimeSpentTypingNumber(): int
125+
public function getTimeSpentTypingNumber(): ?int
126126
{
127-
return $this->timeSpentTypingNumber;
127+
return $this->timeSpentTypingNumber ?? null;
128128
}
129129

130130
/** @inheritDoc */
@@ -135,9 +135,9 @@ public function setTimeSpentTypingNumber(int $timeSpentTypingNumber): self
135135
}
136136

137137
/** @inheritDoc */
138-
public function getTimeSpentTypingOwner(): int
138+
public function getTimeSpentTypingOwner(): ?int
139139
{
140-
return $this->timeSpentTypingOwner;
140+
return $this->timeSpentTypingOwner ?? null;
141141
}
142142

143143
/** @inheritDoc */
@@ -148,9 +148,9 @@ public function setTimeSpentTypingOwner(int $timeSpentTypingOwner): self
148148
}
149149

150150
/** @inheritDoc */
151-
public function getBin(): int
151+
public function getBin(): ?int
152152
{
153-
return $this->bin;
153+
return $this->bin ?? null;
154154
}
155155

156156
/** @inheritDoc */
@@ -161,9 +161,9 @@ public function setBin(int $bin): self
161161
}
162162

163163
/** @inheritDoc */
164-
public function getPan(): string
164+
public function getPan(): ?string
165165
{
166-
return $this->pan;
166+
return $this->pan ?? null;
167167
}
168168

169169
/** @inheritDoc */
@@ -174,9 +174,9 @@ public function setPan(string $pan): self
174174
}
175175

176176
/** @inheritDoc */
177-
public function getType(): string
177+
public function getType(): ?string
178178
{
179-
return $this->type;
179+
return $this->type ?? null;
180180
}
181181

182182
/** @inheritDoc */
@@ -187,9 +187,9 @@ public function setType(string $type): self
187187
}
188188

189189
/** @inheritDoc */
190-
public function getCardIssuerBank(): string
190+
public function getCardIssuerBank(): ?string
191191
{
192-
return $this->cardIssuerBank;
192+
return $this->cardIssuerBank ?? null;
193193
}
194194

195195
/** @inheritDoc */

src/CardDetailsInterface.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public function setExpiryMonth(int $expiryMonth) : self;
1414

1515
/**
1616
* Получить Месяц прекращения действия Карты
17-
* @return int
17+
* @return int|null
1818
*/
19-
public function getExpiryMonth() : int;
19+
public function getExpiryMonth() : ?int;
2020

2121
/**
2222
* Установить Год прекращения действия Карты
@@ -28,9 +28,9 @@ public function setExpiryYear(int $expiryYear) : self;
2828

2929
/**
3030
* Получить Год прекращения действия Карты
31-
* @return int Год прекращения действия Карты
31+
* @return int|null Год прекращения действия Карты
3232
*/
33-
public function getExpiryYear() : int;
33+
public function getExpiryYear() : ?int;
3434

3535
/**
3636
* Установить CVV Карты
@@ -41,9 +41,9 @@ public function setCvv(string $cvv) : self;
4141

4242
/**
4343
* Получить CVV Карты
44-
* @return string CVV Карты
44+
* @return string|null CVV Карты
4545
*/
46-
public function getCvv() : string;
46+
public function getCvv() : ?string;
4747

4848
/**
4949
* Установить Имя Владельца Карты
@@ -54,9 +54,9 @@ public function setOwner(string $owner) : self;
5454

5555
/**
5656
* Получить Имя Владельца Карты
57-
* @return string Имя Владельца Карты
57+
* @return string|null Имя Владельца Карты
5858
*/
59-
public function getOwner() : string;
59+
public function getOwner() : ?string;
6060

6161
/**
6262
* Установить Время набора Номера Карты (сек)
@@ -67,9 +67,9 @@ public function setTimeSpentTypingNumber(int $timeSpentTypingNumber) : self;
6767

6868
/**
6969
* Получить Время набора номера Карты (сек)
70-
* @return int Время набора Номера Карты (сек)
70+
* @return int|null Время набора Номера Карты (сек)
7171
*/
72-
public function getTimeSpentTypingNumber() : int;
72+
public function getTimeSpentTypingNumber() : ?int;
7373

7474
/**
7575
* Установить Время набора Имени Владельца Карты (сек)
@@ -80,9 +80,9 @@ public function setTimeSpentTypingOwner(int $timeSpentTypingOwner) : self;
8080

8181
/**
8282
* Получить Время набора Имени Владельца Карты
83-
* @return int Время набора Имени Владельца Карты (сек)
83+
* @return int|null Время набора Имени Владельца Карты (сек)
8484
*/
85-
public function getTimeSpentTypingOwner() : int;
85+
public function getTimeSpentTypingOwner() : ?int;
8686

8787
/**
8888
* Установить BIN (Bank Identification Number)
@@ -93,9 +93,9 @@ public function setBin(int $bin) : self;
9393

9494
/**
9595
* Получить BIN (Bank Identification Number)
96-
* @return int BIN (Bank Identification Number)
96+
* @return int|null BIN (Bank Identification Number)
9797
*/
98-
public function getBin() : int;
98+
public function getBin() : ?int;
9999

100100
/**
101101
* Установить PAN (Permanent Account Number)
@@ -106,9 +106,9 @@ public function setPan(string $pan) : self;
106106

107107
/**
108108
* Получить PAN (Permanent Account Number)
109-
* @return string PAN (Permanent Account Number)
109+
* @return string|null PAN (Permanent Account Number)
110110
*/
111-
public function getPan() : string;
111+
public function getPan() : ?string;
112112

113113
/**
114114
* Установить Тип Карты (например, Visa, MIR)
@@ -119,9 +119,9 @@ public function setType(string $type) : self;
119119

120120
/**
121121
* Получить Тип Карты (например, Visa, MIR)
122-
* @return string Тип Карты
122+
* @return string|null Тип Карты
123123
*/
124-
public function getType() : string;
124+
public function getType() : ?string;
125125

126126
/**
127127
* Установить Банк, выпустивший карту
@@ -132,15 +132,15 @@ public function setCardIssuerBank(string $cardIssuerBank) : self;
132132

133133
/**
134134
* Получить Банк, выпустивший карту
135-
* @return string Банк, выпустивший карту
135+
* @return string|null Банк, выпустивший карту
136136
*/
137-
public function getCardIssuerBank() : string;
137+
public function getCardIssuerBank() : ?string;
138138

139139
/**
140140
* Получить Год Карты
141-
* @return int Год Карты
141+
* @return int|null Год Карты
142142
*/
143-
public function getYear(): int;
143+
public function getYear(): ?int;
144144

145145
/**
146146
*

0 commit comments

Comments
 (0)