From 0fa9d6ed3ea46937898f11f579e5a8f962c477bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Nicol=C3=A1s=20Cedr=C3=B3n?= Date: Tue, 17 Dec 2024 19:33:55 -0300 Subject: [PATCH] AI-124: Regenerate SDK (#84) --- .openapi-generator/FILES | 4 + README.md | 4 + conekta/__init__.py | 2 + conekta/api/charges_api.py | 332 ++++++++++++++++++ conekta/api/payout_orders_api.py | 285 +++++++++++++++ conekta/models/__init__.py | 2 + conekta/models/charges_order_response.py | 100 ++++++ .../charges_order_response_all_of_data.py | 149 ++++++++ conekta/models/checkout_request.py | 4 +- conekta/models/customer.py | 6 +- conekta/models/customer_response.py | 6 +- conekta/models/order_refund_request.py | 5 - conekta/models/order_response_checkout.py | 9 +- conekta/models/payment_method_cash.py | 8 +- conekta/models/update_customer.py | 6 +- docs/ChargeOrderResponsePaymentMethod.md | 2 + docs/ChargeResponsePaymentMethod.md | 2 + docs/ChargesApi.md | 90 +++++ docs/ChargesOrderResponse.md | 32 ++ docs/ChargesOrderResponseAllOfData.md | 46 +++ docs/CheckoutRequest.md | 1 + docs/Customer.md | 2 + docs/CustomerResponse.md | 2 + docs/OrderResponseCheckout.md | 1 + docs/PaymentMethodCash.md | 2 + docs/PayoutOrdersApi.md | 84 +++++ docs/UpdateCustomer.md | 2 + 27 files changed, 1176 insertions(+), 12 deletions(-) create mode 100644 conekta/models/charges_order_response.py create mode 100644 conekta/models/charges_order_response_all_of_data.py create mode 100644 docs/ChargesOrderResponse.md create mode 100644 docs/ChargesOrderResponseAllOfData.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ea3250c..916fefa 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -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 diff --git a/README.md b/README.md index 4ab410c..f959a3a 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/conekta/__init__.py b/conekta/__init__.py index 721a2b5..079c075 100644 --- a/conekta/__init__.py +++ b/conekta/__init__.py @@ -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 diff --git a/conekta/api/charges_api.py b/conekta/api/charges_api.py index a5fdb70..01f6dac 100644 --- a/conekta/api/charges_api.py +++ b/conekta/api/charges_api.py @@ -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, diff --git a/conekta/api/payout_orders_api.py b/conekta/api/payout_orders_api.py index 9ef738f..93591be 100644 --- a/conekta/api/payout_orders_api.py +++ b/conekta/api/payout_orders_api.py @@ -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, diff --git a/conekta/models/__init__.py b/conekta/models/__init__.py index 5ae4baf..d887153 100644 --- a/conekta/models/__init__.py +++ b/conekta/models/__init__.py @@ -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 diff --git a/conekta/models/charges_order_response.py b/conekta/models/charges_order_response.py new file mode 100644 index 0000000..df5c93a --- /dev/null +++ b/conekta/models/charges_order_response.py @@ -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 + + diff --git a/conekta/models/charges_order_response_all_of_data.py b/conekta/models/charges_order_response_all_of_data.py new file mode 100644 index 0000000..53a2955 --- /dev/null +++ b/conekta/models/charges_order_response_all_of_data.py @@ -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 + + diff --git a/conekta/models/checkout_request.py b/conekta/models/checkout_request.py index c49c5b6..412d687 100644 --- a/conekta/models/checkout_request.py +++ b/conekta/models/checkout_request.py @@ -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"), diff --git a/conekta/models/customer.py b/conekta/models/customer.py index 8e1b863..48fca66 100644 --- a/conekta/models/customer.py +++ b/conekta/models/customer.py @@ -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"), diff --git a/conekta/models/customer_response.py b/conekta/models/customer_response.py index a049186..60f356c 100644 --- a/conekta/models/customer_response.py +++ b/conekta/models/customer_response.py @@ -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, diff --git a/conekta/models/order_refund_request.py b/conekta/models/order_refund_request.py index 41ecdca..c3ac02c 100644 --- a/conekta/models/order_refund_request.py +++ b/conekta/models/order_refund_request.py @@ -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 diff --git a/conekta/models/order_response_checkout.py b/conekta/models/order_response_checkout.py index 22b88a4..5efafb5 100644 --- a/conekta/models/order_response_checkout.py +++ b/conekta/models/order_response_checkout.py @@ -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"), diff --git a/conekta/models/payment_method_cash.py b/conekta/models/payment_method_cash.py index 32594bf..747000d 100644 --- a/conekta/models/payment_method_cash.py +++ b/conekta/models/payment_method_cash.py @@ -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"), diff --git a/conekta/models/update_customer.py b/conekta/models/update_customer.py index edd51e7..8f0ed76 100644 --- a/conekta/models/update_customer.py +++ b/conekta/models/update_customer.py @@ -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 diff --git a/docs/ChargeOrderResponsePaymentMethod.md b/docs/ChargeOrderResponsePaymentMethod.md index 7b642f1..e6a3e1a 100644 --- a/docs/ChargeOrderResponsePaymentMethod.md +++ b/docs/ChargeOrderResponsePaymentMethod.md @@ -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] diff --git a/docs/ChargeResponsePaymentMethod.md b/docs/ChargeResponsePaymentMethod.md index 425cf76..403778b 100644 --- a/docs/ChargeResponsePaymentMethod.md +++ b/docs/ChargeResponsePaymentMethod.md @@ -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] diff --git a/docs/ChargesApi.md b/docs/ChargesApi.md index f16d255..7c50e9e 100644 --- a/docs/ChargesApi.md +++ b/docs/ChargesApi.md @@ -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) diff --git a/docs/ChargesOrderResponse.md b/docs/ChargesOrderResponse.md new file mode 100644 index 0000000..82bf875 --- /dev/null +++ b/docs/ChargesOrderResponse.md @@ -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) + + diff --git a/docs/ChargesOrderResponseAllOfData.md b/docs/ChargesOrderResponseAllOfData.md new file mode 100644 index 0000000..91ae218 --- /dev/null +++ b/docs/ChargesOrderResponseAllOfData.md @@ -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) + + diff --git a/docs/CheckoutRequest.md b/docs/CheckoutRequest.md index 71cd1ec..e4db4da 100644 --- a/docs/CheckoutRequest.md +++ b/docs/CheckoutRequest.md @@ -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] diff --git a/docs/Customer.md b/docs/Customer.md index 639948b..e97c6c5 100644 --- a/docs/Customer.md +++ b/docs/Customer.md @@ -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] diff --git a/docs/CustomerResponse.md b/docs/CustomerResponse.md index 0db34e5..7a56066 100644 --- a/docs/CustomerResponse.md +++ b/docs/CustomerResponse.md @@ -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] diff --git a/docs/OrderResponseCheckout.md b/docs/OrderResponseCheckout.md index db3386f..c64d469 100644 --- a/docs/OrderResponseCheckout.md +++ b/docs/OrderResponseCheckout.md @@ -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] diff --git a/docs/PaymentMethodCash.md b/docs/PaymentMethodCash.md index 7de22d9..9c00308 100644 --- a/docs/PaymentMethodCash.md +++ b/docs/PaymentMethodCash.md @@ -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] diff --git a/docs/PayoutOrdersApi.md b/docs/PayoutOrdersApi.md index 9c59460..765be3c 100644 --- a/docs/PayoutOrdersApi.md +++ b/docs/PayoutOrdersApi.md @@ -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) diff --git a/docs/UpdateCustomer.md b/docs/UpdateCustomer.md index 9867490..dfd6c9e 100644 --- a/docs/UpdateCustomer.md +++ b/docs/UpdateCustomer.md @@ -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]