Skip to content

Commit

Permalink
Automated commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
andreals committed Jun 7, 2024
1 parent 9813ed1 commit 186a465
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 45 deletions.
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ To run your project, right click on your PHP file inside your Test project and c

## Initialize the API Client

**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/client.md)
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/client.md)

The following parameters are configurable for the API Client:

Expand All @@ -115,7 +115,7 @@ The following parameters are configurable for the API Client:
| `retryOnTimeout` | `bool` | Whether to retry on request timeout.<br>*Default*: `true` |
| `httpStatusCodesToRetry` | `array` | Http status codes to retry against.<br>*Default*: `408, 413, 429, 500, 502, 503, 504, 521, 522, 524` |
| `httpMethodsToRetry` | `array` | Http methods to retry against.<br>*Default*: `'GET', 'PUT'` |
| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/$a/https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/basic-authentication.md) | The Credentials Setter for Basic Authentication |
| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/$a/https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/basic-authentication.md) | The Credentials Setter for Basic Authentication |

The API client can be initialized as follows:

Expand All @@ -135,39 +135,39 @@ $client = PagarmeApiSDKClientBuilder::init()

This API uses the following authentication schemes.

* [`httpBasic (Basic Authentication)`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/$a/https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/basic-authentication.md)
* [`httpBasic (Basic Authentication)`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/$a/https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/basic-authentication.md)

## API Errors

Here is the list of errors that the API might throw.

| HTTP Status Code | Error Description | Exception Class |
| --- | --- | --- |
| 400 | Invalid request | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/models/error-exception.md) |
| 401 | Invalid API key | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/models/error-exception.md) |
| 404 | An informed resource was not found | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/models/error-exception.md) |
| 412 | Business validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/models/error-exception.md) |
| 422 | Contract validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/models/error-exception.md) |
| 500 | Internal server error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/models/error-exception.md) |
| 400 | Invalid request | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/models/error-exception.md) |
| 401 | Invalid API key | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/models/error-exception.md) |
| 404 | An informed resource was not found | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/models/error-exception.md) |
| 412 | Business validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/models/error-exception.md) |
| 422 | Contract validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/models/error-exception.md) |
| 500 | Internal server error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/models/error-exception.md) |

## List of APIs

* [Subscriptions](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/controllers/subscriptions.md)
* [Orders](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/controllers/orders.md)
* [Plans](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/controllers/plans.md)
* [Invoices](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/controllers/invoices.md)
* [Customers](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/controllers/customers.md)
* [Charges](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/controllers/charges.md)
* [Recipients](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/controllers/recipients.md)
* [Tokens](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/controllers/tokens.md)
* [Transactions](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/controllers/transactions.md)
* [Transfers](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/controllers/transfers.md)
* [Payables](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/controllers/payables.md)
* [Balance Operations](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/controllers/balance-operations.md)
* [Subscriptions](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/controllers/subscriptions.md)
* [Orders](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/controllers/orders.md)
* [Plans](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/controllers/plans.md)
* [Invoices](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/controllers/invoices.md)
* [Customers](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/controllers/customers.md)
* [Charges](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/controllers/charges.md)
* [Recipients](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/controllers/recipients.md)
* [Tokens](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/controllers/tokens.md)
* [Transactions](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/controllers/transactions.md)
* [Transfers](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/controllers/transfers.md)
* [Payables](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/controllers/payables.md)
* [Balance Operations](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/controllers/balance-operations.md)

## Classes Documentation

