Skip to content

Commit

Permalink
Fix contract id Length (#256)
Browse files Browse the repository at this point in the history
* remove maxLength and minLength from specification

* update phpstan/phpstan lib

* add version in user agent
  • Loading branch information
fcarrero authored Dec 7, 2023
1 parent 1b51aed commit 7467077
Show file tree
Hide file tree
Showing 18 changed files with 82 additions and 211 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,5 +405,5 @@ [email protected]
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: `2.1.0`
- Package version: `6.0.2`
- Package version: `6.0.3`
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.2
6.0.3
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "conekta/conekta-php",
"version": "6.0.2",
"version": "6.0.3",
"description": "Conekta PHP Library",
"type": "library",
"keywords": [
Expand Down Expand Up @@ -29,7 +29,7 @@
"require-dev": {
"phpunit/phpunit": "^8.0 || ^9.0",
"friendsofphp/php-cs-fixer": "^3.5",
"phpstan/phpstan": "1.10.32"
"phpstan/phpstan": "1.10.47"
},
"autoload": {
"psr-4": { "Conekta\\" : "lib/" }
Expand Down
14 changes: 10 additions & 4 deletions docs/Api/TransactionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ try {
## `getTransactions()`

```php
getTransactions($accept_language, $x_child_company_id, $limit, $search, $next, $previous): \Conekta\Model\GetTransactionsResponse
getTransactions($accept_language, $x_child_company_id, $limit, $next, $previous, $id, $charge_id, $type, $currency): \Conekta\Model\GetTransactionsResponse
```

Get List transactions
Expand All @@ -102,12 +102,15 @@ $apiInstance = new Conekta\Api\TransactionsApi(
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.
$limit = 20; // int | The numbers of items to return, the maximum value is 250
$search = 'search_example'; // string | General order search, e.g. by mail, reference etc.
$next = 'next_example'; // string | next page
$previous = 'previous_example'; // string | previous page
$id = 65412a893cd69a0001c25892; // string | id of the object to be retrieved
$charge_id = 65412a893cd69a0001c25892; // string | id of the charge used for filtering
$type = capture; // string | type of the object to be retrieved
$currency = MXN; // string | currency of the object to be retrieved

try {
$result = $apiInstance->getTransactions($accept_language, $x_child_company_id, $limit, $search, $next, $previous);
$result = $apiInstance->getTransactions($accept_language, $x_child_company_id, $limit, $next, $previous, $id, $charge_id, $type, $currency);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TransactionsApi->getTransactions: ', $e->getMessage(), PHP_EOL;
Expand All @@ -121,9 +124,12 @@ try {
| **accept_language** | **string**| Use for knowing which language to use | [optional] [default to 'es'] |
| **x_child_company_id** | **string**| In the case of a holding company, the company id of the child company to which will process the request. | [optional] |
| **limit** | **int**| The numbers of items to return, the maximum value is 250 | [optional] [default to 20] |
| **search** | **string**| General order search, e.g. by mail, reference etc. | [optional] |
| **next** | **string**| next page | [optional] |
| **previous** | **string**| previous page | [optional] |
| **id** | **string**| id of the object to be retrieved | [optional] |
| **charge_id** | **string**| id of the charge used for filtering | [optional] |
| **type** | **string**| type of the object to be retrieved | [optional] |
| **currency** | **string**| currency of the object to be retrieved | [optional] |

### Return type

Expand Down
1 change: 0 additions & 1 deletion docs/Model/ChargeOrderResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Name | Type | Description | Notes
**device_fingerprint** | **string** | | [optional]
**failure_code** | **string** | | [optional]
**failure_message** | **string** | | [optional]
**fee** | **int** | | [optional]
**id** | **string** | | [optional]
**livemode** | **bool** | | [optional]
**monthly_installments** | **int** | | [optional]
Expand Down
1 change: 0 additions & 1 deletion docs/Model/ChargeResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Name | Type | Description | Notes
**device_fingerprint** | **string** | | [optional]
**failure_code** | **string** | | [optional]
**failure_message** | **string** | | [optional]
**fee** | **int** | | [optional]
**id** | **string** | | [optional]
**livemode** | **bool** | | [optional]
**object** | **string** | | [optional]
Expand Down
1 change: 0 additions & 1 deletion docs/Model/ChargesDataResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Name | Type | Description | Notes
**device_fingerprint** | **string** | | [optional]
**failure_code** | **string** | | [optional]
**failure_message** | **string** | | [optional]
**fee** | **int** | | [optional]
**id** | **string** | | [optional]
**livemode** | **bool** | | [optional]
**object** | **string** | | [optional]
Expand Down
85 changes: 65 additions & 20 deletions lib/Api/TransactionsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -514,18 +514,21 @@ public function getTransactionRequest($id, $accept_language = 'es', $x_child_com
* @param string $accept_language Use for knowing which language to use (optional, default to 'es')
* @param string $x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @param int $limit The numbers of items to return, the maximum value is 250 (optional, default to 20)
* @param string $search General order search, e.g. by mail, reference etc. (optional)
* @param string $next next page (optional)
* @param string $previous previous page (optional)
* @param string $id id of the object to be retrieved (optional)
* @param string $charge_id id of the charge used for filtering (optional)
* @param string $type type of the object to be retrieved (optional)
* @param string $currency currency of the object to be retrieved (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransactions'] to see the possible values for this operation
*
* @throws \Conekta\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \Conekta\Model\GetTransactionsResponse|\Conekta\Model\Error|\Conekta\Model\Error
*/
public function getTransactions($accept_language = 'es', $x_child_company_id = null, $limit = 20, $search = null, $next = null, $previous = null, string $contentType = self::contentTypes['getTransactions'][0])
public function getTransactions($accept_language = 'es', $x_child_company_id = null, $limit = 20, $next = null, $previous = null, $id = null, $charge_id = null, $type = null, $currency = null, string $contentType = self::contentTypes['getTransactions'][0])
{
list($response) = $this->getTransactionsWithHttpInfo($accept_language, $x_child_company_id, $limit, $search, $next, $previous, $contentType);
list($response) = $this->getTransactionsWithHttpInfo($accept_language, $x_child_company_id, $limit, $next, $previous, $id, $charge_id, $type, $currency, $contentType);
return $response;
}

Expand All @@ -537,18 +540,21 @@ public function getTransactions($accept_language = 'es', $x_child_company_id = n
* @param string $accept_language Use for knowing which language to use (optional, default to 'es')
* @param string $x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @param int $limit The numbers of items to return, the maximum value is 250 (optional, default to 20)
* @param string $search General order search, e.g. by mail, reference etc. (optional)
* @param string $next next page (optional)
* @param string $previous previous page (optional)
* @param string $id id of the object to be retrieved (optional)
* @param string $charge_id id of the charge used for filtering (optional)
* @param string $type type of the object to be retrieved (optional)
* @param string $currency currency of the object to be retrieved (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransactions'] to see the possible values for this operation
*
* @throws \Conekta\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \Conekta\Model\GetTransactionsResponse|\Conekta\Model\Error|\Conekta\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getTransactionsWithHttpInfo($accept_language = 'es', $x_child_company_id = null, $limit = 20, $search = null, $next = null, $previous = null, string $contentType = self::contentTypes['getTransactions'][0])
public function getTransactionsWithHttpInfo($accept_language = 'es', $x_child_company_id = null, $limit = 20, $next = null, $previous = null, $id = null, $charge_id = null, $type = null, $currency = null, string $contentType = self::contentTypes['getTransactions'][0])
{
$request = $this->getTransactionsRequest($accept_language, $x_child_company_id, $limit, $search, $next, $previous, $contentType);
$request = $this->getTransactionsRequest($accept_language, $x_child_company_id, $limit, $next, $previous, $id, $charge_id, $type, $currency, $contentType);

try {
$options = $this->createHttpClientOption();
Expand Down Expand Up @@ -688,17 +694,20 @@ public function getTransactionsWithHttpInfo($accept_language = 'es', $x_child_co
* @param string $accept_language Use for knowing which language to use (optional, default to 'es')
* @param string $x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @param int $limit The numbers of items to return, the maximum value is 250 (optional, default to 20)
* @param string $search General order search, e.g. by mail, reference etc. (optional)
* @param string $next next page (optional)
* @param string $previous previous page (optional)
* @param string $id id of the object to be retrieved (optional)
* @param string $charge_id id of the charge used for filtering (optional)
* @param string $type type of the object to be retrieved (optional)
* @param string $currency currency of the object to be retrieved (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransactions'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function getTransactionsAsync($accept_language = 'es', $x_child_company_id = null, $limit = 20, $search = null, $next = null, $previous = null, string $contentType = self::contentTypes['getTransactions'][0])
public function getTransactionsAsync($accept_language = 'es', $x_child_company_id = null, $limit = 20, $next = null, $previous = null, $id = null, $charge_id = null, $type = null, $currency = null, string $contentType = self::contentTypes['getTransactions'][0])
{
return $this->getTransactionsAsyncWithHttpInfo($accept_language, $x_child_company_id, $limit, $search, $next, $previous, $contentType)
return $this->getTransactionsAsyncWithHttpInfo($accept_language, $x_child_company_id, $limit, $next, $previous, $id, $charge_id, $type, $currency, $contentType)
->then(
function ($response) {
return $response[0];
Expand All @@ -714,18 +723,21 @@ function ($response) {
* @param string $accept_language Use for knowing which language to use (optional, default to 'es')
* @param string $x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @param int $limit The numbers of items to return, the maximum value is 250 (optional, default to 20)
* @param string $search General order search, e.g. by mail, reference etc. (optional)
* @param string $next next page (optional)
* @param string $previous previous page (optional)
* @param string $id id of the object to be retrieved (optional)
* @param string $charge_id id of the charge used for filtering (optional)
* @param string $type type of the object to be retrieved (optional)
* @param string $currency currency of the object to be retrieved (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransactions'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function getTransactionsAsyncWithHttpInfo($accept_language = 'es', $x_child_company_id = null, $limit = 20, $search = null, $next = null, $previous = null, string $contentType = self::contentTypes['getTransactions'][0])
public function getTransactionsAsyncWithHttpInfo($accept_language = 'es', $x_child_company_id = null, $limit = 20, $next = null, $previous = null, $id = null, $charge_id = null, $type = null, $currency = null, string $contentType = self::contentTypes['getTransactions'][0])
{
$returnType = '\Conekta\Model\GetTransactionsResponse';
$request = $this->getTransactionsRequest($accept_language, $x_child_company_id, $limit, $search, $next, $previous, $contentType);
$request = $this->getTransactionsRequest($accept_language, $x_child_company_id, $limit, $next, $previous, $id, $charge_id, $type, $currency, $contentType);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -769,15 +781,18 @@ function ($exception) {
* @param string $accept_language Use for knowing which language to use (optional, default to 'es')
* @param string $x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @param int $limit The numbers of items to return, the maximum value is 250 (optional, default to 20)
* @param string $search General order search, e.g. by mail, reference etc. (optional)
* @param string $next next page (optional)
* @param string $previous previous page (optional)
* @param string $id id of the object to be retrieved (optional)
* @param string $charge_id id of the charge used for filtering (optional)
* @param string $type type of the object to be retrieved (optional)
* @param string $currency currency of the object to be retrieved (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTransactions'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
public function getTransactionsRequest($accept_language = 'es', $x_child_company_id = null, $limit = 20, $search = null, $next = null, $previous = null, string $contentType = self::contentTypes['getTransactions'][0])
public function getTransactionsRequest($accept_language = 'es', $x_child_company_id = null, $limit = 20, $next = null, $previous = null, $id = null, $charge_id = null, $type = null, $currency = null, string $contentType = self::contentTypes['getTransactions'][0])
{


Expand All @@ -793,6 +808,9 @@ public function getTransactionsRequest($accept_language = 'es', $x_child_company






$resourcePath = '/transactions';
$formParams = [];
$queryParams = [];
Expand All @@ -811,26 +829,53 @@ public function getTransactionsRequest($accept_language = 'es', $x_child_company
) ?? []);
// query params
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
$search,
'search', // param base name
$next,
'next', // param base name
'string', // openApiType
'', // style
false, // explode
false // required
) ?? []);
// query params
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
$next,
'next', // param base name
$previous,
'previous', // param base name
'string', // openApiType
'', // style
false, // explode
false // required
) ?? []);
// query params
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
$previous,
'previous', // param base name
$id,
'id', // param base name
'string', // openApiType
'', // style
false, // explode
false // required
) ?? []);
// query params
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
$charge_id,
'charge_id', // param base name
'string', // openApiType
'', // style
false, // explode
false // required
) ?? []);
// query params
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
$type,
'type', // param base name
'string', // openApiType
'', // style
false, // explode
false // required
) ?? []);
// query params
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
$currency,
'currency', // param base name
'string', // openApiType
'', // style
false, // explode
Expand Down
4 changes: 2 additions & 2 deletions lib/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Configuration
*
* @var string
*/
protected $userAgent = 'Conekta/v2 PhpBindings/6.0.2';
protected $userAgent = 'Conekta/v2 PhpBindings/6.0.3';

/**
* Debug switch (default set to false)
Expand Down Expand Up @@ -456,7 +456,7 @@ public static function toDebugReport()
$report .= ' OS: ' . $uname . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' The version of the OpenAPI document: 2.1.0' . PHP_EOL;
$report .= ' SDK Package Version: 6.0.2' . PHP_EOL;
$report .= ' SDK Package Version: 6.0.3' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;

return $report;
Expand Down
2 changes: 1 addition & 1 deletion lib/HeaderSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public function getConektaUserAgent(): array
$uname = $uname_disabled ? '(disabled)' : \php_uname();

$userAgent = [
'bindings_version' => "6.0.2",
'bindings_version' => "6.0.3",
'lang' => 'php',
'lang_version' => phpversion(),
'publisher' => 'conekta',
Expand Down
15 changes: 0 additions & 15 deletions lib/Model/ChargeDataPaymentMethodCardResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,6 @@ public function listInvalidProperties()
{
$invalidProperties = [];

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

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

return $invalidProperties;
}

Expand Down Expand Up @@ -472,13 +464,6 @@ public function setContractId($contract_id)
if (is_null($contract_id)) {
throw new \InvalidArgumentException('non-nullable contract_id cannot be null');
}
if ((mb_strlen($contract_id) > 10)) {
throw new \InvalidArgumentException('invalid length for $contract_id when calling ChargeDataPaymentMethodCardResponse., must be smaller than or equal to 10.');
}
if ((mb_strlen($contract_id) < 10)) {
throw new \InvalidArgumentException('invalid length for $contract_id when calling ChargeDataPaymentMethodCardResponse., must be bigger than or equal to 10.');
}

$this->container['contract_id'] = $contract_id;

return $this;
Expand Down
Loading

0 comments on commit 7467077

Please sign in to comment.