diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 2e89e0b..1dea1f1 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -3,6 +3,8 @@ Monei/api/__init__.py Monei/api/apple_pay_certificate_api.py Monei/api/apple_pay_domain_api.py Monei/api/bizum_api.py +Monei/api/cardholder_verification_api.py +Monei/api/checkout_sessions_api.py Monei/api/customers_api.py Monei/api/payment_methods_api.py Monei/api/payments_api.py @@ -11,6 +13,7 @@ Monei/api/prices_api.py Monei/api/products_api.py Monei/api/subscriptions_api.py Monei/api/tax_rates_api.py +Monei/api/verification_of_payee_api.py Monei/api_client.py Monei/apis/__init__.py Monei/configuration.py @@ -28,11 +31,22 @@ Monei/model/bizum_validate_phone200_response.py Monei/model/cancel_payment_request.py Monei/model/cancel_subscription_request.py Monei/model/capture_payment_request.py +Monei/model/cardholder_verification.py +Monei/model/cardholder_verification_card.py +Monei/model/checkout_session.py +Monei/model/checkout_session_billing_address_collection.py +Monei/model/checkout_session_business_purchase.py +Monei/model/checkout_session_line_item.py +Monei/model/checkout_session_line_item_request.py +Monei/model/checkout_session_list.py +Monei/model/checkout_session_mode.py +Monei/model/checkout_session_status.py Monei/model/confirm_payment_request.py Monei/model/confirm_payment_request_payment_method.py Monei/model/confirm_payment_request_payment_method_card.py Monei/model/conflict_error.py Monei/model/conflict_error_all_of.py +Monei/model/create_checkout_session_request.py Monei/model/create_customer_request.py Monei/model/create_payment_request.py Monei/model/create_pos_auth_token_request.py @@ -48,6 +62,7 @@ Monei/model/internal_server_error_all_of.py Monei/model/not_found_error.py Monei/model/not_found_error_all_of.py Monei/model/pause_subscription_request.py +Monei/model/payee_verification.py Monei/model/payment.py Monei/model/payment_billing_details.py Monei/model/payment_cancellation_reason.py @@ -156,6 +171,8 @@ Monei/model/update_product_request.py Monei/model/update_subscription_request.py Monei/model/update_tax_rate_request.py Monei/model/validate_bizum_phone_request.py +Monei/model/verify_cardholder_request.py +Monei/model/verify_payee_request.py Monei/model_utils.py Monei/models/__init__.py Monei/rest.py diff --git a/Monei/__init__.py b/Monei/__init__.py index f2be386..679e965 100644 --- a/Monei/__init__.py +++ b/Monei/__init__.py @@ -31,3 +31,4 @@ from Monei.models import * from Monei.apis import * from Monei.exceptions import * +import Monei.redaction # masks card data in model reprs diff --git a/Monei/api/cardholder_verification_api.py b/Monei/api/cardholder_verification_api.py new file mode 100644 index 0000000..7380088 --- /dev/null +++ b/Monei/api/cardholder_verification_api.py @@ -0,0 +1,143 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.api_client import ApiClient, Endpoint as _Endpoint +from Monei.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types, +) +from Monei.model.api_exception import ApiException +from Monei.model.bad_request_error import BadRequestError +from Monei.model.cardholder_verification import CardholderVerification +from Monei.model.internal_server_error import InternalServerError +from Monei.model.service_unavailable_error import ServiceUnavailableError +from Monei.model.unauthorized_error import UnauthorizedError +from Monei.model.verify_cardholder_request import VerifyCardholderRequest + + +class CardholderVerificationApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.verify_endpoint = _Endpoint( + settings={ + "response_type": (CardholderVerification,), + "auth": ["APIKey"], + "endpoint_path": "/cardholder/verify", + "operation_id": "verify", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": [ + "verify_cardholder_request", + ], + "required": [ + "verify_cardholder_request", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "verify_cardholder_request": (VerifyCardholderRequest,), + }, + "attribute_map": {}, + "location_map": { + "verify_cardholder_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={ + "accept": ["application/json"], + "content_type": ["application/json"], + }, + api_client=api_client, + ) + + def verify(self, verify_cardholder_request, **kwargs): + """Verify Cardholder # noqa: E501 + + Checks a cardholder name against a card and waits for the verdict of the issuer. Send the card as the `paymentToken` of a payment of your account, or as `card` when your integration is PCI DSS compliant and already sends card numbers to `POST /v1/payments`. Send one of the two, never both. The payment token is not used up: you can pay with it afterwards. The verdict: - `MATCH` - The issuer confirmed the name. - `PARTIAL_MATCH` - Some parts of the name match and others do not, for example the last name matches and the first name does not. - `NO_MATCH` - The name differs from the name the issuer holds. - `NOT_AVAILABLE` - No verdict: the card is not Visa or Mastercard, the card network or the issuer cannot check this card now, or the name has characters the network does not take. Not billed. Each call is one check. A check that got a verdict is billed even when your client stops waiting before the response arrives. Live mode only: an API key of a test account gets `403`. An account can run at most 200 checks in 24 hours; above that the call gets `429`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.verify(verify_cardholder_request, async_req=True) + >>> result = thread.get() + + Args: + verify_cardholder_request (VerifyCardholderRequest): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): 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. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + CardholderVerification + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) + kwargs["_content_type"] = kwargs.get("_content_type") + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["_request_auths"] = kwargs.get("_request_auths", None) + kwargs["verify_cardholder_request"] = verify_cardholder_request + return self.verify_endpoint.call_with_http_info(**kwargs) diff --git a/Monei/api/checkout_sessions_api.py b/Monei/api/checkout_sessions_api.py new file mode 100644 index 0000000..e52237e --- /dev/null +++ b/Monei/api/checkout_sessions_api.py @@ -0,0 +1,359 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.api_client import ApiClient, Endpoint as _Endpoint +from Monei.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types, +) +from Monei.model.bad_request_error import BadRequestError +from Monei.model.checkout_session import CheckoutSession +from Monei.model.checkout_session_list import CheckoutSessionList +from Monei.model.create_checkout_session_request import CreateCheckoutSessionRequest +from Monei.model.internal_server_error import InternalServerError +from Monei.model.not_found_error import NotFoundError +from Monei.model.service_unavailable_error import ServiceUnavailableError +from Monei.model.unauthorized_error import UnauthorizedError +from Monei.model.unprocessable_entity_error import UnprocessableEntityError + + +class CheckoutSessionsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.create_endpoint = _Endpoint( + settings={ + "response_type": (CheckoutSession,), + "auth": ["APIKey"], + "endpoint_path": "/checkout-sessions", + "operation_id": "create", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": [ + "create_checkout_session_request", + ], + "required": [ + "create_checkout_session_request", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "create_checkout_session_request": (CreateCheckoutSessionRequest,), + }, + "attribute_map": {}, + "location_map": { + "create_checkout_session_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={ + "accept": ["application/json"], + "content_type": ["application/json"], + }, + api_client=api_client, + ) + self.get_endpoint = _Endpoint( + settings={ + "response_type": (CheckoutSession,), + "auth": ["APIKey"], + "endpoint_path": "/checkout-sessions/{id}", + "operation_id": "get", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": [ + "id", + ], + "required": [ + "id", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "id": (str,), + }, + "attribute_map": { + "id": "id", + }, + "location_map": { + "id": "path", + }, + "collection_format_map": {}, + }, + headers_map={ + "accept": ["application/json"], + "content_type": [], + }, + api_client=api_client, + ) + self.list_endpoint = _Endpoint( + settings={ + "response_type": (CheckoutSessionList,), + "auth": ["APIKey"], + "endpoint_path": "/checkout-sessions", + "operation_id": "list", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": [ + "limit", + "cursor", + ], + "required": [], + "nullable": [], + "enum": [], + "validation": [ + "limit", + ], + }, + root_map={ + "validations": { + ("limit",): { + "inclusive_maximum": 100, + "inclusive_minimum": 1, + }, + }, + "allowed_values": {}, + "openapi_types": { + "limit": (int,), + "cursor": (str,), + }, + "attribute_map": { + "limit": "limit", + "cursor": "cursor", + }, + "location_map": { + "limit": "query", + "cursor": "query", + }, + "collection_format_map": {}, + }, + headers_map={ + "accept": ["application/json"], + "content_type": [], + }, + api_client=api_client, + ) + + def create(self, create_checkout_session_request, **kwargs): + """Create Checkout Session # noqa: E501 + + Creates a checkout session and returns it with its `url`. Send the buyer to the `url` to pay. No payment and no subscription exist until the buyer opens the `url`. **Lines**: Send from 1 to 20 lines. Every price must be active and of your account, and all prices must have the same currency. At most one price is `RECURRING`, and its quantity is `1`. A price, product, tax rate or customer that is not found is rejected with `404`. **Business purchases**: With `businessPurchase` set to `OPTIONAL` or `REQUIRED`, the buyer can give a company name, a tax ID and a full address. A Spanish tax ID is checked. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create(create_checkout_session_request, async_req=True) + >>> result = thread.get() + + Args: + create_checkout_session_request (CreateCheckoutSessionRequest): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): 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. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + CheckoutSession + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) + kwargs["_content_type"] = kwargs.get("_content_type") + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["_request_auths"] = kwargs.get("_request_auths", None) + kwargs["create_checkout_session_request"] = create_checkout_session_request + return self.create_endpoint.call_with_http_info(**kwargs) + + def get(self, id, **kwargs): + """Get Checkout Session # noqa: E501 + + Retrieves a checkout session by its unique ID. A checkout session of another merchant account is reported as not found. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get(id, async_req=True) + >>> result = thread.get() + + Args: + id (str): The checkout session ID + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): 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. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + CheckoutSession + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) + kwargs["_content_type"] = kwargs.get("_content_type") + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["_request_auths"] = kwargs.get("_request_auths", None) + kwargs["id"] = id + return self.get_endpoint.call_with_http_info(**kwargs) + + def list(self, **kwargs): + """List Checkout Sessions # noqa: E501 + + Lists the checkout sessions of your account, newest first, one page at a time. To get the next page, send the `nextCursor` of the response as `cursor`. When there are no more items, the response has no `nextCursor`. The last page can still carry one, and the next call then returns no items. A session you just created can take a moment to appear in the list. [Get Checkout Session](https://docs.monei.com/apis/rest/checkout-sessions-get/) returns it at once. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list(async_req=True) + >>> result = thread.get() + + + Keyword Args: + limit (int): Number of items in one page, from 1 to 100.. [optional] if omitted the server will use the default value of 20 + cursor (str): The `nextCursor` of the previous page. Omit it to get the first page.. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): 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. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + CheckoutSessionList + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) + kwargs["_content_type"] = kwargs.get("_content_type") + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["_request_auths"] = kwargs.get("_request_auths", None) + return self.list_endpoint.call_with_http_info(**kwargs) diff --git a/Monei/api/verification_of_payee_api.py b/Monei/api/verification_of_payee_api.py new file mode 100644 index 0000000..1ea2031 --- /dev/null +++ b/Monei/api/verification_of_payee_api.py @@ -0,0 +1,143 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.api_client import ApiClient, Endpoint as _Endpoint +from Monei.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types, +) +from Monei.model.api_exception import ApiException +from Monei.model.bad_request_error import BadRequestError +from Monei.model.internal_server_error import InternalServerError +from Monei.model.payee_verification import PayeeVerification +from Monei.model.service_unavailable_error import ServiceUnavailableError +from Monei.model.unauthorized_error import UnauthorizedError +from Monei.model.verify_payee_request import VerifyPayeeRequest + + +class VerificationOfPayeeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.verify_endpoint = _Endpoint( + settings={ + "response_type": (PayeeVerification,), + "auth": ["APIKey"], + "endpoint_path": "/vop/verify", + "operation_id": "verify", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": [ + "verify_payee_request", + ], + "required": [ + "verify_payee_request", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "verify_payee_request": (VerifyPayeeRequest,), + }, + "attribute_map": {}, + "location_map": { + "verify_payee_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={ + "accept": ["application/json"], + "content_type": ["application/json"], + }, + api_client=api_client, + ) + + def verify(self, verify_payee_request, **kwargs): + """Verify Payee # noqa: E501 + + Checks a payee name against an IBAN and waits for the verdict of the bank that holds the IBAN. The verdict: - `MATCH` - The bank confirmed that the name is the holder of the IBAN. - `CLOSE_MATCH` - The name is close to the holder's name. `canonicalName` holds the name the bank has. - `NO_MATCH` - The name differs from the holder's name. - `NOT_AVAILABLE` - No verdict: the bank cannot check this IBAN now, or does not take part in VOP. Not billed. The call waits up to 25 seconds for the bank. Each call is one check: a check that got a verdict is billed, also when the call ended in an error or your client stopped waiting before the response arrived. A retry is a new check. Live mode only: an API key of a test account gets `403`, and so does a partner API key with the `MONEI-Account-ID` header. An account can run at most 200 checks in 24 hours, from the API and the dashboard together; above that the call gets `429`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.verify(verify_payee_request, async_req=True) + >>> result = thread.get() + + Args: + verify_payee_request (VerifyPayeeRequest): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): 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. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PayeeVerification + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) + kwargs["_content_type"] = kwargs.get("_content_type") + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["_request_auths"] = kwargs.get("_request_auths", None) + kwargs["verify_payee_request"] = verify_payee_request + return self.verify_endpoint.call_with_http_info(**kwargs) diff --git a/Monei/apis/__init__.py b/Monei/apis/__init__.py index 00e8dcc..610f06f 100644 --- a/Monei/apis/__init__.py +++ b/Monei/apis/__init__.py @@ -16,6 +16,8 @@ from Monei.api.apple_pay_certificate_api import ApplePayCertificateApi from Monei.api.apple_pay_domain_api import ApplePayDomainApi from Monei.api.bizum_api import BizumApi +from Monei.api.cardholder_verification_api import CardholderVerificationApi +from Monei.api.checkout_sessions_api import CheckoutSessionsApi from Monei.api.customers_api import CustomersApi from Monei.api.pos_auth_token_api import POSAuthTokenApi from Monei.api.payment_methods_api import PaymentMethodsApi @@ -24,3 +26,4 @@ from Monei.api.products_api import ProductsApi from Monei.api.subscriptions_api import SubscriptionsApi from Monei.api.tax_rates_api import TaxRatesApi +from Monei.api.verification_of_payee_api import VerificationOfPayeeApi diff --git a/Monei/model/cardholder_verification.py b/Monei/model/cardholder_verification.py new file mode 100644 index 0000000..65b5d2f --- /dev/null +++ b/Monei/model/cardholder_verification.py @@ -0,0 +1,306 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class CardholderVerification(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ("result",): { + "MATCH": "MATCH", + "PARTIAL_MATCH": "PARTIAL_MATCH", + "NO_MATCH": "NO_MATCH", + "NOT_AVAILABLE": "NOT_AVAILABLE", + }, + } + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "id": (str,), # noqa: E501 + "result": (str,), # noqa: E501 + "last4": (str,), # noqa: E501 + "brand": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "id": "id", # noqa: E501 + "result": "result", # noqa: E501 + "last4": "last4", # noqa: E501 + "brand": "brand", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, result, last4, *args, **kwargs): # noqa: E501 + """CardholderVerification - a model defined in OpenAPI + + Args: + id (str): The identifier of the check. Give it to MONEI support about this check. + result (str): The verdict of the issuer. Only `NOT_AVAILABLE` is free. + last4 (str): Last four digits of the card number. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + brand (str): Brand of the card.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.result = result + self.last4 = last4 + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, id, result, last4, *args, **kwargs): # noqa: E501 + """CardholderVerification - a model defined in OpenAPI + + Args: + id (str): The identifier of the check. Give it to MONEI support about this check. + result (str): The verdict of the issuer. Only `NOT_AVAILABLE` is free. + last4 (str): Last four digits of the card number. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + brand (str): Brand of the card.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.result = result + self.last4 = last4 + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/cardholder_verification_card.py b/Monei/model/cardholder_verification_card.py new file mode 100644 index 0000000..0ed87b2 --- /dev/null +++ b/Monei/model/cardholder_verification_card.py @@ -0,0 +1,317 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class CardholderVerificationCard(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = { + ("exp_month",): { + "regex": { + "pattern": r"^(0[1-9]|1[0-2])$", # noqa: E501 + }, + }, + ("exp_year",): { + "regex": { + "pattern": r"^[2-9][0-9]$", # noqa: E501 + }, + }, + ("cvc",): { + "regex": { + "pattern": r"^[0-9]{3,4}$", # noqa: E501 + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "number": (str,), # noqa: E501 + "exp_month": (str,), # noqa: E501 + "exp_year": (str,), # noqa: E501 + "cvc": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "number": "number", # noqa: E501 + "exp_month": "expMonth", # noqa: E501 + "exp_year": "expYear", # noqa: E501 + "cvc": "cvc", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls, number, exp_month, exp_year, *args, **kwargs + ): # noqa: E501 + """CardholderVerificationCard - a model defined in OpenAPI + + Args: + number (str): Card number. + exp_month (str): Expiration month, two digits. + exp_year (str): Expiration year, two digits. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cvc (str): Card verification code.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.number = number + self.exp_month = exp_month + self.exp_year = exp_year + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, number, exp_month, exp_year, *args, **kwargs): # noqa: E501 + """CardholderVerificationCard - a model defined in OpenAPI + + Args: + number (str): Card number. + exp_month (str): Expiration month, two digits. + exp_year (str): Expiration year, two digits. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cvc (str): Card verification code.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.number = number + self.exp_month = exp_month + self.exp_year = exp_year + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/checkout_session.py b/Monei/model/checkout_session.py new file mode 100644 index 0000000..4335dae --- /dev/null +++ b/Monei/model/checkout_session.py @@ -0,0 +1,492 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +def lazy_import(): + from Monei.model.checkout_session_billing_address_collection import ( + CheckoutSessionBillingAddressCollection, + ) + from Monei.model.checkout_session_business_purchase import ( + CheckoutSessionBusinessPurchase, + ) + from Monei.model.checkout_session_line_item import CheckoutSessionLineItem + from Monei.model.checkout_session_mode import CheckoutSessionMode + from Monei.model.checkout_session_status import CheckoutSessionStatus + + globals()[ + "CheckoutSessionBillingAddressCollection" + ] = CheckoutSessionBillingAddressCollection + globals()["CheckoutSessionBusinessPurchase"] = CheckoutSessionBusinessPurchase + globals()["CheckoutSessionLineItem"] = CheckoutSessionLineItem + globals()["CheckoutSessionMode"] = CheckoutSessionMode + globals()["CheckoutSessionStatus"] = CheckoutSessionStatus + + +class CheckoutSession(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ("purchaser_type",): { + "INDIVIDUAL": "INDIVIDUAL", + "BUSINESS": "BUSINESS", + }, + } + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "id": (str,), # noqa: E501 + "url": (str,), # noqa: E501 + "livemode": (bool,), # noqa: E501 + "status": (CheckoutSessionStatus,), # noqa: E501 + "mode": (CheckoutSessionMode,), # noqa: E501 + "currency": (str,), # noqa: E501 + "line_items": ([CheckoutSessionLineItem],), # noqa: E501 + "amount_subtotal": (int,), # noqa: E501 + "amount_tax": (int,), # noqa: E501 + "amount_total": (int,), # noqa: E501 + "order_id": (str,), # noqa: E501 + "description": (str,), # noqa: E501 + "billing_address_collection": ( + CheckoutSessionBillingAddressCollection, + ), # noqa: E501 + "business_purchase": (CheckoutSessionBusinessPurchase,), # noqa: E501 + "success_url": (str,), # noqa: E501 + "expires_at": (int,), # noqa: E501 + "created_at": (int,), # noqa: E501 + "recurring_amount_total": (int,), # noqa: E501 + "customer_id": (str,), # noqa: E501 + "purchaser_type": (str,), # noqa: E501 + "cancel_url": (str,), # noqa: E501 + "payment_id": (str,), # noqa: E501 + "subscription_id": (str,), # noqa: E501 + "completed_at": (int,), # noqa: E501 + "expired_at": (int,), # noqa: E501 + "metadata": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 + "updated_at": (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "id": "id", # noqa: E501 + "url": "url", # noqa: E501 + "livemode": "livemode", # noqa: E501 + "status": "status", # noqa: E501 + "mode": "mode", # noqa: E501 + "currency": "currency", # noqa: E501 + "line_items": "lineItems", # noqa: E501 + "amount_subtotal": "amountSubtotal", # noqa: E501 + "amount_tax": "amountTax", # noqa: E501 + "amount_total": "amountTotal", # noqa: E501 + "order_id": "orderId", # noqa: E501 + "description": "description", # noqa: E501 + "billing_address_collection": "billingAddressCollection", # noqa: E501 + "business_purchase": "businessPurchase", # noqa: E501 + "success_url": "successUrl", # noqa: E501 + "expires_at": "expiresAt", # noqa: E501 + "created_at": "createdAt", # noqa: E501 + "recurring_amount_total": "recurringAmountTotal", # noqa: E501 + "customer_id": "customerId", # noqa: E501 + "purchaser_type": "purchaserType", # noqa: E501 + "cancel_url": "cancelUrl", # noqa: E501 + "payment_id": "paymentId", # noqa: E501 + "subscription_id": "subscriptionId", # noqa: E501 + "completed_at": "completedAt", # noqa: E501 + "expired_at": "expiredAt", # noqa: E501 + "metadata": "metadata", # noqa: E501 + "updated_at": "updatedAt", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls, + id, + url, + livemode, + status, + mode, + currency, + line_items, + amount_subtotal, + amount_tax, + amount_total, + order_id, + description, + billing_address_collection, + business_purchase, + success_url, + expires_at, + created_at, + *args, + **kwargs, + ): # noqa: E501 + """CheckoutSession - a model defined in OpenAPI + + Args: + id (str): Unique identifier for the checkout session. + url (str): The page where the buyer pays the session. Send the buyer to it. + livemode (bool): Whether the session is in live mode. + status (CheckoutSessionStatus): + mode (CheckoutSessionMode): + currency (str): Three-letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217), in uppercase: the currency of every price of the session. + line_items ([CheckoutSessionLineItem]): The lines of the session, in the order you sent them. + amount_subtotal (int): The amount of the first payment without tax, in the smallest currency unit. + amount_tax (int): The tax of the first payment, in the smallest currency unit. + amount_total (int): The amount of the first payment, in the smallest currency unit. A recurring line with a trial is not charged in it: see `billedInFirstPayment` of the line. + order_id (str): The order ID of the payment. Up to 40 characters: ASCII letters, digits and `_ @ . / # & + -` (no spaces). When you omit it, MONEI generates 12 characters from A-Z and 0-9. + description (str): The description of the payment. When you omit it, the product names. + billing_address_collection (CheckoutSessionBillingAddressCollection): + business_purchase (CheckoutSessionBusinessPurchase): + success_url (str): The page the buyer goes to after paying. + expires_at (int): Time the session expires if it is not paid, from 30 minutes to 24 hours from now. The default is 24 hours from now. Measured in seconds since the Unix epoch. + created_at (int): Time at which the resource was created. Measured in seconds since the Unix epoch. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + recurring_amount_total (int): The amount of each renewal of the subscription, with tax, in the smallest currency unit. Absent on a `PAYMENT` session. . [optional] # noqa: E501 + customer_id (str): A [customer](https://docs.monei.com/apis/rest/customers-create/) of your account. Without it, MONEI creates a customer for the buyer when they pay, with the details they type. . [optional] # noqa: E501 + purchaser_type (str): Who paid the session: a person (`INDIVIDUAL`) or a company with legal name and tax ID (`BUSINESS`). Set when the session is `COMPLETE`. . [optional] # noqa: E501 + cancel_url (str): The page the buyer goes to after leaving without paying.. [optional] # noqa: E501 + payment_id (str): The latest payment the buyer started. A buyer can start a new payment after a failed one, so this changes until the session is `COMPLETE`. . [optional] # noqa: E501 + subscription_id (str): The subscription of a `SUBSCRIPTION` session. It exists once the buyer opens the `url`. . [optional] # noqa: E501 + completed_at (int): Time the session became `COMPLETE`. Measured in seconds since the Unix epoch.. [optional] # noqa: E501 + expired_at (int): Time the session became `EXPIRED`. Measured in seconds since the Unix epoch.. [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format.. [optional] # noqa: E501 + updated_at (int): Time at which the resource updated last time. Measured in seconds since the Unix epoch.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.url = url + self.livemode = livemode + self.status = status + self.mode = mode + self.currency = currency + self.line_items = line_items + self.amount_subtotal = amount_subtotal + self.amount_tax = amount_tax + self.amount_total = amount_total + self.order_id = order_id + self.description = description + self.billing_address_collection = billing_address_collection + self.business_purchase = business_purchase + self.success_url = success_url + self.expires_at = expires_at + self.created_at = created_at + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__( + self, + id, + url, + livemode, + status, + mode, + currency, + line_items, + amount_subtotal, + amount_tax, + amount_total, + order_id, + description, + billing_address_collection, + business_purchase, + success_url, + expires_at, + created_at, + *args, + **kwargs, + ): # noqa: E501 + """CheckoutSession - a model defined in OpenAPI + + Args: + id (str): Unique identifier for the checkout session. + url (str): The page where the buyer pays the session. Send the buyer to it. + livemode (bool): Whether the session is in live mode. + status (CheckoutSessionStatus): + mode (CheckoutSessionMode): + currency (str): Three-letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217), in uppercase: the currency of every price of the session. + line_items ([CheckoutSessionLineItem]): The lines of the session, in the order you sent them. + amount_subtotal (int): The amount of the first payment without tax, in the smallest currency unit. + amount_tax (int): The tax of the first payment, in the smallest currency unit. + amount_total (int): The amount of the first payment, in the smallest currency unit. A recurring line with a trial is not charged in it: see `billedInFirstPayment` of the line. + order_id (str): The order ID of the payment. Up to 40 characters: ASCII letters, digits and `_ @ . / # & + -` (no spaces). When you omit it, MONEI generates 12 characters from A-Z and 0-9. + description (str): The description of the payment. When you omit it, the product names. + billing_address_collection (CheckoutSessionBillingAddressCollection): + business_purchase (CheckoutSessionBusinessPurchase): + success_url (str): The page the buyer goes to after paying. + expires_at (int): Time the session expires if it is not paid, from 30 minutes to 24 hours from now. The default is 24 hours from now. Measured in seconds since the Unix epoch. + created_at (int): Time at which the resource was created. Measured in seconds since the Unix epoch. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + recurring_amount_total (int): The amount of each renewal of the subscription, with tax, in the smallest currency unit. Absent on a `PAYMENT` session. . [optional] # noqa: E501 + customer_id (str): A [customer](https://docs.monei.com/apis/rest/customers-create/) of your account. Without it, MONEI creates a customer for the buyer when they pay, with the details they type. . [optional] # noqa: E501 + purchaser_type (str): Who paid the session: a person (`INDIVIDUAL`) or a company with legal name and tax ID (`BUSINESS`). Set when the session is `COMPLETE`. . [optional] # noqa: E501 + cancel_url (str): The page the buyer goes to after leaving without paying.. [optional] # noqa: E501 + payment_id (str): The latest payment the buyer started. A buyer can start a new payment after a failed one, so this changes until the session is `COMPLETE`. . [optional] # noqa: E501 + subscription_id (str): The subscription of a `SUBSCRIPTION` session. It exists once the buyer opens the `url`. . [optional] # noqa: E501 + completed_at (int): Time the session became `COMPLETE`. Measured in seconds since the Unix epoch.. [optional] # noqa: E501 + expired_at (int): Time the session became `EXPIRED`. Measured in seconds since the Unix epoch.. [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format.. [optional] # noqa: E501 + updated_at (int): Time at which the resource updated last time. Measured in seconds since the Unix epoch.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.url = url + self.livemode = livemode + self.status = status + self.mode = mode + self.currency = currency + self.line_items = line_items + self.amount_subtotal = amount_subtotal + self.amount_tax = amount_tax + self.amount_total = amount_total + self.order_id = order_id + self.description = description + self.billing_address_collection = billing_address_collection + self.business_purchase = business_purchase + self.success_url = success_url + self.expires_at = expires_at + self.created_at = created_at + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/checkout_session_billing_address_collection.py b/Monei/model/checkout_session_billing_address_collection.py new file mode 100644 index 0000000..daa1bdb --- /dev/null +++ b/Monei/model/checkout_session_billing_address_collection.py @@ -0,0 +1,284 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class CheckoutSessionBillingAddressCollection(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ("value",): { + "OPTIONAL": "OPTIONAL", + "REQUIRED": "REQUIRED", + }, + } + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "value": (str,), + } + + @cached_property + def discriminator(): + return None + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """CheckoutSessionBillingAddressCollection - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Whether the checkout page asks the buyer for a billing address.. if omitted defaults to "OPTIONAL", must be one of ["OPTIONAL", "REQUIRED", ] # noqa: E501 + + Keyword Args: + value (str): Whether the checkout page asks the buyer for a billing address.. if omitted defaults to "OPTIONAL", must be one of ["OPTIONAL", "REQUIRED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "OPTIONAL" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """CheckoutSessionBillingAddressCollection - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Whether the checkout page asks the buyer for a billing address.. if omitted defaults to "OPTIONAL", must be one of ["OPTIONAL", "REQUIRED", ] # noqa: E501 + + Keyword Args: + value (str): Whether the checkout page asks the buyer for a billing address.. if omitted defaults to "OPTIONAL", must be one of ["OPTIONAL", "REQUIRED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "OPTIONAL" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/Monei/model/checkout_session_business_purchase.py b/Monei/model/checkout_session_business_purchase.py new file mode 100644 index 0000000..f54371b --- /dev/null +++ b/Monei/model/checkout_session_business_purchase.py @@ -0,0 +1,285 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class CheckoutSessionBusinessPurchase(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ("value",): { + "DISABLED": "DISABLED", + "OPTIONAL": "OPTIONAL", + "REQUIRED": "REQUIRED", + }, + } + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "value": (str,), + } + + @cached_property + def discriminator(): + return None + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """CheckoutSessionBusinessPurchase - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Whether the buyer can pay as a company, with legal name, tax ID and full address: - `DISABLED`: only as an individual. - `OPTIONAL`: the buyer chooses. - `REQUIRED`: only as a company. A Spanish tax ID is checked. . if omitted defaults to "DISABLED", must be one of ["DISABLED", "OPTIONAL", "REQUIRED", ] # noqa: E501 + + Keyword Args: + value (str): Whether the buyer can pay as a company, with legal name, tax ID and full address: - `DISABLED`: only as an individual. - `OPTIONAL`: the buyer chooses. - `REQUIRED`: only as a company. A Spanish tax ID is checked. . if omitted defaults to "DISABLED", must be one of ["DISABLED", "OPTIONAL", "REQUIRED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "DISABLED" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """CheckoutSessionBusinessPurchase - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Whether the buyer can pay as a company, with legal name, tax ID and full address: - `DISABLED`: only as an individual. - `OPTIONAL`: the buyer chooses. - `REQUIRED`: only as a company. A Spanish tax ID is checked. . if omitted defaults to "DISABLED", must be one of ["DISABLED", "OPTIONAL", "REQUIRED", ] # noqa: E501 + + Keyword Args: + value (str): Whether the buyer can pay as a company, with legal name, tax ID and full address: - `DISABLED`: only as an individual. - `OPTIONAL`: the buyer chooses. - `REQUIRED`: only as a company. A Spanish tax ID is checked. . if omitted defaults to "DISABLED", must be one of ["DISABLED", "OPTIONAL", "REQUIRED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "DISABLED" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/Monei/model/checkout_session_line_item.py b/Monei/model/checkout_session_line_item.py new file mode 100644 index 0000000..3031970 --- /dev/null +++ b/Monei/model/checkout_session_line_item.py @@ -0,0 +1,387 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +def lazy_import(): + from Monei.model.price_recurring import PriceRecurring + from Monei.model.tax_details import TaxDetails + + globals()["PriceRecurring"] = PriceRecurring + globals()["TaxDetails"] = TaxDetails + + +class CheckoutSessionLineItem(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "price_id": (str,), # noqa: E501 + "product_id": (str,), # noqa: E501 + "product_name": (str,), # noqa: E501 + "quantity": (int,), # noqa: E501 + "unit_amount": (int,), # noqa: E501 + "type": (str,), # noqa: E501 + "billed_in_first_payment": (bool,), # noqa: E501 + "amount_subtotal": (int,), # noqa: E501 + "amount_tax": (int,), # noqa: E501 + "amount_total": (int,), # noqa: E501 + "description": (str,), # noqa: E501 + "recurring": (PriceRecurring,), # noqa: E501 + "tax": (TaxDetails,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "price_id": "priceId", # noqa: E501 + "product_id": "productId", # noqa: E501 + "product_name": "productName", # noqa: E501 + "quantity": "quantity", # noqa: E501 + "unit_amount": "unitAmount", # noqa: E501 + "type": "type", # noqa: E501 + "billed_in_first_payment": "billedInFirstPayment", # noqa: E501 + "amount_subtotal": "amountSubtotal", # noqa: E501 + "amount_tax": "amountTax", # noqa: E501 + "amount_total": "amountTotal", # noqa: E501 + "description": "description", # noqa: E501 + "recurring": "recurring", # noqa: E501 + "tax": "tax", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls, + price_id, + product_id, + product_name, + quantity, + unit_amount, + billed_in_first_payment, + amount_subtotal, + amount_tax, + amount_total, + *args, + **kwargs, + ): # noqa: E501 + """CheckoutSessionLineItem - a model defined in OpenAPI + + Args: + price_id (str): The price of the line. + product_id (str): The product of the price. + product_name (str): The product name. + quantity (int): The number of units. + unit_amount (int): The amount of one unit, in the smallest currency unit. Without tax for an `EXCLUSIVE` price. + billed_in_first_payment (bool): Whether the first payment charges the line. A recurring price with a trial is charged when the trial ends, so its line has `false`. + amount_subtotal (int): The line amount without tax, in the smallest currency unit. + amount_tax (int): The tax of the line, in the smallest currency unit. + amount_total (int): The line amount with tax, in the smallest currency unit. + + Keyword Args: + type (str): How the price bills: `RECURRING` (the default) or `ONE_TIME`. Only a `RECURRING` price can start or switch a subscription. Treat the set as open: more values can be added later. . defaults to "RECURRING" # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): The product description.. [optional] # noqa: E501 + recurring (PriceRecurring): [optional] # noqa: E501 + tax (TaxDetails): [optional] # noqa: E501 + """ + + type = kwargs.get("type", "RECURRING") + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.price_id = price_id + self.product_id = product_id + self.product_name = product_name + self.quantity = quantity + self.unit_amount = unit_amount + self.type = type + self.billed_in_first_payment = billed_in_first_payment + self.amount_subtotal = amount_subtotal + self.amount_tax = amount_tax + self.amount_total = amount_total + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__( + self, + price_id, + product_id, + product_name, + quantity, + unit_amount, + billed_in_first_payment, + amount_subtotal, + amount_tax, + amount_total, + *args, + **kwargs, + ): # noqa: E501 + """CheckoutSessionLineItem - a model defined in OpenAPI + + Args: + price_id (str): The price of the line. + product_id (str): The product of the price. + product_name (str): The product name. + quantity (int): The number of units. + unit_amount (int): The amount of one unit, in the smallest currency unit. Without tax for an `EXCLUSIVE` price. + billed_in_first_payment (bool): Whether the first payment charges the line. A recurring price with a trial is charged when the trial ends, so its line has `false`. + amount_subtotal (int): The line amount without tax, in the smallest currency unit. + amount_tax (int): The tax of the line, in the smallest currency unit. + amount_total (int): The line amount with tax, in the smallest currency unit. + + Keyword Args: + type (str): How the price bills: `RECURRING` (the default) or `ONE_TIME`. Only a `RECURRING` price can start or switch a subscription. Treat the set as open: more values can be added later. . defaults to "RECURRING" # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): The product description.. [optional] # noqa: E501 + recurring (PriceRecurring): [optional] # noqa: E501 + tax (TaxDetails): [optional] # noqa: E501 + """ + + type = kwargs.get("type", "RECURRING") + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.price_id = price_id + self.product_id = product_id + self.product_name = product_name + self.quantity = quantity + self.unit_amount = unit_amount + self.type = type + self.billed_in_first_payment = billed_in_first_payment + self.amount_subtotal = amount_subtotal + self.amount_tax = amount_tax + self.amount_total = amount_total + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/checkout_session_line_item_request.py b/Monei/model/checkout_session_line_item_request.py new file mode 100644 index 0000000..b924b5a --- /dev/null +++ b/Monei/model/checkout_session_line_item_request.py @@ -0,0 +1,294 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class CheckoutSessionLineItemRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = { + ("quantity",): { + "inclusive_maximum": 999, + "inclusive_minimum": 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "price_id": (str,), # noqa: E501 + "quantity": (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "price_id": "priceId", # noqa: E501 + "quantity": "quantity", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, price_id, quantity, *args, **kwargs): # noqa: E501 + """CheckoutSessionLineItemRequest - a model defined in OpenAPI + + Args: + price_id (str): The ID of an active [price](https://docs.monei.com/apis/rest/prices-create/). + quantity (int): The number of units. A `RECURRING` price takes `1`. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.price_id = price_id + self.quantity = quantity + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, price_id, quantity, *args, **kwargs): # noqa: E501 + """CheckoutSessionLineItemRequest - a model defined in OpenAPI + + Args: + price_id (str): The ID of an active [price](https://docs.monei.com/apis/rest/prices-create/). + quantity (int): The number of units. A `RECURRING` price takes `1`. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.price_id = price_id + self.quantity = quantity + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/checkout_session_list.py b/Monei/model/checkout_session_list.py new file mode 100644 index 0000000..d63bd25 --- /dev/null +++ b/Monei/model/checkout_session_list.py @@ -0,0 +1,295 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +def lazy_import(): + from Monei.model.checkout_session import CheckoutSession + + globals()["CheckoutSession"] = CheckoutSession + + +class CheckoutSessionList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "items": ([CheckoutSession],), # noqa: E501 + "next_cursor": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "items": "items", # noqa: E501 + "next_cursor": "nextCursor", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, items, *args, **kwargs): # noqa: E501 + """CheckoutSessionList - a model defined in OpenAPI + + Args: + items ([CheckoutSession]): The checkout sessions in this page, newest first. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + next_cursor (str): Pass this value as `cursor` to get the next page. Absent when there are no more items. The last page can still carry it, and the next call then returns no items. . [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.items = items + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, items, *args, **kwargs): # noqa: E501 + """CheckoutSessionList - a model defined in OpenAPI + + Args: + items ([CheckoutSession]): The checkout sessions in this page, newest first. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + next_cursor (str): Pass this value as `cursor` to get the next page. Absent when there are no more items. The last page can still carry it, and the next call then returns no items. . [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.items = items + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/checkout_session_mode.py b/Monei/model/checkout_session_mode.py new file mode 100644 index 0000000..939da85 --- /dev/null +++ b/Monei/model/checkout_session_mode.py @@ -0,0 +1,292 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class CheckoutSessionMode(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ("value",): { + "PAYMENT": "PAYMENT", + "SUBSCRIPTION": "SUBSCRIPTION", + }, + } + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "value": (str,), + } + + @cached_property + def discriminator(): + return None + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """CheckoutSessionMode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): What paying the session creates: a payment only (`PAYMENT`), or a payment and a subscription (`SUBSCRIPTION`, when a line has a `RECURRING` price). ., must be one of ["PAYMENT", "SUBSCRIPTION", ] # noqa: E501 + + Keyword Args: + value (str): What paying the session creates: a payment only (`PAYMENT`), or a payment and a subscription (`SUBSCRIPTION`, when a line has a `RECURRING` price). ., must be one of ["PAYMENT", "SUBSCRIPTION", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """CheckoutSessionMode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): What paying the session creates: a payment only (`PAYMENT`), or a payment and a subscription (`SUBSCRIPTION`, when a line has a `RECURRING` price). ., must be one of ["PAYMENT", "SUBSCRIPTION", ] # noqa: E501 + + Keyword Args: + value (str): What paying the session creates: a payment only (`PAYMENT`), or a payment and a subscription (`SUBSCRIPTION`, when a line has a `RECURRING` price). ., must be one of ["PAYMENT", "SUBSCRIPTION", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/Monei/model/checkout_session_status.py b/Monei/model/checkout_session_status.py new file mode 100644 index 0000000..4961b87 --- /dev/null +++ b/Monei/model/checkout_session_status.py @@ -0,0 +1,293 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class CheckoutSessionStatus(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ("value",): { + "OPEN": "OPEN", + "COMPLETE": "COMPLETE", + "EXPIRED": "EXPIRED", + }, + } + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "value": (str,), + } + + @cached_property + def discriminator(): + return None + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """CheckoutSessionStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The status of the session: - `OPEN`: the buyer can pay it at `url`. - `COMPLETE`: the buyer paid it. `paymentId` is the payment, and `subscriptionId` the subscription of a `SUBSCRIPTION` session. - `EXPIRED`: it reached `expiresAt` unpaid. Its subscription, if any, is canceled. ., must be one of ["OPEN", "COMPLETE", "EXPIRED", ] # noqa: E501 + + Keyword Args: + value (str): The status of the session: - `OPEN`: the buyer can pay it at `url`. - `COMPLETE`: the buyer paid it. `paymentId` is the payment, and `subscriptionId` the subscription of a `SUBSCRIPTION` session. - `EXPIRED`: it reached `expiresAt` unpaid. Its subscription, if any, is canceled. ., must be one of ["OPEN", "COMPLETE", "EXPIRED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """CheckoutSessionStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The status of the session: - `OPEN`: the buyer can pay it at `url`. - `COMPLETE`: the buyer paid it. `paymentId` is the payment, and `subscriptionId` the subscription of a `SUBSCRIPTION` session. - `EXPIRED`: it reached `expiresAt` unpaid. Its subscription, if any, is canceled. ., must be one of ["OPEN", "COMPLETE", "EXPIRED", ] # noqa: E501 + + Keyword Args: + value (str): The status of the session: - `OPEN`: the buyer can pay it at `url`. - `COMPLETE`: the buyer paid it. `paymentId` is the payment, and `subscriptionId` the subscription of a `SUBSCRIPTION` session. - `EXPIRED`: it reached `expiresAt` unpaid. Its subscription, if any, is canceled. ., must be one of ["OPEN", "COMPLETE", "EXPIRED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/Monei/model/create_checkout_session_request.py b/Monei/model/create_checkout_session_request.py new file mode 100644 index 0000000..4a0aa44 --- /dev/null +++ b/Monei/model/create_checkout_session_request.py @@ -0,0 +1,350 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +def lazy_import(): + from Monei.model.checkout_session_billing_address_collection import ( + CheckoutSessionBillingAddressCollection, + ) + from Monei.model.checkout_session_business_purchase import ( + CheckoutSessionBusinessPurchase, + ) + from Monei.model.checkout_session_line_item_request import ( + CheckoutSessionLineItemRequest, + ) + + globals()[ + "CheckoutSessionBillingAddressCollection" + ] = CheckoutSessionBillingAddressCollection + globals()["CheckoutSessionBusinessPurchase"] = CheckoutSessionBusinessPurchase + globals()["CheckoutSessionLineItemRequest"] = CheckoutSessionLineItemRequest + + +class CreateCheckoutSessionRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = { + ("line_items",): { + "max_items": 20, + "min_items": 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "line_items": ([CheckoutSessionLineItemRequest],), # noqa: E501 + "success_url": (str,), # noqa: E501 + "cancel_url": (str,), # noqa: E501 + "customer_id": (str,), # noqa: E501 + "order_id": (str,), # noqa: E501 + "description": (str,), # noqa: E501 + "billing_address_collection": ( + CheckoutSessionBillingAddressCollection, + ), # noqa: E501 + "business_purchase": (CheckoutSessionBusinessPurchase,), # noqa: E501 + "expires_at": (int,), # noqa: E501 + "metadata": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "line_items": "lineItems", # noqa: E501 + "success_url": "successUrl", # noqa: E501 + "cancel_url": "cancelUrl", # noqa: E501 + "customer_id": "customerId", # noqa: E501 + "order_id": "orderId", # noqa: E501 + "description": "description", # noqa: E501 + "billing_address_collection": "billingAddressCollection", # noqa: E501 + "business_purchase": "businessPurchase", # noqa: E501 + "expires_at": "expiresAt", # noqa: E501 + "metadata": "metadata", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, line_items, success_url, *args, **kwargs): # noqa: E501 + """CreateCheckoutSessionRequest - a model defined in OpenAPI + + Args: + line_items ([CheckoutSessionLineItemRequest]): The lines of the cart, from 1 to 20, in the order the checkout page shows them. All prices must be active, of your account and in the same currency. At most one price is `RECURRING`: with one, the session is a `SUBSCRIPTION` session. + success_url (str): The page the buyer goes to after paying. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cancel_url (str): The page the buyer goes to after leaving without paying.. [optional] # noqa: E501 + customer_id (str): A [customer](https://docs.monei.com/apis/rest/customers-create/) of your account. Without it, MONEI creates a customer for the buyer when they pay, with the details they type. . [optional] # noqa: E501 + order_id (str): The order ID of the payment. Up to 40 characters: ASCII letters, digits and `_ @ . / # & + -` (no spaces). When you omit it, MONEI generates 12 characters from A-Z and 0-9. . [optional] # noqa: E501 + description (str): The description of the payment. When you omit it, the product names.. [optional] # noqa: E501 + billing_address_collection (CheckoutSessionBillingAddressCollection): [optional] # noqa: E501 + business_purchase (CheckoutSessionBusinessPurchase): [optional] # noqa: E501 + expires_at (int): Time the session expires if it is not paid, from 30 minutes to 24 hours from now. The default is 24 hours from now. Measured in seconds since the Unix epoch. . [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.line_items = line_items + self.success_url = success_url + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, line_items, success_url, *args, **kwargs): # noqa: E501 + """CreateCheckoutSessionRequest - a model defined in OpenAPI + + Args: + line_items ([CheckoutSessionLineItemRequest]): The lines of the cart, from 1 to 20, in the order the checkout page shows them. All prices must be active, of your account and in the same currency. At most one price is `RECURRING`: with one, the session is a `SUBSCRIPTION` session. + success_url (str): The page the buyer goes to after paying. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cancel_url (str): The page the buyer goes to after leaving without paying.. [optional] # noqa: E501 + customer_id (str): A [customer](https://docs.monei.com/apis/rest/customers-create/) of your account. Without it, MONEI creates a customer for the buyer when they pay, with the details they type. . [optional] # noqa: E501 + order_id (str): The order ID of the payment. Up to 40 characters: ASCII letters, digits and `_ @ . / # & + -` (no spaces). When you omit it, MONEI generates 12 characters from A-Z and 0-9. . [optional] # noqa: E501 + description (str): The description of the payment. When you omit it, the product names.. [optional] # noqa: E501 + billing_address_collection (CheckoutSessionBillingAddressCollection): [optional] # noqa: E501 + business_purchase (CheckoutSessionBusinessPurchase): [optional] # noqa: E501 + expires_at (int): Time the session expires if it is not paid, from 30 minutes to 24 hours from now. The default is 24 hours from now. Measured in seconds since the Unix epoch. . [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.line_items = line_items + self.success_url = success_url + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/payee_verification.py b/Monei/model/payee_verification.py new file mode 100644 index 0000000..fa1a599 --- /dev/null +++ b/Monei/model/payee_verification.py @@ -0,0 +1,303 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class PayeeVerification(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ("result",): { + "MATCH": "MATCH", + "CLOSE_MATCH": "CLOSE_MATCH", + "NO_MATCH": "NO_MATCH", + "NOT_AVAILABLE": "NOT_AVAILABLE", + }, + } + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "id": ( + str, + none_type, + ), # noqa: E501 + "result": (str,), # noqa: E501 + "canonical_name": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "id": "id", # noqa: E501 + "result": "result", # noqa: E501 + "canonical_name": "canonicalName", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, result, *args, **kwargs): # noqa: E501 + """PayeeVerification - a model defined in OpenAPI + + Args: + id (str, none_type): The identifier of the check. Give it to MONEI support about this check. Null when no bank could be addressed for the IBAN. + result (str): The verdict of the bank. Only `NOT_AVAILABLE` is free. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + canonical_name (str): The name the bank holds for the IBAN. Only on `CLOSE_MATCH`.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.result = result + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, id, result, *args, **kwargs): # noqa: E501 + """PayeeVerification - a model defined in OpenAPI + + Args: + id (str, none_type): The identifier of the check. Give it to MONEI support about this check. Null when no bank could be addressed for the IBAN. + result (str): The verdict of the bank. Only `NOT_AVAILABLE` is free. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + canonical_name (str): The name the bank holds for the IBAN. Only on `CLOSE_MATCH`.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.result = result + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/payment.py b/Monei/model/payment.py index b31d22a..a94dede 100644 --- a/Monei/model/payment.py +++ b/Monei/model/payment.py @@ -145,6 +145,7 @@ def openapi_types(): "sequence_id": (str,), # noqa: E501 "store_id": (str,), # noqa: E501 "point_of_sale_id": (str,), # noqa: E501 + "checkout_session_id": (str,), # noqa: E501 "metadata": ( {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, ), # noqa: E501 @@ -186,6 +187,7 @@ def discriminator(): "sequence_id": "sequenceId", # noqa: E501 "store_id": "storeId", # noqa: E501 "point_of_sale_id": "pointOfSaleId", # noqa: E501 + "checkout_session_id": "checkoutSessionId", # noqa: E501 "metadata": "metadata", # noqa: E501 "next_action": "nextAction", # noqa: E501 "created_at": "createdAt", # noqa: E501 @@ -264,6 +266,7 @@ def _from_openapi_data( sequence_id (str): A permanent identifier that refers to the initial payment of a sequence of payments. This value needs to be sent in the path for `RECURRING` payments. . [optional] # noqa: E501 store_id (str): A unique identifier of the Store. If specified the payment is attached to this Store. . [optional] # noqa: E501 point_of_sale_id (str): A unique identifier of the Point of Sale. If specified the payment is attached to this Point of Sale. If there is a QR code attached to the same Point of Sale, this payment will be available by scanning the QR code. . [optional] # noqa: E501 + checkout_session_id (str): The [checkout session](https://docs.monei.com/apis/rest/checkout-sessions-get/) the payment pays. Absent on a payment created without one. . [optional] # noqa: E501 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format.. [optional] # noqa: E501 next_action (PaymentNextAction): [optional] # noqa: E501 created_at (int): Time at which the resource was created. Measured in seconds since the Unix epoch.. [optional] # noqa: E501 @@ -396,6 +399,7 @@ def __init__( sequence_id (str): A permanent identifier that refers to the initial payment of a sequence of payments. This value needs to be sent in the path for `RECURRING` payments. . [optional] # noqa: E501 store_id (str): A unique identifier of the Store. If specified the payment is attached to this Store. . [optional] # noqa: E501 point_of_sale_id (str): A unique identifier of the Point of Sale. If specified the payment is attached to this Point of Sale. If there is a QR code attached to the same Point of Sale, this payment will be available by scanning the QR code. . [optional] # noqa: E501 + checkout_session_id (str): The [checkout session](https://docs.monei.com/apis/rest/checkout-sessions-get/) the payment pays. Absent on a payment created without one. . [optional] # noqa: E501 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format.. [optional] # noqa: E501 next_action (PaymentNextAction): [optional] # noqa: E501 created_at (int): Time at which the resource was created. Measured in seconds since the Unix epoch.. [optional] # noqa: E501 diff --git a/Monei/model/subscription.py b/Monei/model/subscription.py index 7c06706..ca73fc4 100644 --- a/Monei/model/subscription.py +++ b/Monei/model/subscription.py @@ -135,6 +135,7 @@ def openapi_types(): "description": (str,), # noqa: E501 "price_id": (str,), # noqa: E501 "product_id": (str,), # noqa: E501 + "checkout_session_id": (str,), # noqa: E501 "tax": (TaxDetails,), # noqa: E501 "customer_id": (str,), # noqa: E501 "customer": (PaymentCustomer,), # noqa: E501 @@ -185,6 +186,7 @@ def discriminator(): "description": "description", # noqa: E501 "price_id": "priceId", # noqa: E501 "product_id": "productId", # noqa: E501 + "checkout_session_id": "checkoutSessionId", # noqa: E501 "tax": "tax", # noqa: E501 "customer_id": "customerId", # noqa: E501 "customer": "customer", # noqa: E501 @@ -281,6 +283,7 @@ def _from_openapi_data( description (str): An arbitrary string attached to the subscription. Often useful for displaying to users. . [optional] # noqa: E501 price_id (str): The [price](https://docs.monei.com/apis/rest/prices-create/) the subscription bills. The subscription copies the price's values when it is created or switched to the price. A later change to the price never changes the subscription. . [optional] # noqa: E501 product_id (str): The [product](https://docs.monei.com/apis/rest/products-create/) of the subscription's price. MONEI sets it from `priceId`, and removes it together with `priceId`. . [optional] # noqa: E501 + checkout_session_id (str): The [checkout session](https://docs.monei.com/apis/rest/checkout-sessions-get/) that created the subscription. While the session is open, only the session can activate, change or cancel the subscription: those requests are rejected with `422`. . [optional] # noqa: E501 tax (TaxDetails): [optional] # noqa: E501 customer_id (str): The [customer](https://docs.monei.com/apis/rest/customers-create/) this subscription belongs to. Linking a subscription to a customer turns on **renewal failover**: when a renewal is declined by the issuing bank, MONEI retries it against up to two of the customer's other saved payment methods within the same attempt, before the subscription goes `PAST_DUE`. One declined renewal can therefore produce up to three charge attempts on different cards. If one succeeds the subscription continues and moves to that payment method. . [optional] # noqa: E501 customer (PaymentCustomer): [optional] # noqa: E501 @@ -432,6 +435,7 @@ def __init__( description (str): An arbitrary string attached to the subscription. Often useful for displaying to users. . [optional] # noqa: E501 price_id (str): The [price](https://docs.monei.com/apis/rest/prices-create/) the subscription bills. The subscription copies the price's values when it is created or switched to the price. A later change to the price never changes the subscription. . [optional] # noqa: E501 product_id (str): The [product](https://docs.monei.com/apis/rest/products-create/) of the subscription's price. MONEI sets it from `priceId`, and removes it together with `priceId`. . [optional] # noqa: E501 + checkout_session_id (str): The [checkout session](https://docs.monei.com/apis/rest/checkout-sessions-get/) that created the subscription. While the session is open, only the session can activate, change or cancel the subscription: those requests are rejected with `422`. . [optional] # noqa: E501 tax (TaxDetails): [optional] # noqa: E501 customer_id (str): The [customer](https://docs.monei.com/apis/rest/customers-create/) this subscription belongs to. Linking a subscription to a customer turns on **renewal failover**: when a renewal is declined by the issuing bank, MONEI retries it against up to two of the customer's other saved payment methods within the same attempt, before the subscription goes `PAST_DUE`. One declined renewal can therefore produce up to three charge attempts on different cards. If one succeeds the subscription continues and moves to that payment method. . [optional] # noqa: E501 customer (PaymentCustomer): [optional] # noqa: E501 diff --git a/Monei/model/verify_cardholder_request.py b/Monei/model/verify_cardholder_request.py new file mode 100644 index 0000000..176b039 --- /dev/null +++ b/Monei/model/verify_cardholder_request.py @@ -0,0 +1,322 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +def lazy_import(): + from Monei.model.cardholder_verification_card import CardholderVerificationCard + + globals()["CardholderVerificationCard"] = CardholderVerificationCard + + +class VerifyCardholderRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = { + ("first_name",): { + "max_length": 100, + "min_length": 1, + }, + ("last_name",): { + "max_length": 100, + "min_length": 1, + }, + ("middle_name",): { + "max_length": 100, + "min_length": 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "first_name": (str,), # noqa: E501 + "last_name": (str,), # noqa: E501 + "payment_token": (str,), # noqa: E501 + "card": (CardholderVerificationCard,), # noqa: E501 + "middle_name": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "first_name": "firstName", # noqa: E501 + "last_name": "lastName", # noqa: E501 + "payment_token": "paymentToken", # noqa: E501 + "card": "card", # noqa: E501 + "middle_name": "middleName", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, first_name, last_name, *args, **kwargs): # noqa: E501 + """VerifyCardholderRequest - a model defined in OpenAPI + + Args: + first_name (str): First name of the cardholder, as written on the card. + last_name (str): Last name of the cardholder, as written on the card. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payment_token (str): The payment token of a card, from a payment of your account. Send this or `card`.. [optional] # noqa: E501 + card (CardholderVerificationCard): [optional] # noqa: E501 + middle_name (str): Middle name of the cardholder, if any.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.first_name = first_name + self.last_name = last_name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, first_name, last_name, *args, **kwargs): # noqa: E501 + """VerifyCardholderRequest - a model defined in OpenAPI + + Args: + first_name (str): First name of the cardholder, as written on the card. + last_name (str): Last name of the cardholder, as written on the card. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payment_token (str): The payment token of a card, from a payment of your account. Send this or `card`.. [optional] # noqa: E501 + card (CardholderVerificationCard): [optional] # noqa: E501 + middle_name (str): Middle name of the cardholder, if any.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.first_name = first_name + self.last_name = last_name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/model/verify_payee_request.py b/Monei/model/verify_payee_request.py new file mode 100644 index 0000000..6c02638 --- /dev/null +++ b/Monei/model/verify_payee_request.py @@ -0,0 +1,294 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from Monei.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from Monei.exceptions import ApiAttributeError + + +class VerifyPayeeRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = { + ("name",): { + "max_length": 140, + "min_length": 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "name": (str,), # noqa: E501 + "iban": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "name": "name", # noqa: E501 + "iban": "iban", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, iban, *args, **kwargs): # noqa: E501 + """VerifyPayeeRequest - a model defined in OpenAPI + + Args: + name (str): Name of the payee, as the holder of the IBAN. + iban (str): IBAN of the payee, with or without spaces. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", True) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.iban = iban + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, name, iban, *args, **kwargs): # noqa: E501 + """VerifyPayeeRequest - a model defined in OpenAPI + + Args: + name (str): Name of the payee, as the holder of the IBAN. + iban (str): IBAN of the payee, with or without spaces. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.iban = iban + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/Monei/models/__init__.py b/Monei/models/__init__.py index 08ebbcd..69eb578 100644 --- a/Monei/models/__init__.py +++ b/Monei/models/__init__.py @@ -25,6 +25,22 @@ from Monei.model.cancel_payment_request import CancelPaymentRequest from Monei.model.cancel_subscription_request import CancelSubscriptionRequest from Monei.model.capture_payment_request import CapturePaymentRequest +from Monei.model.cardholder_verification import CardholderVerification +from Monei.model.cardholder_verification_card import CardholderVerificationCard +from Monei.model.checkout_session import CheckoutSession +from Monei.model.checkout_session_billing_address_collection import ( + CheckoutSessionBillingAddressCollection, +) +from Monei.model.checkout_session_business_purchase import ( + CheckoutSessionBusinessPurchase, +) +from Monei.model.checkout_session_line_item import CheckoutSessionLineItem +from Monei.model.checkout_session_line_item_request import ( + CheckoutSessionLineItemRequest, +) +from Monei.model.checkout_session_list import CheckoutSessionList +from Monei.model.checkout_session_mode import CheckoutSessionMode +from Monei.model.checkout_session_status import CheckoutSessionStatus from Monei.model.confirm_payment_request import ConfirmPaymentRequest from Monei.model.confirm_payment_request_payment_method import ( ConfirmPaymentRequestPaymentMethod, @@ -34,6 +50,7 @@ ) from Monei.model.conflict_error import ConflictError from Monei.model.conflict_error_all_of import ConflictErrorAllOf +from Monei.model.create_checkout_session_request import CreateCheckoutSessionRequest from Monei.model.create_customer_request import CreateCustomerRequest from Monei.model.create_payment_request import CreatePaymentRequest from Monei.model.create_pos_auth_token_request import CreatePosAuthTokenRequest @@ -49,6 +66,7 @@ from Monei.model.not_found_error import NotFoundError from Monei.model.not_found_error_all_of import NotFoundErrorAllOf from Monei.model.pause_subscription_request import PauseSubscriptionRequest +from Monei.model.payee_verification import PayeeVerification from Monei.model.payment import Payment from Monei.model.payment_billing_details import PaymentBillingDetails from Monei.model.payment_cancellation_reason import PaymentCancellationReason @@ -177,3 +195,5 @@ from Monei.model.update_subscription_request import UpdateSubscriptionRequest from Monei.model.update_tax_rate_request import UpdateTaxRateRequest from Monei.model.validate_bizum_phone_request import ValidateBizumPhoneRequest +from Monei.model.verify_cardholder_request import VerifyCardholderRequest +from Monei.model.verify_payee_request import VerifyPayeeRequest diff --git a/Monei/monei_client.py b/Monei/monei_client.py index 70ad18a..9173cab 100644 --- a/Monei/monei_client.py +++ b/Monei/monei_client.py @@ -13,6 +13,7 @@ ProductsApi, PricesApi, TaxRatesApi, + CheckoutSessionsApi, ApplePayDomainApi, ApplePayCertificateApi, BizumApi, @@ -94,6 +95,7 @@ def call_api_with_validation(*args, **kwargs): self.Products = ProductsApi(api_client) self.Prices = PricesApi(api_client) self.TaxRates = TaxRatesApi(api_client) + self.CheckoutSessions = CheckoutSessionsApi(api_client) self.ApplePayDomain = ApplePayDomainApi(api_client) self.Bizum = BizumApi(api_client) self.ApplePayCertificate = ApplePayCertificateApi(api_client) @@ -109,6 +111,7 @@ def call_api_with_validation(*args, **kwargs): self.products = self.Products self.prices = self.Prices self.tax_rates = self.TaxRates + self.checkout_sessions = self.CheckoutSessions self.apple_pay_domain = self.ApplePayDomain self.apple_pay_certificate = self.ApplePayCertificate self.bizum = self.Bizum diff --git a/Monei/redaction.py b/Monei/redaction.py new file mode 100644 index 0000000..abd8ed3 --- /dev/null +++ b/Monei/redaction.py @@ -0,0 +1,68 @@ +"""Masks card data in the string representation of models. + +The generated `to_str` prints `to_dict()`, so `print` or a log line would show the +full card number and CVC of a card model (`CardholderVerificationCard`, +`PaymentPaymentMethodCardInput`), also when the card is nested in a request. A card +model is found by its schema, so a new card model is masked without a change here. +This module is hand-written (the generator does not create it) and +`scripts/post-build.sh` imports it from `Monei/__init__.py` after each +regeneration. `to_dict()` and the request body keep the real values. +""" + +import pprint + +from Monei.model_utils import ModelComposed, ModelNormal + + +def _is_card(model): + fields = model.openapi_types + return "cvc" in fields or ("number" in fields and "exp_month" in fields) + + +def _mask_card(plain): + masked = dict(plain) + number = masked.get("number") + if number is not None: + masked["number"] = "**** " + number[-4:] if len(number) > 4 else "****" + if masked.get("cvc") is not None: + masked["cvc"] = "***" + return masked + + +def _mask_value(value, plain): + if hasattr(value, "_data_store") and _is_card(value) and isinstance(plain, dict): + return _mask_card(plain) + if hasattr(value, "_data_store") and isinstance(plain, dict): + _mask_model(value, plain) + return plain + if isinstance(value, list) and isinstance(plain, list): + return [_mask_value(v, p) for v, p in zip(value, plain)] + if isinstance(value, dict) and isinstance(plain, dict): + return {k: _mask_value(value.get(k), p) for k, p in plain.items()} + return plain + + +def _mask_model(model, plain): + """Walks the model next to its `to_dict()` output, which has lost the model + classes, and masks the entries that come from a card.""" + instances = [model] + if model._composed_schemas: + instances.extend(model._composed_instances) + for instance in instances: + for attr, value in instance._data_store.items(): + if attr in plain: + plain[attr] = _mask_value(value, plain[attr]) + + +def _masked_to_str(self): + """Returns the string representation of the model, with card data masked""" + plain = self.to_dict() + if _is_card(self): + plain = _mask_card(plain) + else: + _mask_model(self, plain) + return pprint.pformat(plain) + + +ModelNormal.to_str = _masked_to_str # type: ignore[method-assign] +ModelComposed.to_str = _masked_to_str # type: ignore[method-assign] diff --git a/README.md b/README.md index 3967292..fbb29a7 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ For collecting customer and payment information in the browser, use [monei.js](h - [Creating a Product and a Price](#creating-a-product-and-a-price) - [Subscribing to a Price](#subscribing-to-a-price) - [Tax Rates](#tax-rates) + - [Checkout Sessions](#checkout-sessions) - [Integration Methods](#integration-methods) - [Using the Prebuilt Payment Page](#using-the-prebuilt-payment-page) - [Features](#features) @@ -341,6 +342,29 @@ tax_rate = monei.tax_rates.create( ) ``` +## Checkout Sessions + +A checkout session is a cart of prices that the buyer pays on one MONEI page. MONEI computes the amounts and the tax, and returns the session with its `url`. Send the buyer to the `url`. + +```python +from Monei import CheckoutSessionLineItemRequest, CreateCheckoutSessionRequest + +session = monei.checkout_sessions.create( + CreateCheckoutSessionRequest( + line_items=[CheckoutSessionLineItemRequest(price_id=price.id, quantity=1)], + success_url='https://example.com/checkout/success', + cancel_url='https://example.com/cart', + ) +) + +# Redirect the buyer to session.url + +session = monei.checkout_sessions.get(session.id) +sessions = monei.checkout_sessions.list(limit=20) +``` + +A session with a `RECURRING` price also creates a subscription. The payment and the subscription that a session creates have `checkout_session_id`. To know when a session ends, subscribe a webhook to `checkout_session.completed` and `checkout_session.expired`. + ## Integration Methods ### Using the Prebuilt Payment Page diff --git a/scripts/post-build.sh b/scripts/post-build.sh index 853ef47..3e5fcf5 100755 --- a/scripts/post-build.sh +++ b/scripts/post-build.sh @@ -4,3 +4,4 @@ echo 'from Monei.monei_client import MoneiClient' >>./Monei/__init__.py echo 'from Monei.models import *' >>./Monei/__init__.py echo 'from Monei.apis import *' >>./Monei/__init__.py echo 'from Monei.exceptions import *' >>./Monei/__init__.py +echo 'import Monei.redaction # masks card data in model reprs' >>./Monei/__init__.py diff --git a/test/test_card_repr_masking.py b/test/test_card_repr_masking.py new file mode 100644 index 0000000..af0eacf --- /dev/null +++ b/test/test_card_repr_masking.py @@ -0,0 +1,70 @@ +import unittest + +from Monei import ( + CardholderVerificationCard, + CreatePaymentRequest, + PaymentPaymentMethodCardInput, + PaymentPaymentMethodInput, + VerifyCardholderRequest, +) +from Monei.api_client import ApiClient + +NUMBER = "4000000000000002" +CVC = "987" + + +class TestCardReprMasking(unittest.TestCase): + """A merchant that prints or logs a card model must not write the card number + or the CVC to its logs (PCI), but MONEI still needs both in the request.""" + + def setUp(self): + self.card = CardholderVerificationCard( + number=NUMBER, exp_month="12", exp_year="29", cvc=CVC + ) + self.request = VerifyCardholderRequest( + first_name="Ana", last_name="Ruiz", card=self.card + ) + + def test_card_repr_shows_only_the_last_four_digits(self): + for text in (repr(self.card), str(self.card)): + self.assertNotIn(NUMBER, text) + self.assertNotIn(CVC, text) + self.assertIn("**** 0002", text) + + def test_request_repr_masks_the_nested_card(self): + for text in (repr(self.request), str(self.request)): + self.assertNotIn(NUMBER, text) + self.assertNotIn(CVC, text) + self.assertIn("Ana", text) + + def test_payment_request_repr_masks_the_raw_card(self): + payment = CreatePaymentRequest( + amount=110, + currency="EUR", + order_id="14379133960355", + payment_method=PaymentPaymentMethodInput( + card=PaymentPaymentMethodCardInput( + number=NUMBER, cvc=CVC, exp_month="12", exp_year="29" + ) + ), + ) + + text = repr(payment) + + self.assertNotIn(NUMBER, text) + self.assertNotIn(CVC, text) + self.assertIn("**** 0002", text) + body = ApiClient().sanitize_for_serialization(payment) + self.assertEqual(body["paymentMethod"]["card"]["number"], NUMBER) + self.assertEqual(body["paymentMethod"]["card"]["cvc"], CVC) + + def test_request_body_keeps_the_card_data(self): + body = ApiClient().sanitize_for_serialization(self.request) + + self.assertEqual(body["card"]["number"], NUMBER) + self.assertEqual(body["card"]["cvc"], CVC) + self.assertEqual(self.card.to_dict()["cvc"], CVC) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_cardholder_verification.py b/test/test_cardholder_verification.py new file mode 100644 index 0000000..54ea997 --- /dev/null +++ b/test/test_cardholder_verification.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.cardholder_verification import CardholderVerification + + +class TestCardholderVerification(unittest.TestCase): + """CardholderVerification unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCardholderVerification(self): + """Test CardholderVerification""" + # FIXME: construct object with mandatory attributes with example values + # model = CardholderVerification() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_cardholder_verification_api.py b/test/test_cardholder_verification_api.py new file mode 100644 index 0000000..c0ae16a --- /dev/null +++ b/test/test_cardholder_verification_api.py @@ -0,0 +1,36 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import unittest + +import Monei +from Monei.api.cardholder_verification_api import ( + CardholderVerificationApi, +) # noqa: E501 + + +class TestCardholderVerificationApi(unittest.TestCase): + """CardholderVerificationApi unit test stubs""" + + def setUp(self): + self.api = CardholderVerificationApi() # noqa: E501 + + def tearDown(self): + pass + + def test_verify(self): + """Test case for verify + + Verify Cardholder # noqa: E501 + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_cardholder_verification_card.py b/test/test_cardholder_verification_card.py new file mode 100644 index 0000000..f0f8179 --- /dev/null +++ b/test/test_cardholder_verification_card.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.cardholder_verification_card import CardholderVerificationCard + + +class TestCardholderVerificationCard(unittest.TestCase): + """CardholderVerificationCard unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCardholderVerificationCard(self): + """Test CardholderVerificationCard""" + # FIXME: construct object with mandatory attributes with example values + # model = CardholderVerificationCard() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_checkout_session.py b/test/test_checkout_session.py new file mode 100644 index 0000000..527d744 --- /dev/null +++ b/test/test_checkout_session.py @@ -0,0 +1,51 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.checkout_session_billing_address_collection import ( + CheckoutSessionBillingAddressCollection, +) +from Monei.model.checkout_session_business_purchase import ( + CheckoutSessionBusinessPurchase, +) +from Monei.model.checkout_session_line_item import CheckoutSessionLineItem +from Monei.model.checkout_session_mode import CheckoutSessionMode +from Monei.model.checkout_session_status import CheckoutSessionStatus + +globals()[ + "CheckoutSessionBillingAddressCollection" +] = CheckoutSessionBillingAddressCollection +globals()["CheckoutSessionBusinessPurchase"] = CheckoutSessionBusinessPurchase +globals()["CheckoutSessionLineItem"] = CheckoutSessionLineItem +globals()["CheckoutSessionMode"] = CheckoutSessionMode +globals()["CheckoutSessionStatus"] = CheckoutSessionStatus +from Monei.model.checkout_session import CheckoutSession + + +class TestCheckoutSession(unittest.TestCase): + """CheckoutSession unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCheckoutSession(self): + """Test CheckoutSession""" + # FIXME: construct object with mandatory attributes with example values + # model = CheckoutSession() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_checkout_session_billing_address_collection.py b/test/test_checkout_session_billing_address_collection.py new file mode 100644 index 0000000..0c76465 --- /dev/null +++ b/test/test_checkout_session_billing_address_collection.py @@ -0,0 +1,36 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.checkout_session_billing_address_collection import ( + CheckoutSessionBillingAddressCollection, +) + + +class TestCheckoutSessionBillingAddressCollection(unittest.TestCase): + """CheckoutSessionBillingAddressCollection unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCheckoutSessionBillingAddressCollection(self): + """Test CheckoutSessionBillingAddressCollection""" + # FIXME: construct object with mandatory attributes with example values + # model = CheckoutSessionBillingAddressCollection() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_checkout_session_business_purchase.py b/test/test_checkout_session_business_purchase.py new file mode 100644 index 0000000..d7fc288 --- /dev/null +++ b/test/test_checkout_session_business_purchase.py @@ -0,0 +1,36 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.checkout_session_business_purchase import ( + CheckoutSessionBusinessPurchase, +) + + +class TestCheckoutSessionBusinessPurchase(unittest.TestCase): + """CheckoutSessionBusinessPurchase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCheckoutSessionBusinessPurchase(self): + """Test CheckoutSessionBusinessPurchase""" + # FIXME: construct object with mandatory attributes with example values + # model = CheckoutSessionBusinessPurchase() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_checkout_session_line_item.py b/test/test_checkout_session_line_item.py new file mode 100644 index 0000000..e653ed3 --- /dev/null +++ b/test/test_checkout_session_line_item.py @@ -0,0 +1,39 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.price_recurring import PriceRecurring +from Monei.model.tax_details import TaxDetails + +globals()["PriceRecurring"] = PriceRecurring +globals()["TaxDetails"] = TaxDetails +from Monei.model.checkout_session_line_item import CheckoutSessionLineItem + + +class TestCheckoutSessionLineItem(unittest.TestCase): + """CheckoutSessionLineItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCheckoutSessionLineItem(self): + """Test CheckoutSessionLineItem""" + # FIXME: construct object with mandatory attributes with example values + # model = CheckoutSessionLineItem() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_checkout_session_line_item_request.py b/test/test_checkout_session_line_item_request.py new file mode 100644 index 0000000..508ddf9 --- /dev/null +++ b/test/test_checkout_session_line_item_request.py @@ -0,0 +1,36 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.checkout_session_line_item_request import ( + CheckoutSessionLineItemRequest, +) + + +class TestCheckoutSessionLineItemRequest(unittest.TestCase): + """CheckoutSessionLineItemRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCheckoutSessionLineItemRequest(self): + """Test CheckoutSessionLineItemRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = CheckoutSessionLineItemRequest() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_checkout_session_list.py b/test/test_checkout_session_list.py new file mode 100644 index 0000000..b305665 --- /dev/null +++ b/test/test_checkout_session_list.py @@ -0,0 +1,37 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.checkout_session import CheckoutSession + +globals()["CheckoutSession"] = CheckoutSession +from Monei.model.checkout_session_list import CheckoutSessionList + + +class TestCheckoutSessionList(unittest.TestCase): + """CheckoutSessionList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCheckoutSessionList(self): + """Test CheckoutSessionList""" + # FIXME: construct object with mandatory attributes with example values + # model = CheckoutSessionList() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_checkout_session_mode.py b/test/test_checkout_session_mode.py new file mode 100644 index 0000000..38fde16 --- /dev/null +++ b/test/test_checkout_session_mode.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.checkout_session_mode import CheckoutSessionMode + + +class TestCheckoutSessionMode(unittest.TestCase): + """CheckoutSessionMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCheckoutSessionMode(self): + """Test CheckoutSessionMode""" + # FIXME: construct object with mandatory attributes with example values + # model = CheckoutSessionMode() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_checkout_session_status.py b/test/test_checkout_session_status.py new file mode 100644 index 0000000..a0e579e --- /dev/null +++ b/test/test_checkout_session_status.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.checkout_session_status import CheckoutSessionStatus + + +class TestCheckoutSessionStatus(unittest.TestCase): + """CheckoutSessionStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCheckoutSessionStatus(self): + """Test CheckoutSessionStatus""" + # FIXME: construct object with mandatory attributes with example values + # model = CheckoutSessionStatus() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_checkout_sessions.py b/test/test_checkout_sessions.py new file mode 100644 index 0000000..9bf450b --- /dev/null +++ b/test/test_checkout_sessions.py @@ -0,0 +1,146 @@ +import unittest +from unittest.mock import patch + +from Monei import ( + CheckoutSessionLineItemRequest, + CreateCheckoutSessionRequest, + MoneiClient, +) +from Monei.api_client import ApiClient +from test.test_subscriptions_preview import _response + +SESSION = { + "id": "cs_1", + "url": "https://checkout.monei.com/cs_1", + "livemode": False, + "status": "OPEN", + "mode": "SUBSCRIPTION", + "currency": "EUR", + "lineItems": [ + { + "priceId": "price_1", + "productId": "prod_1", + "productName": "Gold plan", + "quantity": 1, + "unitAmount": 1653, + "type": "RECURRING", + "billedInFirstPayment": True, + "amountSubtotal": 1653, + "amountTax": 347, + "amountTotal": 2000, + } + ], + "amountSubtotal": 1653, + "amountTax": 347, + "amountTotal": 2000, + "orderId": "order_1", + "description": "Gold plan", + "billingAddressCollection": "OPTIONAL", + "businessPurchase": "DISABLED", + "successUrl": "https://example.com/success", + "expiresAt": 1790000000, + "createdAt": 1789990000, +} + + +class TestCheckoutSessions(unittest.TestCase): + """The generated tests patch nothing below the API method, so they would not + catch a missing client attribute, a wrong path, a wrong body key or a session + response that does not deserialize.""" + + @patch.object(ApiClient, "request") + def test_create_posts_the_lines_and_returns_the_url(self, request): + request.return_value = _response(SESSION) + monei = MoneiClient(api_key="test_api_key") + + session = monei.checkout_sessions.create( + CreateCheckoutSessionRequest( + line_items=[ + CheckoutSessionLineItemRequest(price_id="price_1", quantity=1) + ], + success_url="https://example.com/success", + ) + ) + + method, url = request.call_args.args[:2] + self.assertEqual(method, "POST") + self.assertTrue(url.endswith("/checkout-sessions")) + self.assertEqual( + request.call_args.kwargs["body"], + { + "lineItems": [{"priceId": "price_1", "quantity": 1}], + "successUrl": "https://example.com/success", + }, + ) + self.assertEqual(session.url, "https://checkout.monei.com/cs_1") + self.assertEqual(session.line_items[0].amount_total, 2000) + + @patch.object(ApiClient, "request") + def test_get_reads_the_session_by_id(self, request): + request.return_value = _response(SESSION) + monei = MoneiClient(api_key="test_api_key") + + monei.checkout_sessions.get("cs_1") + + method, url = request.call_args.args[:2] + self.assertEqual(method, "GET") + self.assertTrue(url.endswith("/checkout-sessions/cs_1")) + + @patch.object(ApiClient, "request") + def test_list_sends_the_page_cursor(self, request): + request.return_value = _response({"items": [SESSION], "nextCursor": "c_2"}) + monei = MoneiClient(api_key="test_api_key") + + page = monei.checkout_sessions.list(limit=20, cursor="c_1") + + method, url = request.call_args.args[:2] + self.assertEqual(method, "GET") + self.assertTrue(url.endswith("/checkout-sessions")) + self.assertEqual( + request.call_args.kwargs["query_params"], + [("limit", 20), ("cursor", "c_1")], + ) + self.assertEqual(page.next_cursor, "c_2") + + @patch.object(ApiClient, "request") + def test_payment_keeps_its_checkout_session_id(self, request): + request.return_value = _response( + { + "id": "pay_1", + "accountId": "acc_1", + "amount": 2000, + "currency": "EUR", + "livemode": False, + "status": "SUCCEEDED", + "checkoutSessionId": "cs_1", + } + ) + monei = MoneiClient(api_key="test_api_key") + + payment = monei.payments.get("pay_1") + + self.assertEqual(payment.checkout_session_id, "cs_1") + + @patch.object(ApiClient, "request") + def test_subscription_keeps_its_checkout_session_id(self, request): + request.return_value = _response( + { + "id": "sub_1", + "accountId": "acc_1", + "livemode": False, + "amount": 1653, + "interval": "month", + "intervalCount": 1, + "status": "ACTIVE", + "checkoutSessionId": "cs_1", + } + ) + monei = MoneiClient(api_key="test_api_key") + + subscription = monei.subscriptions.get("sub_1") + + self.assertEqual(subscription.checkout_session_id, "cs_1") + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_checkout_sessions_api.py b/test/test_checkout_sessions_api.py new file mode 100644 index 0000000..55d98d2 --- /dev/null +++ b/test/test_checkout_sessions_api.py @@ -0,0 +1,48 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import unittest + +import Monei +from Monei.api.checkout_sessions_api import CheckoutSessionsApi # noqa: E501 + + +class TestCheckoutSessionsApi(unittest.TestCase): + """CheckoutSessionsApi unit test stubs""" + + def setUp(self): + self.api = CheckoutSessionsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create(self): + """Test case for create + + Create Checkout Session # noqa: E501 + """ + pass + + def test_get(self): + """Test case for get + + Get Checkout Session # noqa: E501 + """ + pass + + def test_list(self): + """Test case for list + + List Checkout Sessions # noqa: E501 + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_create_checkout_session_request.py b/test/test_create_checkout_session_request.py new file mode 100644 index 0000000..245209b --- /dev/null +++ b/test/test_create_checkout_session_request.py @@ -0,0 +1,49 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.checkout_session_billing_address_collection import ( + CheckoutSessionBillingAddressCollection, +) +from Monei.model.checkout_session_business_purchase import ( + CheckoutSessionBusinessPurchase, +) +from Monei.model.checkout_session_line_item_request import ( + CheckoutSessionLineItemRequest, +) + +globals()[ + "CheckoutSessionBillingAddressCollection" +] = CheckoutSessionBillingAddressCollection +globals()["CheckoutSessionBusinessPurchase"] = CheckoutSessionBusinessPurchase +globals()["CheckoutSessionLineItemRequest"] = CheckoutSessionLineItemRequest +from Monei.model.create_checkout_session_request import CreateCheckoutSessionRequest + + +class TestCreateCheckoutSessionRequest(unittest.TestCase): + """CreateCheckoutSessionRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateCheckoutSessionRequest(self): + """Test CreateCheckoutSessionRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateCheckoutSessionRequest() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_payee_verification.py b/test/test_payee_verification.py new file mode 100644 index 0000000..dd1ed24 --- /dev/null +++ b/test/test_payee_verification.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.payee_verification import PayeeVerification + + +class TestPayeeVerification(unittest.TestCase): + """PayeeVerification unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPayeeVerification(self): + """Test PayeeVerification""" + # FIXME: construct object with mandatory attributes with example values + # model = PayeeVerification() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_verification_of_payee_api.py b/test/test_verification_of_payee_api.py new file mode 100644 index 0000000..4bb035f --- /dev/null +++ b/test/test_verification_of_payee_api.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import unittest + +import Monei +from Monei.api.verification_of_payee_api import VerificationOfPayeeApi # noqa: E501 + + +class TestVerificationOfPayeeApi(unittest.TestCase): + """VerificationOfPayeeApi unit test stubs""" + + def setUp(self): + self.api = VerificationOfPayeeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_verify(self): + """Test case for verify + + Verify Payee # noqa: E501 + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_verify_cardholder_request.py b/test/test_verify_cardholder_request.py new file mode 100644 index 0000000..0786c90 --- /dev/null +++ b/test/test_verify_cardholder_request.py @@ -0,0 +1,37 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.cardholder_verification_card import CardholderVerificationCard + +globals()["CardholderVerificationCard"] = CardholderVerificationCard +from Monei.model.verify_cardholder_request import VerifyCardholderRequest + + +class TestVerifyCardholderRequest(unittest.TestCase): + """VerifyCardholderRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVerifyCardholderRequest(self): + """Test VerifyCardholderRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = VerifyCardholderRequest() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_verify_payee_request.py b/test/test_verify_payee_request.py new file mode 100644 index 0000000..9b2fe90 --- /dev/null +++ b/test/test_verify_payee_request.py @@ -0,0 +1,34 @@ +""" +MONEI API v1 + +The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. # noqa: E501 + +The version of the OpenAPI document: 1.13.0 +Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import Monei +from Monei.model.verify_payee_request import VerifyPayeeRequest + + +class TestVerifyPayeeRequest(unittest.TestCase): + """VerifyPayeeRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVerifyPayeeRequest(self): + """Test VerifyPayeeRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = VerifyPayeeRequest() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main()