Skip to content

Commit

Permalink
fix buyersnapshot -> billingdetails (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-gr4vy authored Apr 8, 2022
1 parent 3d861f0 commit 7dce245
Show file tree
Hide file tree
Showing 16 changed files with 118 additions and 827 deletions.
2 changes: 0 additions & 2 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ docs/Api/PaymentServiceDefinitionsApi.md
docs/Api/PaymentServicesApi.md
docs/Api/TransactionsApi.md
docs/Model/Address.md
docs/Model/AddressUpdate.md
docs/Model/ApplePayRequest.md
docs/Model/ApplePaySessionRequest.md
docs/Model/BillingDetails.md
Expand Down Expand Up @@ -96,7 +95,6 @@ lib/Configuration.php
lib/HeaderSelector.php
lib/ObjectSerializer.php
lib/model/Address.php
lib/model/AddressUpdate.php
lib/model/ApplePayRequest.php
lib/model/ApplePaySessionRequest.php
lib/model/BillingDetails.php
Expand Down
4 changes: 4 additions & 0 deletions .openapi-generator/replace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ var1="'billing_details' => 'BillingDetails',"
rep1="'billing_details' => '\\\Gr4vy\\\model\\\BillingDetails',"
sed -i '' "s/$var1/$rep1/g" lib/model/*.php

var1="'billing_details' => 'BillingDetails'"
rep1="'billing_details' => '\\\Gr4vy\\\model\\\BillingDetails'"
sed -i '' "s/$var1/$rep1/g" lib/model/*.php

var1="'address' => 'Address',"
rep1="'address' => '\\\Gr4vy\\\model\\\Address',"
sed -i '' "s/$var1/$rep1/g" lib/model/*.php
Expand Down
10 changes: 5 additions & 5 deletions docs/Model/Address.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**city** | **string** | The city for the billing address. |
**country** | **string** | The country for the billing address. |
**postal_code** | **string** | The postal code or zip code for the billing address. |
**state** | **string** | The state, county, or province for the billing address. |
**city** | **string** | The city for the billing address. | [optional]
**country** | **string** | The country for the billing address. | [optional]
**postal_code** | **string** | The postal code or zip code for the billing address. | [optional]
**state** | **string** | The state, county, or province for the billing address. | [optional]
**state_code** | **string** | The code of state, county, or province for the billing address in ISO 3166-2 format. | [optional]
**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]
**line1** | **string** | The first line of the billing address. |
**line1** | **string** | The first line of the billing address. | [optional]
**line2** | **string** | The second line of the billing address. | [optional]
**organization** | **string** | The optional name of the company or organisation to add to the billing address. | [optional]

Expand Down
2 changes: 1 addition & 1 deletion docs/Model/BillingDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Name | Type | Description | Notes
**first_name** | **string** | The first name(s) or given name of the buyer. | [optional]
**last_name** | **string** | The last name, or family name, of the buyer. | [optional]
**email_address** | **string** | The email address of the buyer. | [optional]
**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]
**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]
**address** | [**Address**](Address.md) | | [optional]
**tax_id** | [**TaxId**](TaxId.md) | | [optional]

Expand Down
4 changes: 2 additions & 2 deletions docs/Model/BillingDetailsRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Name | Type | Description | Notes
**first_name** | **string** | The first name(s) or given name for the buyer. | [optional]
**last_name** | **string** | The last name, or family name, of the buyer. | [optional]
**email_address** | **string** | The email address for the buyer. | [optional]
**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]
**address** | [**Address**](Address.md) | | [optional]
**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]
**address** | [**Address**](Address.md) | The billing address for the buyer. | [optional]
**tax_id** | [**TaxId**](TaxId.md) | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
4 changes: 2 additions & 2 deletions docs/Model/BillingDetailsUpdateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**address** | [**AddressUpdate**](AddressUpdate.md) | Address associated with the billing details. | [optional]
**first_name** | **string** | The first name(s) or given name for the buyer. | [optional]
**last_name** | **string** | The last name, or family name, of the buyer. | [optional]
**email_address** | **string** | The email address for the buyer. | [optional]
**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]
**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]
**address** | [**Address**](Address.md) | The billing address for the buyer. | [optional]
**tax_id** | [**TaxId**](TaxId.md) | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
2 changes: 1 addition & 1 deletion docs/Model/BuyerUpdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**billing_details** | [**BillingDetailsUpdateRequest**](BillingDetailsUpdateRequest.md) | The optional billing details to update a buyer. | [optional]
**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]
**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]
**billing_details** | [**BillingDetailsUpdateRequest**](BillingDetailsUpdateRequest.md) | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
2 changes: 1 addition & 1 deletion docs/Model/StatementDescriptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Name | Type | Description | Notes
**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]
**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]
**city** | **string** | City from which the charge originated. | [optional]
**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]
**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]
**url** | **string** | The value in the URL/web address field of a customer's statement. | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
77 changes: 31 additions & 46 deletions lib/model/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* Address Class Doc Comment
*
* @category Class
* @description Billing details associated to a buyer.
* @description The billing address of the buyer.
* @package Gr4vy
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
Expand Down Expand Up @@ -240,47 +240,35 @@ public function listInvalidProperties()
{
$invalidProperties = [];

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

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

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

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

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

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

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

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

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

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

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

Expand Down Expand Up @@ -345,7 +330,7 @@ public function valid()
/**
* Gets city
*
* @return string
* @return string|null
*/
public function getCity()
{
Expand All @@ -355,16 +340,16 @@ public function getCity()
/**
* Sets city
*
* @param string $city The city for the billing address.
* @param string|null $city The city for the billing address.
*
* @return self
*/
public function setCity($city)
{
if ((mb_strlen($city) > 100)) {
if (!is_null($city) && (mb_strlen($city) > 100)) {
throw new \InvalidArgumentException('invalid length for $city when calling Address., must be smaller than or equal to 100.');
}
if ((mb_strlen($city) < 1)) {
if (!is_null($city) && (mb_strlen($city) < 1)) {
throw new \InvalidArgumentException('invalid length for $city when calling Address., must be bigger than or equal to 1.');
}

Expand All @@ -376,7 +361,7 @@ public function setCity($city)
/**
* Gets country
*
* @return string
* @return string|null
*/
public function getCountry()
{
Expand All @@ -386,16 +371,16 @@ public function getCountry()
/**
* Sets country
*
* @param string $country The country for the billing address.
* @param string|null $country The country for the billing address.
*
* @return self
*/
public function setCountry($country)
{
if ((mb_strlen($country) > 2)) {
if (!is_null($country) && (mb_strlen($country) > 2)) {
throw new \InvalidArgumentException('invalid length for $country when calling Address., must be smaller than or equal to 2.');
}
if ((mb_strlen($country) < 1)) {
if (!is_null($country) && (mb_strlen($country) < 1)) {
throw new \InvalidArgumentException('invalid length for $country when calling Address., must be bigger than or equal to 1.');
}

Expand All @@ -407,7 +392,7 @@ public function setCountry($country)
/**
* Gets postal_code
*
* @return string
* @return string|null
*/
public function getPostalCode()
{
Expand All @@ -417,16 +402,16 @@ public function getPostalCode()
/**
* Sets postal_code
*
* @param string $postal_code The postal code or zip code for the billing address.
* @param string|null $postal_code The postal code or zip code for the billing address.
*
* @return self
*/
public function setPostalCode($postal_code)
{
if ((mb_strlen($postal_code) > 50)) {
if (!is_null($postal_code) && (mb_strlen($postal_code) > 50)) {
throw new \InvalidArgumentException('invalid length for $postal_code when calling Address., must be smaller than or equal to 50.');
}
if ((mb_strlen($postal_code) < 1)) {
if (!is_null($postal_code) && (mb_strlen($postal_code) < 1)) {
throw new \InvalidArgumentException('invalid length for $postal_code when calling Address., must be bigger than or equal to 1.');
}

Expand All @@ -438,7 +423,7 @@ public function setPostalCode($postal_code)
/**
* Gets state
*
* @return string
* @return string|null
*/
public function getState()
{
Expand All @@ -448,16 +433,16 @@ public function getState()
/**
* Sets state
*
* @param string $state The state, county, or province for the billing address.
* @param string|null $state The state, county, or province for the billing address.
*
* @return self
*/
public function setState($state)
{
if ((mb_strlen($state) > 255)) {
if (!is_null($state) && (mb_strlen($state) > 255)) {
throw new \InvalidArgumentException('invalid length for $state when calling Address., must be smaller than or equal to 255.');
}
if ((mb_strlen($state) < 1)) {
if (!is_null($state) && (mb_strlen($state) < 1)) {
throw new \InvalidArgumentException('invalid length for $state when calling Address., must be bigger than or equal to 1.');
}

Expand Down Expand Up @@ -531,7 +516,7 @@ public function setHouseNumberOrName($house_number_or_name)
/**
* Gets line1
*
* @return string
* @return string|null
*/
public function getLine1()
{
Expand All @@ -541,16 +526,16 @@ public function getLine1()
/**
* Sets line1
*
* @param string $line1 The first line of the billing address.
* @param string|null $line1 The first line of the billing address.
*
* @return self
*/
public function setLine1($line1)
{
if ((mb_strlen($line1) > 255)) {
if (!is_null($line1) && (mb_strlen($line1) > 255)) {
throw new \InvalidArgumentException('invalid length for $line1 when calling Address., must be smaller than or equal to 255.');
}
if ((mb_strlen($line1) < 1)) {
if (!is_null($line1) && (mb_strlen($line1) < 1)) {
throw new \InvalidArgumentException('invalid length for $line1 when calling Address., must be bigger than or equal to 1.');
}

Expand Down
Loading

0 comments on commit 7dce245

Please sign in to comment.