Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.0
7.0.1
2 changes: 1 addition & 1 deletion conekta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions conekta/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion conekta/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 4 additions & 2 deletions conekta/models/checkout_order_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down
16 changes: 13 additions & 3 deletions conekta/models/checkout_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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"),
Expand Down
4 changes: 3 additions & 1 deletion conekta/models/checkout_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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"),
Expand Down
4 changes: 2 additions & 2 deletions config-python.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
1 change: 1 addition & 0 deletions docs/CheckoutOrderTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docs/CheckoutRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Comment thread
mar-js marked this conversation as resolved.
Outdated
**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]
Expand Down
1 change: 1 addition & 0 deletions docs/CheckoutResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "conekta"
version = "7.0.0"
version = "7.0.1"
description = "Conekta API"
authors = ["Engineering Conekta <engineering@conekta.com>"]
license = "MIT-LICENSE"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down