Skip to content

Commit

Permalink
AI-64 update template by new attribute CustomerIpAddress (#301)
Browse files Browse the repository at this point in the history
Signed-off-by: jesus lozano <[email protected]>
  • Loading branch information
jalozanot-conekta authored Oct 11, 2024
1 parent 040aad5 commit 2ef9b46
Show file tree
Hide file tree
Showing 28 changed files with 428 additions and 58 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,6 @@ [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.8`
- Package version: `6.0.9`
- Generator version: `7.5.0`
- 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.8
6.0.9
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.8",
"version": "6.0.9",
"description": "Conekta PHP Library",
"type": "library",
"keywords": [
Expand Down Expand Up @@ -29,7 +29,7 @@
"require-dev": {
"phpunit/phpunit": "^9.0 || ^10.0",
"friendsofphp/php-cs-fixer": "^3.5",
"phpstan/phpstan": "1.12.5"
"phpstan/phpstan": "1.11.1"
},
"autoload": {
"psr-4": { "Conekta\\" : "lib/" }
Expand Down
4 changes: 2 additions & 2 deletions config-php.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"packageName": "conekta",
"generateSourceCodeOnly": "false",
"artifactVersion": "6.0.8",
"artifactVersion": "6.0.9",
"packageUrl": "https://developers.conekta.com/",
"projectName": "conekta-php",
"appDescriptionV2" : "Conekta PHP Library",
"useOneOfDiscriminatorLookup" : true,
"nonCompliantUseDiscriminatorIfCompositionFails" : false,
"httpUserAgent": "Conekta/v2 PhpBindings/6.0.8",
"httpUserAgent": "Conekta/v2 PhpBindings/6.0.9",
"packageAuthors" : "[email protected]",
"files": {
"/local/CODE_OF_CONDUCT.md" : {},
Expand Down
1 change: 1 addition & 0 deletions docs/Model/ChargeOrderResponsePaymentMethod.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Name | Type | Description | Notes
**service_name** | **string** | | [optional]
**store** | **string** | | [optional]
**store_name** | **string** | | [optional]
**customer_ip_address** | **string** | | [optional]
**account_type** | **string** | Account type of the card | [optional]
**brand** | **string** | Brand of the card | [optional]
**contract_id** | **string** | Id sent for recurrent charges. | [optional]
Expand Down
3 changes: 2 additions & 1 deletion docs/Model/ChargeRequestPaymentMethod.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **string** | Type of payment method |
**cvc** | **string** | Card security code |
**cvc** | **string** | Optional, It is a value that allows identifying the security code of the card. Only for PCI merchants |
**exp_month** | **string** | Card expiration month |
**exp_year** | **string** | Card expiration year |
**name** | **string** | Cardholder name |
**number** | **string** | Card number |
**customer_ip_address** | **string** | Optional field used to capture the customer&#39;s IP address for fraud prevention and security monitoring purposes | [optional]
**expires_at** | **int** | Method expiration date as unix timestamp | [optional]
**monthly_installments** | **int** | How many months without interest to apply, it can be 3, 6, 9, 12 or 18 | [optional]
**token_id** | **string** | | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/Model/ChargeResponsePaymentMethod.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Name | Type | Description | Notes
**service_name** | **string** | | [optional]
**store** | **string** | | [optional]
**store_name** | **string** | | [optional]
**customer_ip_address** | **string** | | [optional]
**account_type** | **string** | Account type of the card | [optional]
**brand** | **string** | Brand of the card | [optional]
**contract_id** | **string** | Id sent for recurrent charges. | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/Model/Checkout.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
**expires_at** | **int** | It is the time when the link will expire. It is expressed in seconds since the Unix epoch. The valid range is from 2 to 365 days (the valid range will be taken from the next day of the creation date at 00:01 hrs) |
**monthly_installments_enabled** | **bool** | This flag allows you to specify if months without interest will be active. | [optional]
**monthly_installments_options** | **int[]** | This field allows you to specify the number of months without interest. | [optional]
**three_ds_mode** | **string** | Indicates the 3DS2 mode for the order, either smart or strict. | [optional]
**name** | **string** | Reason for charge |
**needs_shipping_contact** | **bool** | This flag allows you to fill in the shipping information at checkout. | [optional]
**on_demand_enabled** | **bool** | This flag allows you to specify if the link will be on demand. | [optional]
Expand Down
2 changes: 1 addition & 1 deletion docs/Model/OrderRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Name | Type | Description | Notes
**needs_shipping_contact** | **bool** | Allows you to fill out the shipping information at checkout | [optional]
**pre_authorize** | **bool** | Indicates whether the order charges must be preauthorized | [optional] [default to false]
**processing_mode** | **string** | Indicates the processing mode for the order, either ecommerce, recurrent or validation. | [optional]
**return_url** | **string** | Indicates the redirection callback upon completion of the 3DS2 flow. | [optional]
**return_url** | **string** | Indicates the redirection callback upon completion of the 3DS2 flow. Do not use this parameter if your order has a checkout parameter | [optional]
**shipping_contact** | [**\Conekta\Model\CustomerShippingContacts**](CustomerShippingContacts.md) | | [optional]
**shipping_lines** | [**\Conekta\Model\ShippingRequest[]**](ShippingRequest.md) | List of [shipping costs](https://developers.conekta.com/v2.1.0/reference/orderscreateshipping). If the online store offers digital products. | [optional]
**tax_lines** | [**\Conekta\Model\OrderTaxRequest[]**](OrderTaxRequest.md) | List of [taxes](https://developers.conekta.com/v2.1.0/reference/orderscreatetaxes) that are applied to the order. | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/Model/PaymentMethodBankTransfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ Name | Type | Description | Notes
**receiving_account_tax_id** | **string** | | [optional]
**reference_number** | **string** | | [optional]
**tracking_code** | **string** | | [optional]
**customer_ip_address** | **string** | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
1 change: 1 addition & 0 deletions docs/Model/PaymentMethodCard.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ Name | Type | Description | Notes
**issuer** | **string** | Issuer of the card | [optional]
**last4** | **string** | Last 4 digits of the card | [optional]
**name** | **string** | Name of the cardholder | [optional]
**customer_ip_address** | **string** | Optional field used to capture the customer&#39;s IP address for fraud prevention and security monitoring purposes | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
1 change: 1 addition & 0 deletions docs/Model/PaymentMethodCardRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ Name | Type | Description | Notes
**exp_year** | **string** | Card expiration year |
**name** | **string** | Cardholder name |
**number** | **string** | Card number |
**customer_ip_address** | **string** | Optional field used to capture the customer&#39;s IP address for fraud prevention and security monitoring purposes | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
1 change: 1 addition & 0 deletions docs/Model/PaymentMethodCash.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ Name | Type | Description | Notes
**service_name** | **string** | | [optional]
**store** | **string** | | [optional]
**store_name** | **string** | | [optional]
**customer_ip_address** | **string** | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
2 changes: 2 additions & 0 deletions docs/Model/PaymentMethodGeneralRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Name | Type | Description | Notes
**type** | **string** | Type of payment method |
**token_id** | **string** | | [optional]
**payment_source_id** | **string** | | [optional]
**cvc** | **string** | Optional, It is a value that allows identifying the security code of the card. Only for PCI merchants | [optional]
**contract_id** | **string** | Optional id sent to indicate the bank contract for recurrent card charges. | [optional]
**customer_ip_address** | **string** | Optional field used to capture the customer&#39;s IP address for fraud prevention and security monitoring purposes | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
1 change: 1 addition & 0 deletions docs/Model/SubscriptionResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name | Type | Description | Notes
**billing_cycle_start** | **int** | | [optional]
**billing_cycle_end** | **int** | | [optional]
**canceled_at** | **int** | | [optional]
**canceled_reason** | **string** | Reason for cancellation. This field appears when the subscription status is &#39;canceled&#39;. | [optional]
**card_id** | **string** | | [optional]
**charge_id** | **string** | | [optional]
**created_at** | **int** | | [optional]
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.8';
protected $userAgent = 'Conekta/v2 PhpBindings/6.0.9';

/**
* 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.8' . PHP_EOL;
$report .= ' SDK Package Version: 6.0.9' . 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.8",
'bindings_version' => "6.0.9",
'lang' => 'php',
'lang_version' => phpversion(),
'publisher' => 'conekta',
Expand Down
34 changes: 34 additions & 0 deletions lib/Model/ChargeOrderResponsePaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class ChargeOrderResponsePaymentMethod implements ModelInterface, ArrayAccess, \
'service_name' => 'string',
'store' => 'string',
'store_name' => 'string',
'customer_ip_address' => 'string',
'account_type' => 'string',
'brand' => 'string',
'contract_id' => 'string',
Expand Down Expand Up @@ -113,6 +114,7 @@ class ChargeOrderResponsePaymentMethod implements ModelInterface, ArrayAccess, \
'service_name' => null,
'store' => null,
'store_name' => null,
'customer_ip_address' => null,
'account_type' => null,
'brand' => null,
'contract_id' => null,
Expand Down Expand Up @@ -156,6 +158,7 @@ class ChargeOrderResponsePaymentMethod implements ModelInterface, ArrayAccess, \
'service_name' => false,
'store' => true,
'store_name' => false,
'customer_ip_address' => false,
'account_type' => false,
'brand' => false,
'contract_id' => false,
Expand Down Expand Up @@ -279,6 +282,7 @@ public function isNullableSetToNull(string $property): bool
'service_name' => 'service_name',
'store' => 'store',
'store_name' => 'store_name',
'customer_ip_address' => 'customer_ip_address',
'account_type' => 'account_type',
'brand' => 'brand',
'contract_id' => 'contract_id',
Expand Down Expand Up @@ -322,6 +326,7 @@ public function isNullableSetToNull(string $property): bool
'service_name' => 'setServiceName',
'store' => 'setStore',
'store_name' => 'setStoreName',
'customer_ip_address' => 'setCustomerIpAddress',
'account_type' => 'setAccountType',
'brand' => 'setBrand',
'contract_id' => 'setContractId',
Expand Down Expand Up @@ -365,6 +370,7 @@ public function isNullableSetToNull(string $property): bool
'service_name' => 'getServiceName',
'store' => 'getStore',
'store_name' => 'getStoreName',
'customer_ip_address' => 'getCustomerIpAddress',
'account_type' => 'getAccountType',
'brand' => 'getBrand',
'contract_id' => 'getContractId',
Expand Down Expand Up @@ -459,6 +465,7 @@ public function __construct(array $data = null)
$this->setIfExists('service_name', $data ?? [], null);
$this->setIfExists('store', $data ?? [], null);
$this->setIfExists('store_name', $data ?? [], null);
$this->setIfExists('customer_ip_address', $data ?? [], null);
$this->setIfExists('account_type', $data ?? [], null);
$this->setIfExists('brand', $data ?? [], null);
$this->setIfExists('contract_id', $data ?? [], null);
Expand Down Expand Up @@ -818,6 +825,33 @@ public function setStoreName($store_name)
return $this;
}

/**
* Gets customer_ip_address
*
* @return string|null
*/
public function getCustomerIpAddress()
{
return $this->container['customer_ip_address'];
}

/**
* Sets customer_ip_address
*
* @param string|null $customer_ip_address customer_ip_address
*
* @return self
*/
public function setCustomerIpAddress($customer_ip_address)
{
if (is_null($customer_ip_address)) {
throw new \InvalidArgumentException('non-nullable customer_ip_address cannot be null');
}
$this->container['customer_ip_address'] = $customer_ip_address;

return $this;
}

/**
* Gets account_type
*
Expand Down
51 changes: 35 additions & 16 deletions lib/Model/ChargeRequestPaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class ChargeRequestPaymentMethod implements ModelInterface, ArrayAccess, \JsonSe
'exp_year' => 'string',
'name' => 'string',
'number' => 'string',
'customer_ip_address' => 'string',
'expires_at' => 'int',
'monthly_installments' => 'int',
'token_id' => 'string',
Expand All @@ -85,6 +86,7 @@ class ChargeRequestPaymentMethod implements ModelInterface, ArrayAccess, \JsonSe
'exp_year' => null,
'name' => null,
'number' => null,
'customer_ip_address' => null,
'expires_at' => 'int64',
'monthly_installments' => 'int8',
'token_id' => null,
Expand All @@ -104,6 +106,7 @@ class ChargeRequestPaymentMethod implements ModelInterface, ArrayAccess, \JsonSe
'exp_year' => false,
'name' => false,
'number' => false,
'customer_ip_address' => false,
'expires_at' => false,
'monthly_installments' => false,
'token_id' => false,
Expand Down Expand Up @@ -203,6 +206,7 @@ public function isNullableSetToNull(string $property): bool
'exp_year' => 'exp_year',
'name' => 'name',
'number' => 'number',
'customer_ip_address' => 'customer_ip_address',
'expires_at' => 'expires_at',
'monthly_installments' => 'monthly_installments',
'token_id' => 'token_id',
Expand All @@ -222,6 +226,7 @@ public function isNullableSetToNull(string $property): bool
'exp_year' => 'setExpYear',
'name' => 'setName',
'number' => 'setNumber',
'customer_ip_address' => 'setCustomerIpAddress',
'expires_at' => 'setExpiresAt',
'monthly_installments' => 'setMonthlyInstallments',
'token_id' => 'setTokenId',
Expand All @@ -241,6 +246,7 @@ public function isNullableSetToNull(string $property): bool
'exp_year' => 'getExpYear',
'name' => 'getName',
'number' => 'getNumber',
'customer_ip_address' => 'getCustomerIpAddress',
'expires_at' => 'getExpiresAt',
'monthly_installments' => 'getMonthlyInstallments',
'token_id' => 'getTokenId',
Expand Down Expand Up @@ -311,6 +317,7 @@ public function __construct(array $data = null)
$this->setIfExists('exp_year', $data ?? [], null);
$this->setIfExists('name', $data ?? [], null);
$this->setIfExists('number', $data ?? [], null);
$this->setIfExists('customer_ip_address', $data ?? [], null);
$this->setIfExists('expires_at', $data ?? [], null);
$this->setIfExists('monthly_installments', $data ?? [], null);
$this->setIfExists('token_id', $data ?? [], null);
Expand Down Expand Up @@ -351,14 +358,6 @@ public function listInvalidProperties()
if ($this->container['cvc'] === null) {
$invalidProperties[] = "'cvc' can't be null";
}
if ((mb_strlen($this->container['cvc']) > 4)) {
$invalidProperties[] = "invalid value for 'cvc', the character length must be smaller than or equal to 4.";
}

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

if ($this->container['exp_month'] === null) {
$invalidProperties[] = "'exp_month' can't be null";
}
Expand Down Expand Up @@ -442,7 +441,7 @@ public function getCvc()
/**
* Sets cvc
*
* @param string $cvc Card security code
* @param string $cvc Optional, It is a value that allows identifying the security code of the card. Only for PCI merchants
*
* @return self
*/
Expand All @@ -451,13 +450,6 @@ public function setCvc($cvc)
if (is_null($cvc)) {
throw new \InvalidArgumentException('non-nullable cvc cannot be null');
}
if ((mb_strlen($cvc) > 4)) {
throw new \InvalidArgumentException('invalid length for $cvc when calling ChargeRequestPaymentMethod., must be smaller than or equal to 4.');
}
if ((mb_strlen($cvc) < 3)) {
throw new \InvalidArgumentException('invalid length for $cvc when calling ChargeRequestPaymentMethod., must be bigger than or equal to 3.');
}

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

return $this;
Expand Down Expand Up @@ -585,6 +577,33 @@ public function setNumber($number)
return $this;
}

/**
* Gets customer_ip_address
*
* @return string|null
*/
public function getCustomerIpAddress()
{
return $this->container['customer_ip_address'];
}

/**
* Sets customer_ip_address
*
* @param string|null $customer_ip_address Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes
*
* @return self
*/
public function setCustomerIpAddress($customer_ip_address)
{
if (is_null($customer_ip_address)) {
throw new \InvalidArgumentException('non-nullable customer_ip_address cannot be null');
}
$this->container['customer_ip_address'] = $customer_ip_address;

return $this;
}

/**
* Gets expires_at
*
Expand Down
Loading

0 comments on commit 2ef9b46

Please sign in to comment.