Skip to content

Commit 7dce245

Browse files
authored
fix buyersnapshot -> billingdetails (#10)
1 parent 3d861f0 commit 7dce245

16 files changed

+118
-827
lines changed

.openapi-generator/FILES

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ docs/Api/PaymentServiceDefinitionsApi.md
88
docs/Api/PaymentServicesApi.md
99
docs/Api/TransactionsApi.md
1010
docs/Model/Address.md
11-
docs/Model/AddressUpdate.md
1211
docs/Model/ApplePayRequest.md
1312
docs/Model/ApplePaySessionRequest.md
1413
docs/Model/BillingDetails.md
@@ -96,7 +95,6 @@ lib/Configuration.php
9695
lib/HeaderSelector.php
9796
lib/ObjectSerializer.php
9897
lib/model/Address.php
99-
lib/model/AddressUpdate.php
10098
lib/model/ApplePayRequest.php
10199
lib/model/ApplePaySessionRequest.php
102100
lib/model/BillingDetails.php

.openapi-generator/replace.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ var1="'billing_details' => 'BillingDetails',"
1919
rep1="'billing_details' => '\\\Gr4vy\\\model\\\BillingDetails',"
2020
sed -i '' "s/$var1/$rep1/g" lib/model/*.php
2121

22+
var1="'billing_details' => 'BillingDetails'"
23+
rep1="'billing_details' => '\\\Gr4vy\\\model\\\BillingDetails'"
24+
sed -i '' "s/$var1/$rep1/g" lib/model/*.php
25+
2226
var1="'address' => 'Address',"
2327
rep1="'address' => '\\\Gr4vy\\\model\\\Address',"
2428
sed -i '' "s/$var1/$rep1/g" lib/model/*.php

docs/Model/Address.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**city** | **string** | The city for the billing address. |
8-
**country** | **string** | The country for the billing address. |
9-
**postal_code** | **string** | The postal code or zip code for the billing address. |
10-
**state** | **string** | The state, county, or province for the billing address. |
7+
**city** | **string** | The city for the billing address. | [optional]
8+
**country** | **string** | The country for the billing address. | [optional]
9+
**postal_code** | **string** | The postal code or zip code for the billing address. | [optional]
10+
**state** | **string** | The state, county, or province for the billing address. | [optional]
1111
**state_code** | **string** | The code of state, county, or province for the billing address in ISO 3166-2 format. | [optional]
1212
**house_number_or_name** | **string** | The house number or name for the billing address. Not all payment services use this field but some do. | [optional]
13-
**line1** | **string** | The first line of the billing address. |
13+
**line1** | **string** | The first line of the billing address. | [optional]
1414
**line2** | **string** | The second line of the billing address. | [optional]
1515
**organization** | **string** | The optional name of the company or organisation to add to the billing address. | [optional]
1616

docs/Model/BillingDetails.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
88
**first_name** | **string** | The first name(s) or given name of the buyer. | [optional]
99
**last_name** | **string** | The last name, or family name, of the buyer. | [optional]
1010
**email_address** | **string** | The email address of the buyer. | [optional]
11-
**phone_number** | **string** | The phone number of the buyer. This expect the number in the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional]
11+
**phone_number** | **string** | The phone number of the buyer. This number is formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional]
1212
**address** | [**Address**](Address.md) | | [optional]
1313
**tax_id** | [**TaxId**](TaxId.md) | | [optional]
1414

docs/Model/BillingDetailsRequest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Name | Type | Description | Notes
77
**first_name** | **string** | The first name(s) or given name for the buyer. | [optional]
88
**last_name** | **string** | The last name, or family name, of the buyer. | [optional]
99
**email_address** | **string** | The email address for the buyer. | [optional]
10-
**phone_number** | **string** | The phone number to use for this request. This expect the number in the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional]
11-
**address** | [**Address**](Address.md) | | [optional]
10+
**phone_number** | **string** | The phone number for the buyer which should be formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional]
11+
**address** | [**Address**](Address.md) | The billing address for the buyer. | [optional]
1212
**tax_id** | [**TaxId**](TaxId.md) | | [optional]
1313

1414
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/BillingDetailsUpdateRequest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**address** | [**AddressUpdate**](AddressUpdate.md) | Address associated with the billing details. | [optional]
87
**first_name** | **string** | The first name(s) or given name for the buyer. | [optional]
98
**last_name** | **string** | The last name, or family name, of the buyer. | [optional]
109
**email_address** | **string** | The email address for the buyer. | [optional]
11-
**phone_number** | **string** | The phone number to use for this request. This expect the number in the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional]
10+
**phone_number** | **string** | The phone number for the buyer which should be formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional]
11+
**address** | [**Address**](Address.md) | The billing address for the buyer. | [optional]
1212
**tax_id** | [**TaxId**](TaxId.md) | | [optional]
1313

1414
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/BuyerUpdate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**billing_details** | [**BillingDetailsUpdateRequest**](BillingDetailsUpdateRequest.md) | The optional billing details to update a buyer. | [optional]
87
**external_identifier** | **string** | An external identifier that can be used to match the buyer against your own records. This value needs to be unique for all buyers. | [optional]
98
**display_name** | **string** | A unique name for this buyer which is used in the Gr4vy admin panel to give a buyer a human readable name. | [optional]
9+
**billing_details** | [**BillingDetailsUpdateRequest**](BillingDetailsUpdateRequest.md) | | [optional]
1010

1111
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/StatementDescriptor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
77
**name** | **string** | Reflects your doing business as (DBA) name. Other validations: 1. Contains only Latin characters. 2. Contain at least one letter 3. Does not contain any of the special characters `< > \\ ' \" *` 4. Supports: 1. Lower case: `a-z` 2. Upper case: `A-Z` 3. Numbers: `0-9` 4. Spaces: ` ` 5. Special characters: `. , _ - ? + /`. | [optional]
88
**description** | **string** | A short description about the purchase. Other validations: 1. Contains only Latin characters. 2. Contain at least one letter 3. Does not contain any of the special characters `< > \\ ' \" *` 4. Supports: 1. Lower case: `a-z` 2. Upper case: `A-Z` 3. Numbers: `0-9` 4. Spaces: ` ` 5. Special characters: `. , _ - ? + /`. | [optional]
99
**city** | **string** | City from which the charge originated. | [optional]
10-
**phone_number** | **string** | The value in the phone number field of a customer's statement. The phone number to use for this request. This expect the number in the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional]
10+
**phone_number** | **string** | The value in the phone number field of a customer's statement which should be formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional]
1111
**url** | **string** | The value in the URL/web address field of a customer's statement. | [optional]
1212

1313
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

lib/model/Address.php

Lines changed: 31 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* Address Class Doc Comment
3737
*
3838
* @category Class
39-
* @description Billing details associated to a buyer.
39+
* @description The billing address of the buyer.
4040
* @package Gr4vy
4141
* @author OpenAPI Generator team
4242
* @link https://openapi-generator.tech
@@ -240,47 +240,35 @@ public function listInvalidProperties()
240240
{
241241
$invalidProperties = [];
242242

243-
if ($this->container['city'] === null) {
244-
$invalidProperties[] = "'city' can't be null";
245-
}
246-
if ((mb_strlen($this->container['city']) > 100)) {
243+
if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) > 100)) {
247244
$invalidProperties[] = "invalid value for 'city', the character length must be smaller than or equal to 100.";
248245
}
249246

250-
if ((mb_strlen($this->container['city']) < 1)) {
247+
if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) < 1)) {
251248
$invalidProperties[] = "invalid value for 'city', the character length must be bigger than or equal to 1.";
252249
}
253250

254-
if ($this->container['country'] === null) {
255-
$invalidProperties[] = "'country' can't be null";
256-
}
257-
if ((mb_strlen($this->container['country']) > 2)) {
251+
if (!is_null($this->container['country']) && (mb_strlen($this->container['country']) > 2)) {
258252
$invalidProperties[] = "invalid value for 'country', the character length must be smaller than or equal to 2.";
259253
}
260254

261-
if ((mb_strlen($this->container['country']) < 1)) {
255+
if (!is_null($this->container['country']) && (mb_strlen($this->container['country']) < 1)) {
262256
$invalidProperties[] = "invalid value for 'country', the character length must be bigger than or equal to 1.";
263257
}
264258

265-
if ($this->container['postal_code'] === null) {
266-
$invalidProperties[] = "'postal_code' can't be null";
267-
}
268-
if ((mb_strlen($this->container['postal_code']) > 50)) {
259+
if (!is_null($this->container['postal_code']) && (mb_strlen($this->container['postal_code']) > 50)) {
269260
$invalidProperties[] = "invalid value for 'postal_code', the character length must be smaller than or equal to 50.";
270261
}
271262

272-
if ((mb_strlen($this->container['postal_code']) < 1)) {
263+
if (!is_null($this->container['postal_code']) && (mb_strlen($this->container['postal_code']) < 1)) {
273264
$invalidProperties[] = "invalid value for 'postal_code', the character length must be bigger than or equal to 1.";
274265
}
275266

276-
if ($this->container['state'] === null) {
277-
$invalidProperties[] = "'state' can't be null";
278-
}
279-
if ((mb_strlen($this->container['state']) > 255)) {
267+
if (!is_null($this->container['state']) && (mb_strlen($this->container['state']) > 255)) {
280268
$invalidProperties[] = "invalid value for 'state', the character length must be smaller than or equal to 255.";
281269
}
282270

283-
if ((mb_strlen($this->container['state']) < 1)) {
271+
if (!is_null($this->container['state']) && (mb_strlen($this->container['state']) < 1)) {
284272
$invalidProperties[] = "invalid value for 'state', the character length must be bigger than or equal to 1.";
285273
}
286274

@@ -300,14 +288,11 @@ public function listInvalidProperties()
300288
$invalidProperties[] = "invalid value for 'house_number_or_name', the character length must be bigger than or equal to 1.";
301289
}
302290

303-
if ($this->container['line1'] === null) {
304-
$invalidProperties[] = "'line1' can't be null";
305-
}
306-
if ((mb_strlen($this->container['line1']) > 255)) {
291+
if (!is_null($this->container['line1']) && (mb_strlen($this->container['line1']) > 255)) {
307292
$invalidProperties[] = "invalid value for 'line1', the character length must be smaller than or equal to 255.";
308293
}
309294

310-
if ((mb_strlen($this->container['line1']) < 1)) {
295+
if (!is_null($this->container['line1']) && (mb_strlen($this->container['line1']) < 1)) {
311296
$invalidProperties[] = "invalid value for 'line1', the character length must be bigger than or equal to 1.";
312297
}
313298

@@ -345,7 +330,7 @@ public function valid()
345330
/**
346331
* Gets city
347332
*
348-
* @return string
333+
* @return string|null
349334
*/
350335
public function getCity()
351336
{
@@ -355,16 +340,16 @@ public function getCity()
355340
/**
356341
* Sets city
357342
*
358-
* @param string $city The city for the billing address.
343+
* @param string|null $city The city for the billing address.
359344
*
360345
* @return self
361346
*/
362347
public function setCity($city)
363348
{
364-
if ((mb_strlen($city) > 100)) {
349+
if (!is_null($city) && (mb_strlen($city) > 100)) {
365350
throw new \InvalidArgumentException('invalid length for $city when calling Address., must be smaller than or equal to 100.');
366351
}
367-
if ((mb_strlen($city) < 1)) {
352+
if (!is_null($city) && (mb_strlen($city) < 1)) {
368353
throw new \InvalidArgumentException('invalid length for $city when calling Address., must be bigger than or equal to 1.');
369354
}
370355

@@ -376,7 +361,7 @@ public function setCity($city)
376361
/**
377362
* Gets country
378363
*
379-
* @return string
364+
* @return string|null
380365
*/
381366
public function getCountry()
382367
{
@@ -386,16 +371,16 @@ public function getCountry()
386371
/**
387372
* Sets country
388373
*
389-
* @param string $country The country for the billing address.
374+
* @param string|null $country The country for the billing address.
390375
*
391376
* @return self
392377
*/
393378
public function setCountry($country)
394379
{
395-
if ((mb_strlen($country) > 2)) {
380+
if (!is_null($country) && (mb_strlen($country) > 2)) {
396381
throw new \InvalidArgumentException('invalid length for $country when calling Address., must be smaller than or equal to 2.');
397382
}
398-
if ((mb_strlen($country) < 1)) {
383+
if (!is_null($country) && (mb_strlen($country) < 1)) {
399384
throw new \InvalidArgumentException('invalid length for $country when calling Address., must be bigger than or equal to 1.');
400385
}
401386

@@ -407,7 +392,7 @@ public function setCountry($country)
407392
/**
408393
* Gets postal_code
409394
*
410-
* @return string
395+
* @return string|null
411396
*/
412397
public function getPostalCode()
413398
{
@@ -417,16 +402,16 @@ public function getPostalCode()
417402
/**
418403
* Sets postal_code
419404
*
420-
* @param string $postal_code The postal code or zip code for the billing address.
405+
* @param string|null $postal_code The postal code or zip code for the billing address.
421406
*
422407
* @return self
423408
*/
424409
public function setPostalCode($postal_code)
425410
{
426-
if ((mb_strlen($postal_code) > 50)) {
411+
if (!is_null($postal_code) && (mb_strlen($postal_code) > 50)) {
427412
throw new \InvalidArgumentException('invalid length for $postal_code when calling Address., must be smaller than or equal to 50.');
428413
}
429-
if ((mb_strlen($postal_code) < 1)) {
414+
if (!is_null($postal_code) && (mb_strlen($postal_code) < 1)) {
430415
throw new \InvalidArgumentException('invalid length for $postal_code when calling Address., must be bigger than or equal to 1.');
431416
}
432417

@@ -438,7 +423,7 @@ public function setPostalCode($postal_code)
438423
/**
439424
* Gets state
440425
*
441-
* @return string
426+
* @return string|null
442427
*/
443428
public function getState()
444429
{
@@ -448,16 +433,16 @@ public function getState()
448433
/**
449434
* Sets state
450435
*
451-
* @param string $state The state, county, or province for the billing address.
436+
* @param string|null $state The state, county, or province for the billing address.
452437
*
453438
* @return self
454439
*/
455440
public function setState($state)
456441
{
457-
if ((mb_strlen($state) > 255)) {
442+
if (!is_null($state) && (mb_strlen($state) > 255)) {
458443
throw new \InvalidArgumentException('invalid length for $state when calling Address., must be smaller than or equal to 255.');
459444
}
460-
if ((mb_strlen($state) < 1)) {
445+
if (!is_null($state) && (mb_strlen($state) < 1)) {
461446
throw new \InvalidArgumentException('invalid length for $state when calling Address., must be bigger than or equal to 1.');
462447
}
463448

@@ -531,7 +516,7 @@ public function setHouseNumberOrName($house_number_or_name)
531516
/**
532517
* Gets line1
533518
*
534-
* @return string
519+
* @return string|null
535520
*/
536521
public function getLine1()
537522
{
@@ -541,16 +526,16 @@ public function getLine1()
541526
/**
542527
* Sets line1
543528
*
544-
* @param string $line1 The first line of the billing address.
529+
* @param string|null $line1 The first line of the billing address.
545530
*
546531
* @return self
547532
*/
548533
public function setLine1($line1)
549534
{
550-
if ((mb_strlen($line1) > 255)) {
535+
if (!is_null($line1) && (mb_strlen($line1) > 255)) {
551536
throw new \InvalidArgumentException('invalid length for $line1 when calling Address., must be smaller than or equal to 255.');
552537
}
553-
if ((mb_strlen($line1) < 1)) {
538+
if (!is_null($line1) && (mb_strlen($line1) < 1)) {
554539
throw new \InvalidArgumentException('invalid length for $line1 when calling Address., must be bigger than or equal to 1.');
555540
}
556541

0 commit comments

Comments
 (0)