* [ApiException](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/api-exception.md)
* [HttpRequest](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/http-request.md)
* [HttpResponse](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.8/doc/http-response.md)
* [ApiException](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/api-exception.md)
* [HttpRequest](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/http-request.md)
* [HttpResponse](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.9/doc/http-response.md)

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"php": "^7.2 || ^8.0",
"ext-json": "*",
"apimatic/unirest-php": "^4.0.0",
"apimatic/core-interfaces": "~0.1.4",
"apimatic/core": "~0.3.8"
"apimatic/core-interfaces": "~0.1.5",
"apimatic/core": "~0.3.9"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5",
Expand Down
6 changes: 3 additions & 3 deletions doc/models/create-managing-partner-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Managing Partner Request
| `name` | `string` | Required | - | getName(): string | setName(string name): void |
| `email` | `string` | Required | - | getEmail(): string | setEmail(string email): void |
| `document` | `string` | Required | - | getDocument(): string | setDocument(string document): void |
| `motherName` | `string` | Required | - | getMotherName(): string | setMotherName(string motherName): void |
| `motherName` | `?string` | Optional | - | getMotherName(): ?string | setMotherName(?string motherName): void |
| `birthdate` | `string` | Required | - | getBirthdate(): string | setBirthdate(string birthdate): void |
| `monthlyIncome` | `int` | Required | - | getMonthlyIncome(): int | setMonthlyIncome(int monthlyIncome): void |
| `professionalOccupation` | `string` | Required | - | getProfessionalOccupation(): string | setProfessionalOccupation(string professionalOccupation): void |
Expand All @@ -29,7 +29,6 @@ Managing Partner Request
"name": "name4",
"email": "email2",
"document": "document2",
"mother_name": "mother_name0",
"birthdate": "birthdate8",
"monthly_income": 70,
"professional_occupation": "professional_occupation8",
Expand All @@ -50,7 +49,8 @@ Managing Partner Request
"number": "number2",
"type": "type0"
}
]
],
"mother_name": "mother_name0"
}
```

4 changes: 2 additions & 2 deletions doc/models/create-register-information-corporation-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"name": "name4",
"email": "email2",
"document": "document8",
"mother_name": "mother_name0",
"birthdate": "birthdate8",
"monthly_income": 202,
"professional_occupation": "professional_occupation8",
Expand All @@ -65,7 +64,8 @@
"number": "number2",
"type": "type0"
}
]
],
"mother_name": "mother_name0"
}
],
"main_address": {
Expand Down
20 changes: 18 additions & 2 deletions src/Models/Builders/CreateManagingPartnerRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public static function init(
string $name,
string $email,
string $document,
string $motherName,
string $birthdate,
int $monthlyIncome,
string $professionalOccupation,
Expand All @@ -50,7 +49,6 @@ public static function init(
$name,
$email,
$document,
$motherName,
$birthdate,
$monthlyIncome,
$professionalOccupation,
Expand All @@ -60,6 +58,24 @@ public static function init(
));
}

/**
* Sets mother name field.
*/
public function motherName(?string $value): self
{
$this->instance->setMotherName($value);
return $this;
}

/**
* Unsets mother name field.
*/
public function unsetMotherName(): self
{
$this->instance->unsetMotherName();
return $this;
}

/**
* Initializes a new create managing partner request object.
*/
Expand Down
31 changes: 20 additions & 11 deletions src/Models/CreateManagingPartnerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class CreateManagingPartnerRequest implements \JsonSerializable
private $document;

/**
* @var string
* @var array
*/
private $motherName;
private $motherName = [];

/**
* @var string
Expand Down Expand Up @@ -71,7 +71,6 @@ class CreateManagingPartnerRequest implements \JsonSerializable
* @param string $name
* @param string $email
* @param string $document
* @param string $motherName
* @param string $birthdate
* @param int $monthlyIncome
* @param string $professionalOccupation
Expand All @@ -83,7 +82,6 @@ public function __construct(
string $name,
string $email,
string $document,
string $motherName,
string $birthdate,
int $monthlyIncome,
string $professionalOccupation,
Expand All @@ -94,7 +92,6 @@ public function __construct(
$this->name = $name;
$this->email = $email;
$this->document = $document;
$this->motherName = $motherName;
$this->birthdate = $birthdate;
$this->monthlyIncome = $monthlyIncome;
$this->professionalOccupation = $professionalOccupation;
Expand Down Expand Up @@ -163,20 +160,30 @@ public function setDocument(string $document): void
/**
* Returns Mother Name.
*/
public function getMotherName(): string
public function getMotherName(): ?string
{
return $this->motherName;
if (count($this->motherName) == 0) {
return null;
}
return $this->motherName['value'];
}

/**
* Sets Mother Name.
*
* @required
* @maps mother_name
*/
public function setMotherName(string $motherName): void
public function setMotherName(?string $motherName): void
{
$this->motherName['value'] = $motherName;
}

/**
* Unsets Mother Name.
*/
public function unsetMotherName(): void
{
$this->motherName = $motherName;
$this->motherName = [];
}

/**
Expand Down Expand Up @@ -312,7 +319,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false)
$json['name'] = $this->name;
$json['email'] = $this->email;
$json['document'] = $this->document;
$json['mother_name'] = $this->motherName;
if (!empty($this->motherName)) {
$json['mother_name'] = $this->motherName['value'];
}
$json['birthdate'] = $this->birthdate;
$json['monthly_income'] = $this->monthlyIncome;
$json['professional_occupation'] = $this->professionalOccupation;
Expand Down
2 changes: 1 addition & 1 deletion src/PagarmeApiSDKClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function __construct(array $config = [])
->converter(new CompatibilityConverter())
->jsonHelper(ApiHelper::getJsonHelper())
->apiCallback($this->config['httpCallback'] ?? null)
->userAgent('PagarmeApiSDK - PHP 6.8.8')
->userAgent('PagarmeApiSDK - PHP 6.8.9')
->globalConfig($this->getGlobalConfiguration())
->globalErrors($this->getGlobalErrors())
->serverUrls(self::ENVIRONMENT_MAP[$this->getEnvironment()], Server::DEFAULT_)
Expand Down

0 comments on commit 186a465

Please sign in to comment.