Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI-124: Regenerate SDK #84

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
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
AI-124: Regenerate SDK
nicocedron committed Dec 17, 2024
commit 23d9fd80e9505cfded860a7a1308ca39883e4729
4 changes: 4 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -54,6 +54,8 @@ conekta/models/charge_response_refunds.py
conekta/models/charge_response_refunds_data.py
conekta/models/charge_update_request.py
conekta/models/charges_data_response.py
conekta/models/charges_order_response.py
conekta/models/charges_order_response_all_of_data.py
conekta/models/checkout.py
conekta/models/checkout_order_template.py
conekta/models/checkout_order_template_customer_info.py
@@ -235,6 +237,8 @@ docs/ChargeResponseRefundsData.md
docs/ChargeUpdateRequest.md
docs/ChargesApi.md
docs/ChargesDataResponse.md
docs/ChargesOrderResponse.md
docs/ChargesOrderResponseAllOfData.md
docs/Checkout.md
docs/CheckoutOrderTemplate.md
docs/CheckoutOrderTemplateCustomerInfo.md
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -109,6 +109,7 @@ Class | Method | HTTP request | Description
*BalancesApi* | [**get_balance**](docs/BalancesApi.md#get_balance) | **GET** /balance | Get a company's balance
*ChargesApi* | [**get_charges**](docs/ChargesApi.md#get_charges) | **GET** /charges | Get A List of Charges
*ChargesApi* | [**orders_create_charge**](docs/ChargesApi.md#orders_create_charge) | **POST** /orders/{id}/charges | Create charge
*ChargesApi* | [**orders_create_charges**](docs/ChargesApi.md#orders_create_charges) | **POST** /orders/{id}/add_charges | Create charges
*ChargesApi* | [**update_charge**](docs/ChargesApi.md#update_charge) | **PUT** /charges/{id} | Update a charge
*CompaniesApi* | [**get_companies**](docs/CompaniesApi.md#get_companies) | **GET** /companies | Get List of Companies
*CompaniesApi* | [**get_company**](docs/CompaniesApi.md#get_company) | **GET** /companies/{id} | Get Company
@@ -147,6 +148,7 @@ Class | Method | HTTP request | Description
*PaymentMethodsApi* | [**delete_customer_payment_methods**](docs/PaymentMethodsApi.md#delete_customer_payment_methods) | **DELETE** /customers/{id}/payment_sources/{payment_method_id} | Delete Payment Method
*PaymentMethodsApi* | [**get_customer_payment_methods**](docs/PaymentMethodsApi.md#get_customer_payment_methods) | **GET** /customers/{id}/payment_sources | Get Payment Methods
*PaymentMethodsApi* | [**update_customer_payment_methods**](docs/PaymentMethodsApi.md#update_customer_payment_methods) | **PUT** /customers/{id}/payment_sources/{payment_method_id} | Update Payment Method
*PayoutOrdersApi* | [**cancel_payout_order_by_id**](docs/PayoutOrdersApi.md#cancel_payout_order_by_id) | **PUT** /payout_orders/{id}/cancel | Cancel Payout Order
*PayoutOrdersApi* | [**create_payout_order**](docs/PayoutOrdersApi.md#create_payout_order) | **POST** /payout_orders | Create payout order
*PayoutOrdersApi* | [**get_payout_order_by_id**](docs/PayoutOrdersApi.md#get_payout_order_by_id) | **GET** /payout_orders/{id} | Get Payout Order
*PayoutOrdersApi* | [**get_payout_orders**](docs/PayoutOrdersApi.md#get_payout_orders) | **GET** /payout_orders | Get a list of Payout Orders
@@ -213,6 +215,8 @@ Class | Method | HTTP request | Description
- [ChargeResponseRefundsData](docs/ChargeResponseRefundsData.md)
- [ChargeUpdateRequest](docs/ChargeUpdateRequest.md)
- [ChargesDataResponse](docs/ChargesDataResponse.md)
- [ChargesOrderResponse](docs/ChargesOrderResponse.md)
- [ChargesOrderResponseAllOfData](docs/ChargesOrderResponseAllOfData.md)
- [Checkout](docs/Checkout.md)
- [CheckoutOrderTemplate](docs/CheckoutOrderTemplate.md)
- [CheckoutOrderTemplateCustomerInfo](docs/CheckoutOrderTemplateCustomerInfo.md)
2 changes: 2 additions & 0 deletions conekta/__init__.py
Original file line number Diff line number Diff line change
@@ -74,6 +74,8 @@
from conekta.models.charge_response_refunds_data import ChargeResponseRefundsData
from conekta.models.charge_update_request import ChargeUpdateRequest
from conekta.models.charges_data_response import ChargesDataResponse
from conekta.models.charges_order_response import ChargesOrderResponse
from conekta.models.charges_order_response_all_of_data import ChargesOrderResponseAllOfData
from conekta.models.checkout import Checkout
from conekta.models.checkout_order_template import CheckoutOrderTemplate
from conekta.models.checkout_order_template_customer_info import CheckoutOrderTemplateCustomerInfo
332 changes: 332 additions & 0 deletions conekta/api/charges_api.py
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@
from conekta.models.charge_request import ChargeRequest
from conekta.models.charge_response import ChargeResponse
from conekta.models.charge_update_request import ChargeUpdateRequest
from conekta.models.charges_order_response import ChargesOrderResponse
from conekta.models.get_charges_response import GetChargesResponse

from conekta.api_client import ApiClient, RequestSerialized
@@ -722,6 +723,337 @@ def _orders_create_charge_serialize(



@validate_call
def orders_create_charges(
self,
id: Annotated[StrictStr, Field(description="Identifier of the resource")],
charge_request: Annotated[ChargeRequest, Field(description="requested field for a charge")],
accept_language: Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None,
x_child_company_id: Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ChargesOrderResponse:
"""Create charges

Create charges for an existing orden

:param id: Identifier of the resource (required)
:type id: str
:param charge_request: requested field for a charge (required)
:type charge_request: ChargeRequest
:param accept_language: Use for knowing which language to use
:type accept_language: str
:param x_child_company_id: In the case of a holding company, the company id of the child company to which will process the request.
:type x_child_company_id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._orders_create_charges_serialize(
id=id,
charge_request=charge_request,
accept_language=accept_language,
x_child_company_id=x_child_company_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "ChargesOrderResponse",
'401': "Error",
'404': "Error",
'428': "Error",
'500': "Error",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data


@validate_call
def orders_create_charges_with_http_info(
self,
id: Annotated[StrictStr, Field(description="Identifier of the resource")],
charge_request: Annotated[ChargeRequest, Field(description="requested field for a charge")],
accept_language: Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None,
x_child_company_id: Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[ChargesOrderResponse]:
"""Create charges

Create charges for an existing orden

:param id: Identifier of the resource (required)
:type id: str
:param charge_request: requested field for a charge (required)
:type charge_request: ChargeRequest
:param accept_language: Use for knowing which language to use
:type accept_language: str
:param x_child_company_id: In the case of a holding company, the company id of the child company to which will process the request.
:type x_child_company_id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._orders_create_charges_serialize(
id=id,
charge_request=charge_request,
accept_language=accept_language,
x_child_company_id=x_child_company_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "ChargesOrderResponse",
'401': "Error",
'404': "Error",
'428': "Error",
'500': "Error",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)


@validate_call
def orders_create_charges_without_preload_content(
self,
id: Annotated[StrictStr, Field(description="Identifier of the resource")],
charge_request: Annotated[ChargeRequest, Field(description="requested field for a charge")],
accept_language: Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None,
x_child_company_id: Annotated[Optional[StrictStr], Field(description="In the case of a holding company, the company id of the child company to which will process the request.")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Create charges

Create charges for an existing orden

:param id: Identifier of the resource (required)
:type id: str
:param charge_request: requested field for a charge (required)
:type charge_request: ChargeRequest
:param accept_language: Use for knowing which language to use
:type accept_language: str
:param x_child_company_id: In the case of a holding company, the company id of the child company to which will process the request.
:type x_child_company_id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._orders_create_charges_serialize(
id=id,
charge_request=charge_request,
accept_language=accept_language,
x_child_company_id=x_child_company_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "ChargesOrderResponse",
'401': "Error",
'404': "Error",
'428': "Error",
'500': "Error",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response


def _orders_create_charges_serialize(
self,
id,
charge_request,
accept_language,
x_child_company_id,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:

_host = None

_collection_formats: Dict[str, str] = {
}

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None

# process the path parameters
if id is not None:
_path_params['id'] = id
# process the query parameters
# process the header parameters
if accept_language is not None:
_header_params['Accept-Language'] = accept_language
if x_child_company_id is not None:
_header_params['X-Child-Company-Id'] = x_child_company_id
# process the form parameters
# process the body parameter
if charge_request is not None:
_body_params = charge_request


# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/vnd.conekta-v2.1.0+json'
]
)

# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type

# authentication setting
_auth_settings: List[str] = [
'bearerAuth'
]

return self.api_client.param_serialize(
method='POST',
resource_path='/orders/{id}/add_charges',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)




@validate_call
def update_charge(
self,
285 changes: 285 additions & 0 deletions conekta/api/payout_orders_api.py
Original file line number Diff line number Diff line change
@@ -42,6 +42,291 @@ def __init__(self, api_client=None) -> None:
self.api_client = api_client


@validate_call
def cancel_payout_order_by_id(
self,
id: Annotated[StrictStr, Field(description="Identifier of the resource")],
accept_language: Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> PayoutOrderResponse:
"""Cancel Payout Order
Cancel a payout Order resource that corresponds to a payout order ID.
:param id: Identifier of the resource (required)
:type id: str
:param accept_language: Use for knowing which language to use
:type accept_language: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._cancel_payout_order_by_id_serialize(
id=id,
accept_language=accept_language,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "PayoutOrderResponse",
'401': "Error",
'404': "Error",
'500': "Error",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data


@validate_call
def cancel_payout_order_by_id_with_http_info(
self,
id: Annotated[StrictStr, Field(description="Identifier of the resource")],
accept_language: Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[PayoutOrderResponse]:
"""Cancel Payout Order
Cancel a payout Order resource that corresponds to a payout order ID.
:param id: Identifier of the resource (required)
:type id: str
:param accept_language: Use for knowing which language to use
:type accept_language: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._cancel_payout_order_by_id_serialize(
id=id,
accept_language=accept_language,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "PayoutOrderResponse",
'401': "Error",
'404': "Error",
'500': "Error",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)


@validate_call
def cancel_payout_order_by_id_without_preload_content(
self,
id: Annotated[StrictStr, Field(description="Identifier of the resource")],
accept_language: Annotated[Optional[StrictStr], Field(description="Use for knowing which language to use")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Cancel Payout Order
Cancel a payout Order resource that corresponds to a payout order ID.
:param id: Identifier of the resource (required)
:type id: str
:param accept_language: Use for knowing which language to use
:type accept_language: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._cancel_payout_order_by_id_serialize(
id=id,
accept_language=accept_language,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "PayoutOrderResponse",
'401': "Error",
'404': "Error",
'500': "Error",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response


def _cancel_payout_order_by_id_serialize(
self,
id,
accept_language,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:

_host = None

_collection_formats: Dict[str, str] = {
}

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None

# process the path parameters
if id is not None:
_path_params['id'] = id
# process the query parameters
# process the header parameters
if accept_language is not None:
_header_params['Accept-Language'] = accept_language
# process the form parameters
# process the body parameter


# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/vnd.conekta-v2.1.0+json'
]
)


# authentication setting
_auth_settings: List[str] = [
'bearerAuth'
]

return self.api_client.param_serialize(
method='PUT',
resource_path='/payout_orders/{id}/cancel',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)




@validate_call
def create_payout_order(
self,
2 changes: 2 additions & 0 deletions conekta/models/__init__.py
Original file line number Diff line number Diff line change
@@ -34,6 +34,8 @@
from conekta.models.charge_response_refunds_data import ChargeResponseRefundsData
from conekta.models.charge_update_request import ChargeUpdateRequest
from conekta.models.charges_data_response import ChargesDataResponse
from conekta.models.charges_order_response import ChargesOrderResponse
from conekta.models.charges_order_response_all_of_data import ChargesOrderResponseAllOfData
from conekta.models.checkout import Checkout
from conekta.models.checkout_order_template import CheckoutOrderTemplate
from conekta.models.checkout_order_template_customer_info import CheckoutOrderTemplateCustomerInfo
100 changes: 100 additions & 0 deletions conekta/models/charges_order_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# coding: utf-8

"""
Conekta API
Conekta sdk
The version of the OpenAPI document: 2.1.0
Contact: engineering@conekta.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import pprint
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from conekta.models.charges_order_response_all_of_data import ChargesOrderResponseAllOfData
from typing import Optional, Set
from typing_extensions import Self

class ChargesOrderResponse(BaseModel):
"""
The charges associated with the order
""" # noqa: E501
has_more: StrictBool = Field(description="Indicates if there are more pages to be requested")
object: StrictStr = Field(description="Object type, in this case is list")
data: Optional[List[ChargesOrderResponseAllOfData]] = None
__properties: ClassVar[List[str]] = ["has_more", "object", "data"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)


def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of ChargesOrderResponse from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in data (list)
_items = []
if self.data:
for _item_data in self.data:
if _item_data:
_items.append(_item_data.to_dict())
_dict['data'] = _items
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of ChargesOrderResponse from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({
"has_more": obj.get("has_more"),
"object": obj.get("object"),
"data": [ChargesOrderResponseAllOfData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None
})
return _obj


149 changes: 149 additions & 0 deletions conekta/models/charges_order_response_all_of_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# coding: utf-8

"""
Conekta API
Conekta sdk
The version of the OpenAPI document: 2.1.0
Contact: engineering@conekta.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import pprint
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from conekta.models.charge_response_channel import ChargeResponseChannel
from conekta.models.charge_response_payment_method import ChargeResponsePaymentMethod
from conekta.models.charge_response_refunds import ChargeResponseRefunds
from typing import Optional, Set
from typing_extensions import Self

class ChargesOrderResponseAllOfData(BaseModel):
"""
ChargesOrderResponseAllOfData
""" # noqa: E501
amount: Optional[StrictInt] = None
channel: Optional[ChargeResponseChannel] = None
created_at: Optional[StrictInt] = None
currency: Optional[StrictStr] = None
customer_id: Optional[StrictStr] = None
description: Optional[StrictStr] = None
device_fingerprint: Optional[StrictStr] = None
failure_code: Optional[StrictStr] = None
failure_message: Optional[StrictStr] = None
id: Optional[StrictStr] = Field(default=None, description="Charge ID")
livemode: Optional[StrictBool] = Field(default=None, description="Whether the charge was made in live mode or not")
object: Optional[StrictStr] = None
order_id: Optional[StrictStr] = Field(default=None, description="Order ID")
paid_at: Optional[StrictInt] = Field(default=None, description="Payment date")
payment_method: Optional[ChargeResponsePaymentMethod] = None
reference_id: Optional[StrictStr] = Field(default=None, description="Reference ID of the charge")
refunds: Optional[ChargeResponseRefunds] = None
status: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["amount", "channel", "created_at", "currency", "customer_id", "description", "device_fingerprint", "failure_code", "failure_message", "id", "livemode", "object", "order_id", "paid_at", "payment_method", "reference_id", "refunds", "status"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)


def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of ChargesOrderResponseAllOfData from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of channel
if self.channel:
_dict['channel'] = self.channel.to_dict()
# override the default output from pydantic by calling `to_dict()` of payment_method
if self.payment_method:
_dict['payment_method'] = self.payment_method.to_dict()
# override the default output from pydantic by calling `to_dict()` of refunds
if self.refunds:
_dict['refunds'] = self.refunds.to_dict()
# set to None if paid_at (nullable) is None
# and model_fields_set contains the field
if self.paid_at is None and "paid_at" in self.model_fields_set:
_dict['paid_at'] = None

# set to None if reference_id (nullable) is None
# and model_fields_set contains the field
if self.reference_id is None and "reference_id" in self.model_fields_set:
_dict['reference_id'] = None

# set to None if refunds (nullable) is None
# and model_fields_set contains the field
if self.refunds is None and "refunds" in self.model_fields_set:
_dict['refunds'] = None

return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of ChargesOrderResponseAllOfData from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({
"amount": obj.get("amount"),
"channel": ChargeResponseChannel.from_dict(obj["channel"]) if obj.get("channel") is not None else None,
"created_at": obj.get("created_at"),
"currency": obj.get("currency"),
"customer_id": obj.get("customer_id"),
"description": obj.get("description"),
"device_fingerprint": obj.get("device_fingerprint"),
"failure_code": obj.get("failure_code"),
"failure_message": obj.get("failure_message"),
"id": obj.get("id"),
"livemode": obj.get("livemode"),
"object": obj.get("object"),
"order_id": obj.get("order_id"),
"paid_at": obj.get("paid_at"),
"payment_method": ChargeResponsePaymentMethod.from_dict(obj["payment_method"]) if obj.get("payment_method") is not None else None,
"reference_id": obj.get("reference_id"),
"refunds": ChargeResponseRefunds.from_dict(obj["refunds"]) if obj.get("refunds") is not None else None,
"status": obj.get("status")
})
return _obj


4 changes: 3 additions & 1 deletion conekta/models/checkout_request.py
Original file line number Diff line number Diff line change
@@ -32,12 +32,13 @@ class CheckoutRequest(BaseModel):
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
monthly_installments_options: Optional[List[StrictInt]] = None
max_failed_retries: Optional[StrictInt] = Field(default=None, description="Number of retries allowed before the checkout is marked as failed")
name: Optional[StrictStr] = Field(default=None, description="Reason for payment")
on_demand_enabled: Optional[StrictBool] = None
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", "name", "on_demand_enabled", "redirection_time", "success_url", "type"]
__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"]

model_config = ConfigDict(
populate_by_name=True,
@@ -95,6 +96,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"failure_url": obj.get("failure_url"),
"monthly_installments_enabled": obj.get("monthly_installments_enabled"),
"monthly_installments_options": obj.get("monthly_installments_options"),
"max_failed_retries": obj.get("max_failed_retries"),
"name": obj.get("name"),
"on_demand_enabled": obj.get("on_demand_enabled"),
"redirection_time": obj.get("redirection_time"),
6 changes: 5 additions & 1 deletion conekta/models/customer.py
Original file line number Diff line number Diff line change
@@ -35,18 +35,20 @@ class Customer(BaseModel):
antifraud_info: Optional[CustomerAntifraudInfo] = None
corporate: Optional[StrictBool] = Field(default=False, description="It is a value that allows identifying if the email is corporate or not.")
custom_reference: Optional[StrictStr] = Field(default=None, description="It is an undefined value.")
date_of_birth: Optional[StrictStr] = Field(default=None, description="It is a parameter that allows to identify the date of birth of the client.")
email: StrictStr = Field(description="An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc).")
default_payment_source_id: Optional[StrictStr] = Field(default=None, description="It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id)")
default_shipping_contact_id: Optional[StrictStr] = Field(default=None, description="It is a parameter that allows to identify in the response, the Conekta ID of the shipping address (shipping_contact)")
fiscal_entities: Optional[List[CustomerFiscalEntitiesRequest]] = None
metadata: Optional[Dict[str, Any]] = None
name: StrictStr = Field(description="Client's name")
national_id: Optional[StrictStr] = Field(default=None, description="It is a parameter that allows to identify the national identification number of the client.")
payment_sources: Optional[List[CustomerPaymentMethodsRequest]] = Field(default=None, description="Contains details of the payment methods that the customer has active or has used in Conekta")
phone: StrictStr = Field(description="Is the customer's phone number")
plan_id: Optional[StrictStr] = Field(default=None, description="Contains the ID of a plan, which could together with name, email and phone create a client directly to a subscription")
shipping_contacts: Optional[List[CustomerShippingContacts]] = Field(default=None, description="Contains the detail of the shipping addresses that the client has active or has used in Conekta")
subscription: Optional[SubscriptionRequest] = None
__properties: ClassVar[List[str]] = ["antifraud_info", "corporate", "custom_reference", "email", "default_payment_source_id", "default_shipping_contact_id", "fiscal_entities", "metadata", "name", "payment_sources", "phone", "plan_id", "shipping_contacts", "subscription"]
__properties: ClassVar[List[str]] = ["antifraud_info", "corporate", "custom_reference", "date_of_birth", "email", "default_payment_source_id", "default_shipping_contact_id", "fiscal_entities", "metadata", "name", "national_id", "payment_sources", "phone", "plan_id", "shipping_contacts", "subscription"]

model_config = ConfigDict(
populate_by_name=True,
@@ -134,12 +136,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"antifraud_info": CustomerAntifraudInfo.from_dict(obj["antifraud_info"]) if obj.get("antifraud_info") is not None else None,
"corporate": obj.get("corporate") if obj.get("corporate") is not None else False,
"custom_reference": obj.get("custom_reference"),
"date_of_birth": obj.get("date_of_birth"),
"email": obj.get("email"),
"default_payment_source_id": obj.get("default_payment_source_id"),
"default_shipping_contact_id": obj.get("default_shipping_contact_id"),
"fiscal_entities": [CustomerFiscalEntitiesRequest.from_dict(_item) for _item in obj["fiscal_entities"]] if obj.get("fiscal_entities") is not None else None,
"metadata": obj.get("metadata"),
"name": obj.get("name"),
"national_id": obj.get("national_id"),
"payment_sources": [CustomerPaymentMethodsRequest.from_dict(_item) for _item in obj["payment_sources"]] if obj.get("payment_sources") is not None else None,
"phone": obj.get("phone"),
"plan_id": obj.get("plan_id"),
6 changes: 5 additions & 1 deletion conekta/models/customer_response.py
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@ class CustomerResponse(BaseModel):
corporate: Optional[StrictBool] = Field(default=None, description="true if the customer is a company")
created_at: StrictInt = Field(description="Creation date of the object")
custom_reference: Optional[StrictStr] = Field(default=None, description="Custom reference")
date_of_birth: Optional[StrictStr] = Field(default=None, description="It is a parameter that allows to identify the date of birth of the client.")
default_fiscal_entity_id: Optional[StrictStr] = None
default_shipping_contact_id: Optional[StrictStr] = None
default_payment_source_id: Optional[StrictStr] = None
@@ -44,13 +45,14 @@ class CustomerResponse(BaseModel):
id: StrictStr = Field(description="Customer's ID")
livemode: StrictBool = Field(description="true if the object exists in live mode or the value false if the object exists in test mode")
name: StrictStr = Field(description="Customer's name")
national_id: Optional[StrictStr] = Field(default=None, description="It is a parameter that allows to identify the national identification number of the client.")
metadata: Optional[Dict[str, Any]] = None
object: StrictStr
payment_sources: Optional[CustomerPaymentMethodsResponse] = None
phone: Optional[StrictStr] = Field(default=None, description="Customer's phone number")
shipping_contacts: Optional[CustomerResponseShippingContacts] = None
subscription: Optional[SubscriptionResponse] = None
__properties: ClassVar[List[str]] = ["antifraud_info", "corporate", "created_at", "custom_reference", "default_fiscal_entity_id", "default_shipping_contact_id", "default_payment_source_id", "email", "fiscal_entities", "id", "livemode", "name", "metadata", "object", "payment_sources", "phone", "shipping_contacts", "subscription"]
__properties: ClassVar[List[str]] = ["antifraud_info", "corporate", "created_at", "custom_reference", "date_of_birth", "default_fiscal_entity_id", "default_shipping_contact_id", "default_payment_source_id", "email", "fiscal_entities", "id", "livemode", "name", "national_id", "metadata", "object", "payment_sources", "phone", "shipping_contacts", "subscription"]

model_config = ConfigDict(
populate_by_name=True,
@@ -137,6 +139,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"corporate": obj.get("corporate"),
"created_at": obj.get("created_at"),
"custom_reference": obj.get("custom_reference"),
"date_of_birth": obj.get("date_of_birth"),
"default_fiscal_entity_id": obj.get("default_fiscal_entity_id"),
"default_shipping_contact_id": obj.get("default_shipping_contact_id"),
"default_payment_source_id": obj.get("default_payment_source_id"),
@@ -145,6 +148,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"id": obj.get("id"),
"livemode": obj.get("livemode"),
"name": obj.get("name"),
"national_id": obj.get("national_id"),
"metadata": obj.get("metadata"),
"object": obj.get("object"),
"payment_sources": CustomerPaymentMethodsResponse.from_dict(obj["payment_sources"]) if obj.get("payment_sources") is not None else None,
5 changes: 0 additions & 5 deletions conekta/models/order_refund_request.py
Original file line number Diff line number Diff line change
@@ -71,11 +71,6 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# set to None if expires_at (nullable) is None
# and model_fields_set contains the field
if self.expires_at is None and "expires_at" in self.model_fields_set:
_dict['expires_at'] = None

return _dict

@classmethod
9 changes: 8 additions & 1 deletion conekta/models/order_response_checkout.py
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ class OrderResponseCheckout(BaseModel):
id: Optional[StrictStr] = None
is_redirect_on_failure: Optional[StrictBool] = None
livemode: Optional[StrictBool] = None
max_failed_retries: Optional[StrictInt] = Field(default=None, description="Number of retries allowed before the checkout is marked as failed")
metadata: Optional[Dict[str, Any]] = None
monthly_installments_enabled: Optional[StrictBool] = None
monthly_installments_options: Optional[List[StrictInt]] = None
@@ -54,7 +55,7 @@ class OrderResponseCheckout(BaseModel):
status: 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", "is_redirect_on_failure", "livemode", "metadata", "monthly_installments_enabled", "monthly_installments_options", "name", "needs_shipping_contact", "object", "on_demand_enabled", "paid_payments_count", "recurrent", "redirection_time", "slug", "sms_sent", "success_url", "starts_at", "status", "type", "url"]
__properties: ClassVar[List[str]] = ["allowed_payment_methods", "can_not_expire", "emails_sent", "exclude_card_networks", "expires_at", "failure_url", "force_3ds_flow", "id", "is_redirect_on_failure", "livemode", "max_failed_retries", "metadata", "monthly_installments_enabled", "monthly_installments_options", "name", "needs_shipping_contact", "object", "on_demand_enabled", "paid_payments_count", "recurrent", "redirection_time", "slug", "sms_sent", "success_url", "starts_at", "status", "type", "url"]

model_config = ConfigDict(
populate_by_name=True,
@@ -95,6 +96,11 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# set to None if max_failed_retries (nullable) is None
# and model_fields_set contains the field
if self.max_failed_retries is None and "max_failed_retries" in self.model_fields_set:
_dict['max_failed_retries'] = None

# set to None if on_demand_enabled (nullable) is None
# and model_fields_set contains the field
if self.on_demand_enabled is None and "on_demand_enabled" in self.model_fields_set:
@@ -127,6 +133,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"id": obj.get("id"),
"is_redirect_on_failure": obj.get("is_redirect_on_failure"),
"livemode": obj.get("livemode"),
"max_failed_retries": obj.get("max_failed_retries"),
"metadata": obj.get("metadata"),
"monthly_installments_enabled": obj.get("monthly_installments_enabled"),
"monthly_installments_options": obj.get("monthly_installments_options"),
8 changes: 6 additions & 2 deletions conekta/models/payment_method_cash.py
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
@@ -29,16 +29,18 @@ class PaymentMethodCash(BaseModel):
""" # noqa: E501
type: Optional[StrictStr] = None
object: StrictStr
agreement: Optional[StrictStr] = Field(default=None, description="Agreement ID")
auth_code: Optional[StrictInt] = None
cashier_id: Optional[StrictStr] = None
reference: Optional[StrictStr] = None
barcode_url: Optional[StrictStr] = None
expires_at: Optional[StrictInt] = None
product_type: Optional[StrictStr] = Field(default=None, description="Product type, e.g. bbva_cash_in, cash_in, pespay_cash_in, etc.")
service_name: Optional[StrictStr] = None
store: Optional[StrictStr] = None
store_name: Optional[StrictStr] = None
customer_ip_address: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["type", "object", "auth_code", "cashier_id", "reference", "barcode_url", "expires_at", "service_name", "store", "store_name", "customer_ip_address"]
__properties: ClassVar[List[str]] = ["type", "object", "agreement", "auth_code", "cashier_id", "reference", "barcode_url", "expires_at", "product_type", "service_name", "store", "store_name", "customer_ip_address"]

model_config = ConfigDict(
populate_by_name=True,
@@ -108,11 +110,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
_obj = cls.model_validate({
"type": obj.get("type"),
"object": obj.get("object"),
"agreement": obj.get("agreement"),
"auth_code": obj.get("auth_code"),
"cashier_id": obj.get("cashier_id"),
"reference": obj.get("reference"),
"barcode_url": obj.get("barcode_url"),
"expires_at": obj.get("expires_at"),
"product_type": obj.get("product_type"),
"service_name": obj.get("service_name"),
"store": obj.get("store"),
"store_name": obj.get("store_name"),
6 changes: 5 additions & 1 deletion conekta/models/update_customer.py
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ class UpdateCustomer(BaseModel):
update customer
""" # noqa: E501
antifraud_info: Optional[UpdateCustomerAntifraudInfo] = None
date_of_birth: Optional[StrictStr] = Field(default=None, description="It is a parameter that allows to identify the date of birth of the client.")
default_payment_source_id: Optional[StrictStr] = Field(default=None, description="It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id)")
email: Optional[StrictStr] = Field(default=None, description="An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc).")
name: Optional[StrictStr] = Field(default=None, description="Client's name")
@@ -43,10 +44,11 @@ class UpdateCustomer(BaseModel):
custom_reference: Optional[StrictStr] = Field(default=None, description="It is an undefined value.")
fiscal_entities: Optional[List[CustomerFiscalEntitiesRequest]] = None
metadata: Optional[Dict[str, Any]] = None
national_id: Optional[StrictStr] = Field(default=None, description="It is a parameter that allows to identify the national identification number of the client.")
payment_sources: Optional[List[CustomerPaymentMethodsRequest]] = Field(default=None, description="Contains details of the payment methods that the customer has active or has used in Conekta")
shipping_contacts: Optional[List[CustomerShippingContacts]] = Field(default=None, description="Contains the detail of the shipping addresses that the client has active or has used in Conekta")
subscription: Optional[SubscriptionRequest] = None
__properties: ClassVar[List[str]] = ["antifraud_info", "default_payment_source_id", "email", "name", "phone", "plan_id", "default_shipping_contact_id", "corporate", "custom_reference", "fiscal_entities", "metadata", "payment_sources", "shipping_contacts", "subscription"]
__properties: ClassVar[List[str]] = ["antifraud_info", "date_of_birth", "default_payment_source_id", "email", "name", "phone", "plan_id", "default_shipping_contact_id", "corporate", "custom_reference", "fiscal_entities", "metadata", "national_id", "payment_sources", "shipping_contacts", "subscription"]

model_config = ConfigDict(
populate_by_name=True,
@@ -132,6 +134,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

_obj = cls.model_validate({
"antifraud_info": UpdateCustomerAntifraudInfo.from_dict(obj["antifraud_info"]) if obj.get("antifraud_info") is not None else None,
"date_of_birth": obj.get("date_of_birth"),
"default_payment_source_id": obj.get("default_payment_source_id"),
"email": obj.get("email"),
"name": obj.get("name"),
@@ -142,6 +145,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"custom_reference": obj.get("custom_reference"),
"fiscal_entities": [CustomerFiscalEntitiesRequest.from_dict(_item) for _item in obj["fiscal_entities"]] if obj.get("fiscal_entities") is not None else None,
"metadata": obj.get("metadata"),
"national_id": obj.get("national_id"),
"payment_sources": [CustomerPaymentMethodsRequest.from_dict(_item) for _item in obj["payment_sources"]] if obj.get("payment_sources") is not None else None,
"shipping_contacts": [CustomerShippingContacts.from_dict(_item) for _item in obj["shipping_contacts"]] if obj.get("shipping_contacts") is not None else None,
"subscription": SubscriptionRequest.from_dict(obj["subscription"]) if obj.get("subscription") is not None else None
2 changes: 2 additions & 0 deletions docs/ChargeOrderResponsePaymentMethod.md
Original file line number Diff line number Diff line change
@@ -7,11 +7,13 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | | [optional]
**object** | **str** | |
**agreement** | **str** | Agreement ID | [optional]
**auth_code** | **str** | | [optional]
**cashier_id** | **str** | | [optional]
**reference** | **str** | | [optional]
**barcode_url** | **str** | | [optional]
**expires_at** | **int** | | [optional]
**product_type** | **str** | Product type, e.g. bbva_cash_in, cash_in, pespay_cash_in, etc. | [optional]
**service_name** | **str** | | [optional]
**store** | **str** | | [optional]
**store_name** | **str** | | [optional]
2 changes: 2 additions & 0 deletions docs/ChargeResponsePaymentMethod.md
Original file line number Diff line number Diff line change
@@ -7,11 +7,13 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | | [optional]
**object** | **str** | |
**agreement** | **str** | Agreement ID | [optional]
**auth_code** | **str** | | [optional]
**cashier_id** | **str** | | [optional]
**reference** | **str** | | [optional]
**barcode_url** | **str** | | [optional]
**expires_at** | **int** | | [optional]
**product_type** | **str** | Product type, e.g. bbva_cash_in, cash_in, pespay_cash_in, etc. | [optional]
**service_name** | **str** | | [optional]
**store** | **str** | | [optional]
**store_name** | **str** | | [optional]
90 changes: 90 additions & 0 deletions docs/ChargesApi.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ Method | HTTP request | Description
------------- | ------------- | -------------
[**get_charges**](ChargesApi.md#get_charges) | **GET** /charges | Get A List of Charges
[**orders_create_charge**](ChargesApi.md#orders_create_charge) | **POST** /orders/{id}/charges | Create charge
[**orders_create_charges**](ChargesApi.md#orders_create_charges) | **POST** /orders/{id}/add_charges | Create charges
[**update_charge**](ChargesApi.md#update_charge) | **PUT** /charges/{id} | Update a charge


@@ -186,6 +187,95 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **orders_create_charges**
> ChargesOrderResponse orders_create_charges(id, charge_request, accept_language=accept_language, x_child_company_id=x_child_company_id)
Create charges

Create charges for an existing orden

### Example

* Bearer Authentication (bearerAuth):

```python
import conekta
from conekta.models.charge_request import ChargeRequest
from conekta.models.charges_order_response import ChargesOrderResponse
from conekta.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.conekta.io
# See configuration.py for a list of all supported configuration parameters.
configuration = conekta.Configuration(
host = "https://api.conekta.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = conekta.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with conekta.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = conekta.ChargesApi(api_client)
id = '6307a60c41de27127515a575' # str | Identifier of the resource
charge_request = conekta.ChargeRequest() # ChargeRequest | requested field for a charge
accept_language = es # str | Use for knowing which language to use (optional) (default to es)
x_child_company_id = '6441b6376b60c3a638da80af' # str | In the case of a holding company, the company id of the child company to which will process the request. (optional)

try:
# Create charges
api_response = api_instance.orders_create_charges(id, charge_request, accept_language=accept_language, x_child_company_id=x_child_company_id)
print("The response of ChargesApi->orders_create_charges:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChargesApi->orders_create_charges: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **str**| Identifier of the resource |
**charge_request** | [**ChargeRequest**](ChargeRequest.md)| requested field for a charge |
**accept_language** | **str**| Use for knowing which language to use | [optional] [default to es]
**x_child_company_id** | **str**| In the case of a holding company, the company id of the child company to which will process the request. | [optional]

### Return type

[**ChargesOrderResponse**](ChargesOrderResponse.md)

### Authorization

[bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/vnd.conekta-v2.1.0+json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful | - |
**401** | authentication error | - |
**404** | not found entity | - |
**428** | Precondition Required | - |
**500** | internal server error | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **update_charge**
> ChargeResponse update_charge(id, charge_update_request, accept_language=accept_language, x_child_company_id=x_child_company_id)
32 changes: 32 additions & 0 deletions docs/ChargesOrderResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ChargesOrderResponse

The charges associated with the order

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**has_more** | **bool** | Indicates if there are more pages to be requested |
**object** | **str** | Object type, in this case is list |
**data** | [**List[ChargesOrderResponseAllOfData]**](ChargesOrderResponseAllOfData.md) | | [optional]

## Example

```python
from conekta.models.charges_order_response import ChargesOrderResponse

# TODO update the JSON string below
json = "{}"
# create an instance of ChargesOrderResponse from a JSON string
charges_order_response_instance = ChargesOrderResponse.from_json(json)
# print the JSON string representation of the object
print(ChargesOrderResponse.to_json())

# convert the object into a dict
charges_order_response_dict = charges_order_response_instance.to_dict()
# create an instance of ChargesOrderResponse from a dict
charges_order_response_from_dict = ChargesOrderResponse.from_dict(charges_order_response_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


46 changes: 46 additions & 0 deletions docs/ChargesOrderResponseAllOfData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ChargesOrderResponseAllOfData


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amount** | **int** | | [optional]
**channel** | [**ChargeResponseChannel**](ChargeResponseChannel.md) | | [optional]
**created_at** | **int** | | [optional]
**currency** | **str** | | [optional]
**customer_id** | **str** | | [optional]
**description** | **str** | | [optional]
**device_fingerprint** | **str** | | [optional]
**failure_code** | **str** | | [optional]
**failure_message** | **str** | | [optional]
**id** | **str** | Charge ID | [optional]
**livemode** | **bool** | Whether the charge was made in live mode or not | [optional]
**object** | **str** | | [optional]
**order_id** | **str** | Order ID | [optional]
**paid_at** | **int** | Payment date | [optional]
**payment_method** | [**ChargeResponsePaymentMethod**](ChargeResponsePaymentMethod.md) | | [optional]
**reference_id** | **str** | Reference ID of the charge | [optional]
**refunds** | [**ChargeResponseRefunds**](ChargeResponseRefunds.md) | | [optional]
**status** | **str** | | [optional]

## Example

```python
from conekta.models.charges_order_response_all_of_data import ChargesOrderResponseAllOfData

# TODO update the JSON string below
json = "{}"
# create an instance of ChargesOrderResponseAllOfData from a JSON string
charges_order_response_all_of_data_instance = ChargesOrderResponseAllOfData.from_json(json)
# print the JSON string representation of the object
print(ChargesOrderResponseAllOfData.to_json())

# convert the object into a dict
charges_order_response_all_of_data_dict = charges_order_response_all_of_data_instance.to_dict()
# create an instance of ChargesOrderResponseAllOfData from a dict
charges_order_response_all_of_data_from_dict = ChargesOrderResponseAllOfData.from_dict(charges_order_response_all_of_data_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


1 change: 1 addition & 0 deletions docs/CheckoutRequest.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ Name | Type | Description | Notes
**failure_url** | **str** | Redirection url back to the site in case of failed payment, applies only to HostedPayment. | [optional]
**monthly_installments_enabled** | **bool** | | [optional]
**monthly_installments_options** | **List[int]** | | [optional]
**max_failed_retries** | **int** | Number of retries allowed before the checkout is marked as failed | [optional]
**name** | **str** | Reason for payment | [optional]
**on_demand_enabled** | **bool** | | [optional]
**redirection_time** | **int** | number of seconds to wait before redirecting to the success_url | [optional]
2 changes: 2 additions & 0 deletions docs/Customer.md
Original file line number Diff line number Diff line change
@@ -9,12 +9,14 @@ Name | Type | Description | Notes
**antifraud_info** | [**CustomerAntifraudInfo**](CustomerAntifraudInfo.md) | | [optional]
**corporate** | **bool** | It is a value that allows identifying if the email is corporate or not. | [optional] [default to False]
**custom_reference** | **str** | It is an undefined value. | [optional]
**date_of_birth** | **str** | It is a parameter that allows to identify the date of birth of the client. | [optional]
**email** | **str** | An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc). |
**default_payment_source_id** | **str** | It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id) | [optional]
**default_shipping_contact_id** | **str** | It is a parameter that allows to identify in the response, the Conekta ID of the shipping address (shipping_contact) | [optional]
**fiscal_entities** | [**List[CustomerFiscalEntitiesRequest]**](CustomerFiscalEntitiesRequest.md) | | [optional]
**metadata** | **Dict[str, object]** | | [optional]
**name** | **str** | Client's name |
**national_id** | **str** | It is a parameter that allows to identify the national identification number of the client. | [optional]
**payment_sources** | [**List[CustomerPaymentMethodsRequest]**](CustomerPaymentMethodsRequest.md) | Contains details of the payment methods that the customer has active or has used in Conekta | [optional]
**phone** | **str** | Is the customer's phone number |
**plan_id** | **str** | Contains the ID of a plan, which could together with name, email and phone create a client directly to a subscription | [optional]
2 changes: 2 additions & 0 deletions docs/CustomerResponse.md
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
**corporate** | **bool** | true if the customer is a company | [optional]
**created_at** | **int** | Creation date of the object |
**custom_reference** | **str** | Custom reference | [optional]
**date_of_birth** | **str** | It is a parameter that allows to identify the date of birth of the client. | [optional]
**default_fiscal_entity_id** | **str** | | [optional]
**default_shipping_contact_id** | **str** | | [optional]
**default_payment_source_id** | **str** | | [optional]
@@ -18,6 +19,7 @@ Name | Type | Description | Notes
**id** | **str** | Customer's ID |
**livemode** | **bool** | true if the object exists in live mode or the value false if the object exists in test mode |
**name** | **str** | Customer's name |
**national_id** | **str** | It is a parameter that allows to identify the national identification number of the client. | [optional]
**metadata** | **Dict[str, object]** | | [optional]
**object** | **str** | |
**payment_sources** | [**CustomerPaymentMethodsResponse**](CustomerPaymentMethodsResponse.md) | | [optional]
1 change: 1 addition & 0 deletions docs/OrderResponseCheckout.md
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ Name | Type | Description | Notes
**id** | **str** | | [optional]
**is_redirect_on_failure** | **bool** | | [optional]
**livemode** | **bool** | | [optional]
**max_failed_retries** | **int** | Number of retries allowed before the checkout is marked as failed | [optional]
**metadata** | **Dict[str, object]** | | [optional]
**monthly_installments_enabled** | **bool** | | [optional]
**monthly_installments_options** | **List[int]** | | [optional]
2 changes: 2 additions & 0 deletions docs/PaymentMethodCash.md
Original file line number Diff line number Diff line change
@@ -7,11 +7,13 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | | [optional]
**object** | **str** | |
**agreement** | **str** | Agreement ID | [optional]
**auth_code** | **int** | | [optional]
**cashier_id** | **str** | | [optional]
**reference** | **str** | | [optional]
**barcode_url** | **str** | | [optional]
**expires_at** | **int** | | [optional]
**product_type** | **str** | Product type, e.g. bbva_cash_in, cash_in, pespay_cash_in, etc. | [optional]
**service_name** | **str** | | [optional]
**store** | **str** | | [optional]
**store_name** | **str** | | [optional]
84 changes: 84 additions & 0 deletions docs/PayoutOrdersApi.md
Original file line number Diff line number Diff line change
@@ -4,11 +4,95 @@ All URIs are relative to *https://api.conekta.io*

Method | HTTP request | Description
------------- | ------------- | -------------
[**cancel_payout_order_by_id**](PayoutOrdersApi.md#cancel_payout_order_by_id) | **PUT** /payout_orders/{id}/cancel | Cancel Payout Order
[**create_payout_order**](PayoutOrdersApi.md#create_payout_order) | **POST** /payout_orders | Create payout order
[**get_payout_order_by_id**](PayoutOrdersApi.md#get_payout_order_by_id) | **GET** /payout_orders/{id} | Get Payout Order
[**get_payout_orders**](PayoutOrdersApi.md#get_payout_orders) | **GET** /payout_orders | Get a list of Payout Orders


# **cancel_payout_order_by_id**
> PayoutOrderResponse cancel_payout_order_by_id(id, accept_language=accept_language)
Cancel Payout Order

Cancel a payout Order resource that corresponds to a payout order ID.

### Example

* Bearer Authentication (bearerAuth):

```python
import conekta
from conekta.models.payout_order_response import PayoutOrderResponse
from conekta.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.conekta.io
# See configuration.py for a list of all supported configuration parameters.
configuration = conekta.Configuration(
host = "https://api.conekta.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = conekta.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with conekta.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = conekta.PayoutOrdersApi(api_client)
id = '6307a60c41de27127515a575' # str | Identifier of the resource
accept_language = es # str | Use for knowing which language to use (optional) (default to es)

try:
# Cancel Payout Order
api_response = api_instance.cancel_payout_order_by_id(id, accept_language=accept_language)
print("The response of PayoutOrdersApi->cancel_payout_order_by_id:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PayoutOrdersApi->cancel_payout_order_by_id: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **str**| Identifier of the resource |
**accept_language** | **str**| Use for knowing which language to use | [optional] [default to es]

### Return type

[**PayoutOrderResponse**](PayoutOrderResponse.md)

### Authorization

[bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/vnd.conekta-v2.1.0+json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**401** | authentication error | - |
**404** | not found entity | - |
**500** | internal server error | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **create_payout_order**
> PayoutOrderResponse create_payout_order(payout_order, accept_language=accept_language)
2 changes: 2 additions & 0 deletions docs/UpdateCustomer.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ update customer
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**antifraud_info** | [**UpdateCustomerAntifraudInfo**](UpdateCustomerAntifraudInfo.md) | | [optional]
**date_of_birth** | **str** | It is a parameter that allows to identify the date of birth of the client. | [optional]
**default_payment_source_id** | **str** | It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id) | [optional]
**email** | **str** | An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc). | [optional]
**name** | **str** | Client's name | [optional]
@@ -17,6 +18,7 @@ Name | Type | Description | Notes
**custom_reference** | **str** | It is an undefined value. | [optional]
**fiscal_entities** | [**List[CustomerFiscalEntitiesRequest]**](CustomerFiscalEntitiesRequest.md) | | [optional]
**metadata** | **Dict[str, object]** | | [optional]
**national_id** | **str** | It is a parameter that allows to identify the national identification number of the client. | [optional]
**payment_sources** | [**List[CustomerPaymentMethodsRequest]**](CustomerPaymentMethodsRequest.md) | Contains details of the payment methods that the customer has active or has used in Conekta | [optional]
**shipping_contacts** | [**List[CustomerShippingContacts]**](CustomerShippingContacts.md) | Contains the detail of the shipping addresses that the client has active or has used in Conekta | [optional]
**subscription** | [**SubscriptionRequest**](SubscriptionRequest.md) | | [optional]