From 5249fa3e5aed53d31826919619bd69b5cf05d35e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Ag=C3=BCera?= Date: Mon, 28 Apr 2025 17:53:31 -0300 Subject: [PATCH 1/2] the version was updated from 7.0.0 to 7.0.1 --- README.md | 2 +- VERSION | 2 +- conekta/__init__.py | 2 +- conekta/api_client.py | 4 ++-- conekta/configuration.py | 2 +- conekta/models/checkout_order_template.py | 6 ++++-- conekta/models/checkout_request.py | 16 +++++++++++++--- conekta/models/checkout_response.py | 4 +++- config-python.json | 4 ++-- docs/CheckoutOrderTemplate.md | 1 + docs/CheckoutRequest.md | 3 ++- docs/CheckoutResponse.md | 1 + pyproject.toml | 2 +- setup.py | 2 +- 14 files changed, 34 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 9ce5184..62a11aa 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Conekta sdk This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 2.2.0 -- Package version: 7.0.0 +- Package version: 7.0.1 - Generator version: 7.9.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://github.com/conekta/openapi/issues](https://github.com/conekta/openapi/issues) diff --git a/VERSION b/VERSION index 66ce77b..9fe9ff9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.0.0 +7.0.1 diff --git a/conekta/__init__.py b/conekta/__init__.py index 4525d21..f4f13b3 100644 --- a/conekta/__init__.py +++ b/conekta/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "7.0.0" +__version__ = "7.0.1" # import apis into sdk package from conekta.api.antifraud_api import AntifraudApi diff --git a/conekta/api_client.py b/conekta/api_client.py index 96cfa57..b319531 100644 --- a/conekta/api_client.py +++ b/conekta/api_client.py @@ -74,7 +74,7 @@ class ApiClient: 'lang': 'python', 'lang_version': platform.python_version(), 'publisher': 'conekta', - 'bindings_version': '7.0.0', + 'bindings_version': '7.0.1', 'uname': platform.uname() } _pool = None @@ -97,7 +97,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Conekta/v2 PythonBindings/7.0.0' + self.user_agent = 'Conekta/v2 PythonBindings/7.0.1' self.conekta_user_agent = json.dumps(self.data) self.client_side_validation = configuration.client_side_validation diff --git a/conekta/configuration.py b/conekta/configuration.py index 16892f0..acce865 100644 --- a/conekta/configuration.py +++ b/conekta/configuration.py @@ -393,7 +393,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 2.2.0\n"\ - "SDK Package Version: 7.0.0".\ + "SDK Package Version: 7.0.1".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/conekta/models/checkout_order_template.py b/conekta/models/checkout_order_template.py index 61fcd23..ebe2a7d 100644 --- a/conekta/models/checkout_order_template.py +++ b/conekta/models/checkout_order_template.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from conekta.models.checkout_order_template_customer_info import CheckoutOrderTemplateCustomerInfo @@ -33,8 +33,9 @@ class CheckoutOrderTemplate(BaseModel): currency: Annotated[str, Field(strict=True, max_length=3)] = Field(description="It is the currency in which the order will be created. It must be a valid ISO 4217 currency code.") customer_info: Optional[CheckoutOrderTemplateCustomerInfo] = None line_items: List[Product] = Field(description="They are the products to buy. Each contains the \"unit price\" and \"quantity\" parameters that are used to calculate the total amount of the order.") + plan_ids: Optional[List[StrictStr]] = Field(default=None, description="It is a list of plan IDs that will be associated with the order.") metadata: Optional[Dict[str, Any]] = Field(default=None, description="It is a set of key-value pairs that you can attach to the order. It can be used to store additional information about the order in a structured format.") - __properties: ClassVar[List[str]] = ["currency", "customer_info", "line_items", "metadata"] + __properties: ClassVar[List[str]] = ["currency", "customer_info", "line_items", "plan_ids", "metadata"] model_config = ConfigDict( populate_by_name=True, @@ -100,6 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "currency": obj.get("currency"), "customer_info": CheckoutOrderTemplateCustomerInfo.from_dict(obj["customer_info"]) if obj.get("customer_info") is not None else None, "line_items": [Product.from_dict(_item) for _item in obj["line_items"]] if obj.get("line_items") is not None else None, + "plan_ids": obj.get("plan_ids"), "metadata": obj.get("metadata") }) return _obj diff --git a/conekta/models/checkout_request.py b/conekta/models/checkout_request.py index 89f8342..ee0b1f6 100644 --- a/conekta/models/checkout_request.py +++ b/conekta/models/checkout_request.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -27,7 +27,8 @@ class CheckoutRequest(BaseModel): """ [Checkout](https://developers.conekta.com/v2.2.0/reference/payment-link) details """ # noqa: E501 - allowed_payment_methods: List[StrictStr] = Field(description="Are the payment methods available for this link") + allowed_payment_methods: List[StrictStr] = Field(description="Are the payment methods available for this link. For subscriptions, only 'card' is allowed due to the recurring nature of the payments.") + plan_ids: Optional[List[StrictStr]] = Field(default=None, description="List of plan IDs that will be available for subscription. This field is required for subscription payments.") expires_at: Optional[StrictInt] = Field(default=None, description="Unix timestamp of checkout expiration") failure_url: Optional[StrictStr] = Field(default=None, description="Redirection url back to the site in case of failed payment, applies only to HostedPayment.") monthly_installments_enabled: Optional[StrictBool] = None @@ -38,7 +39,15 @@ class CheckoutRequest(BaseModel): redirection_time: Optional[StrictInt] = Field(default=None, description="number of seconds to wait before redirecting to the success_url") success_url: Optional[StrictStr] = Field(default=None, description="Redirection url back to the site in case of successful payment, applies only to HostedPayment") type: Optional[StrictStr] = Field(default=None, description="This field represents the type of checkout") - __properties: ClassVar[List[str]] = ["allowed_payment_methods", "expires_at", "failure_url", "monthly_installments_enabled", "monthly_installments_options", "max_failed_retries", "name", "on_demand_enabled", "redirection_time", "success_url", "type"] + __properties: ClassVar[List[str]] = ["allowed_payment_methods", "plan_ids", "expires_at", "failure_url", "monthly_installments_enabled", "monthly_installments_options", "max_failed_retries", "name", "on_demand_enabled", "redirection_time", "success_url", "type"] + + @field_validator('allowed_payment_methods') + def allowed_payment_methods_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(['cash', 'card', 'bank_transfer', 'bnpl']): + raise ValueError("each list item must be one of ('cash', 'card', 'bank_transfer', 'bnpl')") + return value model_config = ConfigDict( populate_by_name=True, @@ -92,6 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "allowed_payment_methods": obj.get("allowed_payment_methods"), + "plan_ids": obj.get("plan_ids"), "expires_at": obj.get("expires_at"), "failure_url": obj.get("failure_url"), "monthly_installments_enabled": obj.get("monthly_installments_enabled"), diff --git a/conekta/models/checkout_response.py b/conekta/models/checkout_response.py index 2d45f8f..f1f0c48 100644 --- a/conekta/models/checkout_response.py +++ b/conekta/models/checkout_response.py @@ -28,6 +28,7 @@ class CheckoutResponse(BaseModel): checkout response """ # noqa: E501 allowed_payment_methods: Optional[List[StrictStr]] = Field(default=None, description="Are the payment methods available for this link") + plan_ids: Optional[List[StrictStr]] = Field(default=None, description="List of plan IDs that are available for subscription") can_not_expire: Optional[StrictBool] = None emails_sent: Optional[StrictInt] = None exclude_card_networks: Optional[List[Dict[str, Any]]] = None @@ -52,7 +53,7 @@ class CheckoutResponse(BaseModel): success_url: Optional[StrictStr] = None type: Optional[StrictStr] = None url: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["allowed_payment_methods", "can_not_expire", "emails_sent", "exclude_card_networks", "expires_at", "failure_url", "force_3ds_flow", "id", "livemode", "metadata", "monthly_installments_enabled", "monthly_installments_options", "name", "needs_shipping_contact", "object", "paid_payments_count", "payments_limit_count", "recurrent", "slug", "sms_sent", "starts_at", "status", "success_url", "type", "url"] + __properties: ClassVar[List[str]] = ["allowed_payment_methods", "plan_ids", "can_not_expire", "emails_sent", "exclude_card_networks", "expires_at", "failure_url", "force_3ds_flow", "id", "livemode", "metadata", "monthly_installments_enabled", "monthly_installments_options", "name", "needs_shipping_contact", "object", "paid_payments_count", "payments_limit_count", "recurrent", "slug", "sms_sent", "starts_at", "status", "success_url", "type", "url"] model_config = ConfigDict( populate_by_name=True, @@ -111,6 +112,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "allowed_payment_methods": obj.get("allowed_payment_methods"), + "plan_ids": obj.get("plan_ids"), "can_not_expire": obj.get("can_not_expire"), "emails_sent": obj.get("emails_sent"), "exclude_card_networks": obj.get("exclude_card_networks"), diff --git a/config-python.json b/config-python.json index 249861a..cdf3f21 100644 --- a/config-python.json +++ b/config-python.json @@ -7,14 +7,14 @@ "licenseName": "MIT License", "licenseUrl": "https://www.opensource.org/licenses/mit-license.php", "generateSourceCodeOnly": "false", - "packageVersion": "7.0.0", + "packageVersion": "7.0.1", "packageUrl": "https://github.com/conekta/conekta-python", "projectName": "conekta", "templateDir": "/local/templates/python", "hasBearerMethods" : true, "useOneOfDiscriminatorLookup" : true, "nonCompliantUseDiscriminatorIfCompositionFails" : false, - "httpUserAgent": "Conekta/v2 PythonBindings/7.0.0", + "httpUserAgent": "Conekta/v2 PythonBindings/7.0.1", "files": { "/local/AUTHORS.md" : {}, "/local/CODE_OF_CONDUCT.md": {}, diff --git a/docs/CheckoutOrderTemplate.md b/docs/CheckoutOrderTemplate.md index 7b84fe4..7cc2dc7 100644 --- a/docs/CheckoutOrderTemplate.md +++ b/docs/CheckoutOrderTemplate.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **currency** | **str** | It is the currency in which the order will be created. It must be a valid ISO 4217 currency code. | **customer_info** | [**CheckoutOrderTemplateCustomerInfo**](CheckoutOrderTemplateCustomerInfo.md) | | [optional] **line_items** | [**List[Product]**](Product.md) | They are the products to buy. Each contains the \"unit price\" and \"quantity\" parameters that are used to calculate the total amount of the order. | +**plan_ids** | **List[str]** | It is a list of plan IDs that will be associated with the order. | [optional] **metadata** | **Dict[str, object]** | It is a set of key-value pairs that you can attach to the order. It can be used to store additional information about the order in a structured format. | [optional] ## Example diff --git a/docs/CheckoutRequest.md b/docs/CheckoutRequest.md index 076aa24..046d175 100644 --- a/docs/CheckoutRequest.md +++ b/docs/CheckoutRequest.md @@ -6,7 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**allowed_payment_methods** | **List[str]** | Are the payment methods available for this link | +**allowed_payment_methods** | **List[str]** | Are the payment methods available for this link. For subscriptions, only 'card' is allowed due to the recurring nature of the payments. | +**plan_ids** | **List[str]** | List of plan IDs that will be available for subscription. This field is required for subscription payments. | [optional] **expires_at** | **int** | Unix timestamp of checkout expiration | [optional] **failure_url** | **str** | Redirection url back to the site in case of failed payment, applies only to HostedPayment. | [optional] **monthly_installments_enabled** | **bool** | | [optional] diff --git a/docs/CheckoutResponse.md b/docs/CheckoutResponse.md index 7e6a3ee..ee8c6b8 100644 --- a/docs/CheckoutResponse.md +++ b/docs/CheckoutResponse.md @@ -7,6 +7,7 @@ checkout response Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **allowed_payment_methods** | **List[str]** | Are the payment methods available for this link | [optional] +**plan_ids** | **List[str]** | List of plan IDs that are available for subscription | [optional] **can_not_expire** | **bool** | | [optional] **emails_sent** | **int** | | [optional] **exclude_card_networks** | **List[object]** | | [optional] diff --git a/pyproject.toml b/pyproject.toml index 52d5d42..d4ad3ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "conekta" -version = "7.0.0" +version = "7.0.1" description = "Conekta API" authors = ["Engineering Conekta "] license = "MIT-LICENSE" diff --git a/setup.py b/setup.py index 66f8173..621a22b 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "conekta" -VERSION = "7.0.0" +VERSION = "7.0.1" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ "urllib3 >= 1.25.3, < 3.0.0", From 39a0235c62a0db7892ce9e570682f3ed68d9363e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Ag=C3=BCera?= Date: Mon, 28 Apr 2025 18:37:00 -0300 Subject: [PATCH 2/2] feat: updated the description of the plan_ids field in CheckoutRequest.md to clarify its use in different payment types --- docs/CheckoutRequest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CheckoutRequest.md b/docs/CheckoutRequest.md index 046d175..c6fb3fa 100644 --- a/docs/CheckoutRequest.md +++ b/docs/CheckoutRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **allowed_payment_methods** | **List[str]** | Are the payment methods available for this link. For subscriptions, only 'card' is allowed due to the recurring nature of the payments. | -**plan_ids** | **List[str]** | List of plan IDs that will be available for subscription. This field is required for subscription payments. | [optional] +**plan_ids** | **List[str]** | List of plan IDs that will be available for subscription. This field is required for subscription payments but optional for other types of payments. | **expires_at** | **int** | Unix timestamp of checkout expiration | [optional] **failure_url** | **str** | Redirection url back to the site in case of failed payment, applies only to HostedPayment. | [optional] **monthly_installments_enabled** | **bool** | | [optional]