Skip to content

Commit

Permalink
Automated commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
andreals committed Oct 8, 2024
1 parent 054c1e8 commit be295dc
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 25 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.12/doc/client.md)
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.13/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.12/doc/auth/basic-authentication.md) | The Credentials Setter for Basic Authentication |
| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.13/doc/auth/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.12/doc/auth/basic-authentication.md)
* [`httpBasic (Basic Authentication)`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.13/doc/auth/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.12/doc/models/error-exception.md) |
| 401 | Invalid API key | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.12/doc/models/error-exception.md) |
| 404 | An informed resource was not found | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.12/doc/models/error-exception.md) |
| 412 | Business validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.12/doc/models/error-exception.md) |
| 422 | Contract validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.12/doc/models/error-exception.md) |
| 500 | Internal server error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.12/doc/models/error-exception.md) |
| 400 | Invalid request | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.13/doc/models/error-exception.md) |
| 401 | Invalid API key | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.13/doc/models/error-exception.md) |
| 404 | An informed resource was not found | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.13/doc/models/error-exception.md) |
| 412 | Business validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.13/doc/models/error-exception.md) |
| 422 | Contract validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.13/doc/models/error-exception.md) |
| 500 | Internal server error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.13/doc/models/error-exception.md) |

## List of APIs

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

## Classes Documentation

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

21 changes: 21 additions & 0 deletions doc/models/get-integration-response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

# Get Integration Response

## Structure

`GetIntegrationResponse`

## Fields

| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `code` | `?string` | Optional | - | getCode(): ?string | setCode(?string code): void |

## Example (as JSON)

```json
{
"code": "code2"
}
```

1 change: 1 addition & 0 deletions doc/models/get-order-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Response object for getting an Order
| `sessionId` | `?string` | Optional | Session id | getSessionId(): ?string | setSessionId(?string sessionId): void |
| `location` | [`?GetLocationResponse`](../../doc/models/get-location-response.md) | Optional | Location | getLocation(): ?GetLocationResponse | setLocation(?GetLocationResponse location): void |
| `device` | [`?GetDeviceResponse`](../../doc/models/get-device-response.md) | Optional | Device's informations | getDevice(): ?GetDeviceResponse | setDevice(?GetDeviceResponse device): void |
| `integration` | [`?GetIntegrationResponse`](../../doc/models/get-integration-response.md) | Optional | - | getIntegration(): ?GetIntegrationResponse | setIntegration(?GetIntegrationResponse integration): void |

## Example (as JSON)

Expand Down
57 changes: 57 additions & 0 deletions src/Models/Builders/GetIntegrationResponseBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

declare(strict_types=1);

/*
* PagarmeApiSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/

namespace PagarmeApiSDKLib\Models\Builders;

use Core\Utils\CoreHelper;
use PagarmeApiSDKLib\Models\GetIntegrationResponse;

/**
* Builder for model GetIntegrationResponse
*
* @see GetIntegrationResponse
*/
class GetIntegrationResponseBuilder
{
/**
* @var GetIntegrationResponse
*/
private $instance;

private function __construct(GetIntegrationResponse $instance)
{
$this->instance = $instance;
}

/**
* Initializes a new get integration response Builder object.
*/
public static function init(): self
{
return new self(new GetIntegrationResponse());
}

/**
* Sets code field.
*/
public function code(?string $value): self
{
$this->instance->setCode($value);
return $this;
}

/**
* Initializes a new get integration response object.
*/
public function build(): GetIntegrationResponse
{
return CoreHelper::clone($this->instance);
}
}
19 changes: 19 additions & 0 deletions src/Models/Builders/GetOrderResponseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Core\Utils\CoreHelper;
use PagarmeApiSDKLib\Models\GetCustomerResponse;
use PagarmeApiSDKLib\Models\GetDeviceResponse;
use PagarmeApiSDKLib\Models\GetIntegrationResponse;
use PagarmeApiSDKLib\Models\GetLocationResponse;
use PagarmeApiSDKLib\Models\GetOrderResponse;
use PagarmeApiSDKLib\Models\GetShippingResponse;
Expand Down Expand Up @@ -402,6 +403,24 @@ public function unsetDevice(): self
return $this;
}

/**
* Sets integration field.
*/
public function integration(?GetIntegrationResponse $value): self
{
$this->instance->setIntegration($value);
return $this;
}

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

/**
* Initializes a new get order response object.
*/
Expand Down
58 changes: 58 additions & 0 deletions src/Models/GetIntegrationResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

declare(strict_types=1);

/*
* PagarmeApiSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/

namespace PagarmeApiSDKLib\Models;

use stdClass;

class GetIntegrationResponse implements \JsonSerializable
{
/**
* @var string|null
*/
private $code;

/**
* Returns Code.
*/
public function getCode(): ?string
{
return $this->code;
}

/**
* Sets Code.
*
* @maps code
*/
public function setCode(?string $code): void
{
$this->code = $code;
}

/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->code)) {
$json['code'] = $this->code;
}

return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}
37 changes: 37 additions & 0 deletions src/Models/GetOrderResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ class GetOrderResponse implements \JsonSerializable
*/
private $device = [];

/**
* @var array
*/
private $integration = [];

/**
* Returns Id.
*/
Expand Down Expand Up @@ -735,6 +740,35 @@ public function unsetDevice(): void
$this->device = [];
}

/**
* Returns Integration.
*/
public function getIntegration(): ?GetIntegrationResponse
{
if (count($this->integration) == 0) {
return null;
}
return $this->integration['value'];
}

/**
* Sets Integration.
*
* @maps integration
*/
public function setIntegration(?GetIntegrationResponse $integration): void
{
$this->integration['value'] = $integration;
}

/**
* Unsets Integration.
*/
public function unsetIntegration(): void
{
$this->integration = [];
}

/**
* Encode this object to JSON
*
Expand Down Expand Up @@ -807,6 +841,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false)
if (!empty($this->device)) {
$json['device'] = $this->device['value'];
}
if (!empty($this->integration)) {
$json['integration'] = $this->integration['value'];
}

return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
Expand Down
2 changes: 1 addition & 1 deletion src/PagarmeApiSDKClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function __construct(array $config = [])
->converter(new CompatibilityConverter())
->jsonHelper(ApiHelper::getJsonHelper())
->apiCallback($this->config['httpCallback'] ?? null)
->userAgent('PagarmeApiSDK - PHP 6.8.12')
->userAgent('PagarmeApiSDK - PHP 6.8.13')
->globalConfig($this->getGlobalConfiguration())
->globalErrors($this->getGlobalErrors())
->serverUrls(self::ENVIRONMENT_MAP[$this->getEnvironment()], Server::DEFAULT_)
Expand Down

0 comments on commit be295dc

Please sign in to comment.