From 9fb720bde9a679f30a0b8781cb67ec66f3d264d6 Mon Sep 17 00:00:00 2001 From: bitbucket-pipelines Date: Thu, 25 Jan 2024 07:39:27 +0000 Subject: [PATCH] Generating Python SDK. --- cashfree_pg/__init__.py | 2 +- cashfree_pg/api_client.py | 66 +++++++++---------- cashfree_pg/configuration.py | 2 +- cashfree_pg/models/cashback_details.py | 8 +-- cashfree_pg/models/discount_details.py | 8 +-- .../offer_validations_payment_method.py | 14 ++-- .../pay_order_request_payment_method.py | 14 ++-- .../models/payment_entity_payment_method.py | 14 ++-- configuration.py | 2 +- docs/CashbackDetails.md | 4 +- docs/DiscountDetails.md | 4 +- pyproject.toml | 2 +- setup.py | 2 +- test/test_cashback_details.py | 8 +-- test/test_create_offer_request.py | 4 +- test/test_discount_details.py | 8 +-- test/test_offer_entity.py | 2 +- 17 files changed, 82 insertions(+), 82 deletions(-) diff --git a/cashfree_pg/__init__.py b/cashfree_pg/__init__.py index 664be78..d4c64a6 100644 --- a/cashfree_pg/__init__.py +++ b/cashfree_pg/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "3.2.6" +__version__ = "3.2.7" # import apis into sdk package # import ApiClient diff --git a/cashfree_pg/api_client.py b/cashfree_pg/api_client.py index 1114187..873ffa8 100644 --- a/cashfree_pg/api_client.py +++ b/cashfree_pg/api_client.py @@ -342,7 +342,7 @@ def PGEligibilityFetchCardlessEmi(self, x_api_version : Annotated[StrictStr, Fie if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -498,7 +498,7 @@ def PGEligibilityFetchOffers(self, x_api_version : Annotated[StrictStr, Field(.. if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -653,7 +653,7 @@ def PGEligibilityFetchPaylater(self, x_api_version : Annotated[StrictStr, Field( if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -809,7 +809,7 @@ def PGEligibilityFetchPaymentMethods(self, x_api_version : Annotated[StrictStr, if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -966,7 +966,7 @@ def PGCreateOffer(self, x_api_version : Annotated[StrictStr, Field(..., descript if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -1124,7 +1124,7 @@ def PGFetchOffer(self, x_api_version : Annotated[StrictStr, Field(..., descripti if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -1270,7 +1270,7 @@ def PGCreateOrder(self, x_api_version : Annotated[StrictStr, Field(..., descript if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -1428,7 +1428,7 @@ def PGFetchOrder(self, x_api_version : Annotated[StrictStr, Field(..., descripti if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -1580,7 +1580,7 @@ def PGFetchRecon(self, x_api_version : Annotated[StrictStr, Field(..., descripti if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -1739,7 +1739,7 @@ def PGCancelLink(self, x_api_version : Annotated[StrictStr, Field(..., descripti if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -1884,7 +1884,7 @@ def PGCreateLink(self, x_api_version : Annotated[StrictStr, Field(..., descripti if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -2042,7 +2042,7 @@ def PGFetchLink(self, x_api_version : Annotated[StrictStr, Field(..., descriptio if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -2191,7 +2191,7 @@ def PGLinkFetchOrders(self, x_api_version : Annotated[StrictStr, Field(..., desc if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -2343,7 +2343,7 @@ def PGAuthorizeOrder(self, x_api_version : Annotated[StrictStr, Field(..., descr if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -2505,7 +2505,7 @@ def PGOrderAuthenticatePayment(self, x_api_version : Annotated[StrictStr, Field( if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -2670,7 +2670,7 @@ def PGOrderFetchPayment(self, x_api_version : Annotated[StrictStr, Field(..., de if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -2819,7 +2819,7 @@ def PGOrderFetchPayments(self, x_api_version : Annotated[StrictStr, Field(..., d if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -2965,7 +2965,7 @@ def PGPayOrder(self, x_api_version : Annotated[StrictStr, Field(..., description if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -3128,7 +3128,7 @@ def PGOrderCreateRefund(self, x_api_version : Annotated[StrictStr, Field(..., de if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -3293,7 +3293,7 @@ def PGOrderFetchRefund(self, x_api_version : Annotated[StrictStr, Field(..., des if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -3442,7 +3442,7 @@ def PGOrderFetchRefunds(self, x_api_version : Annotated[StrictStr, Field(..., de if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -3594,7 +3594,7 @@ def PGFetchSettlements(self, x_api_version : Annotated[StrictStr, Field(..., des if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -3755,7 +3755,7 @@ def PGSettlementFetchRecon(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -3914,7 +3914,7 @@ def PGOrderFetchSettlement(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -4070,7 +4070,7 @@ def PGCustomerDeleteInstrument(self, x_api_version : Annotated[StrictStr, Field( if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -4225,7 +4225,7 @@ def PGCustomerFetchInstrument(self, x_api_version : Annotated[StrictStr, Field(. if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -4380,7 +4380,7 @@ def PGCustomerFetchInstruments(self, x_api_version : Annotated[StrictStr, Field( if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -4534,7 +4534,7 @@ def PGCustomerInstrumentsFetchCryptogram(self, x_api_version : Annotated[StrictS if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -4681,7 +4681,7 @@ def SposCreateTerminal(self, x_api_version : Annotated[StrictStr, Field(..., des if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -4836,7 +4836,7 @@ def SposCreateTerminalTransaction(self, x_api_version : Annotated[StrictStr, Fie if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -4994,7 +4994,7 @@ def SposFetchTerminal(self, x_api_version : Annotated[StrictStr, Field(..., desc if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -5148,7 +5148,7 @@ def SposFetchTerminalQrCodes(self, x_api_version : Annotated[StrictStr, Field(.. if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-3.2.6" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.7" # process the form parameters _form_params = [] @@ -5237,7 +5237,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/3.2.6/python' + self.user_agent = 'OpenAPI-Generator/3.2.7/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/cashfree_pg/configuration.py b/cashfree_pg/configuration.py index c959079..0096953 100644 --- a/cashfree_pg/configuration.py +++ b/cashfree_pg/configuration.py @@ -434,7 +434,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 2022-09-01\n"\ - "SDK Package Version: 3.2.6".\ + "SDK Package Version: 3.2.7".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/cashfree_pg/models/cashback_details.py b/cashfree_pg/models/cashback_details.py index b15122c..5ba95f1 100644 --- a/cashfree_pg/models/cashback_details.py +++ b/cashfree_pg/models/cashback_details.py @@ -19,16 +19,16 @@ import json - -from pydantic import BaseModel, Field, constr, validator +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, constr, validator class CashbackDetails(BaseModel): """ Cashback detail boject """ cashback_type: constr(strict=True, max_length=50, min_length=1) = Field(..., description="Type of discount") - cashback_value: constr(strict=True, max_length=100, min_length=1) = Field(..., description="Value of Discount.") - max_cashback_amount: constr(strict=True, max_length=100, min_length=1) = Field(..., description="Maximum Value of Cashback allowed.") + cashback_value: Union[StrictFloat, StrictInt] = Field(..., description="Value of Discount.") + max_cashback_amount: Union[StrictFloat, StrictInt] = Field(..., description="Maximum Value of Cashback allowed.") __properties = ["cashback_type", "cashback_value", "max_cashback_amount"] @validator('cashback_type') diff --git a/cashfree_pg/models/discount_details.py b/cashfree_pg/models/discount_details.py index 6d3ad63..e80e4b4 100644 --- a/cashfree_pg/models/discount_details.py +++ b/cashfree_pg/models/discount_details.py @@ -19,16 +19,16 @@ import json - -from pydantic import BaseModel, Field, constr, validator +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, constr, validator class DiscountDetails(BaseModel): """ detils of the discount object of offer """ discount_type: constr(strict=True, max_length=50, min_length=3) = Field(..., description="Type of discount") - discount_value: constr(strict=True, max_length=100, min_length=1) = Field(..., description="Value of Discount.") - max_discount_amount: constr(strict=True, max_length=100, min_length=1) = Field(..., description="Maximum Value of Discount allowed.") + discount_value: Union[StrictFloat, StrictInt] = Field(..., description="Value of Discount.") + max_discount_amount: Union[StrictFloat, StrictInt] = Field(..., description="Maximum Value of Discount allowed.") __properties = ["discount_type", "discount_value", "max_discount_amount"] @validator('discount_type') diff --git a/cashfree_pg/models/offer_validations_payment_method.py b/cashfree_pg/models/offer_validations_payment_method.py index f0017f9..cc82aa7 100644 --- a/cashfree_pg/models/offer_validations_payment_method.py +++ b/cashfree_pg/models/offer_validations_payment_method.py @@ -135,7 +135,7 @@ def from_json(cls, json_str: str) -> OfferValidationsPaymentMethod: instance.actual_instance = OfferAll.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into OfferCard @@ -143,7 +143,7 @@ def from_json(cls, json_str: str) -> OfferValidationsPaymentMethod: instance.actual_instance = OfferCard.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into OfferNB @@ -151,7 +151,7 @@ def from_json(cls, json_str: str) -> OfferValidationsPaymentMethod: instance.actual_instance = OfferNB.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into OfferWallet @@ -159,7 +159,7 @@ def from_json(cls, json_str: str) -> OfferValidationsPaymentMethod: instance.actual_instance = OfferWallet.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into OfferUPI @@ -167,7 +167,7 @@ def from_json(cls, json_str: str) -> OfferValidationsPaymentMethod: instance.actual_instance = OfferUPI.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into OfferPaylater @@ -175,7 +175,7 @@ def from_json(cls, json_str: str) -> OfferValidationsPaymentMethod: instance.actual_instance = OfferPaylater.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into OfferEMI @@ -183,7 +183,7 @@ def from_json(cls, json_str: str) -> OfferValidationsPaymentMethod: instance.actual_instance = OfferEMI.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) diff --git a/cashfree_pg/models/pay_order_request_payment_method.py b/cashfree_pg/models/pay_order_request_payment_method.py index f8fe12b..3ea5990 100644 --- a/cashfree_pg/models/pay_order_request_payment_method.py +++ b/cashfree_pg/models/pay_order_request_payment_method.py @@ -135,7 +135,7 @@ def from_json(cls, json_str: str) -> PayOrderRequestPaymentMethod: instance.actual_instance = CardPaymentMethod.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into UPIPaymentMethod @@ -143,7 +143,7 @@ def from_json(cls, json_str: str) -> PayOrderRequestPaymentMethod: instance.actual_instance = UPIPaymentMethod.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into NetBankingPaymentMethod @@ -151,7 +151,7 @@ def from_json(cls, json_str: str) -> PayOrderRequestPaymentMethod: instance.actual_instance = NetBankingPaymentMethod.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into AppPaymentMethod @@ -159,7 +159,7 @@ def from_json(cls, json_str: str) -> PayOrderRequestPaymentMethod: instance.actual_instance = AppPaymentMethod.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into CardEMIPaymentMethod @@ -167,7 +167,7 @@ def from_json(cls, json_str: str) -> PayOrderRequestPaymentMethod: instance.actual_instance = CardEMIPaymentMethod.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into CardlessEMIPaymentMethod @@ -175,7 +175,7 @@ def from_json(cls, json_str: str) -> PayOrderRequestPaymentMethod: instance.actual_instance = CardlessEMIPaymentMethod.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaylaterPaymentMethod @@ -183,7 +183,7 @@ def from_json(cls, json_str: str) -> PayOrderRequestPaymentMethod: instance.actual_instance = PaylaterPaymentMethod.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) diff --git a/cashfree_pg/models/payment_entity_payment_method.py b/cashfree_pg/models/payment_entity_payment_method.py index 71d3a84..d2a2219 100644 --- a/cashfree_pg/models/payment_entity_payment_method.py +++ b/cashfree_pg/models/payment_entity_payment_method.py @@ -135,7 +135,7 @@ def from_json(cls, json_str: str) -> PaymentEntityPaymentMethod: instance.actual_instance = PaymentMethodCardInPaymentsEntity.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodNetBankingInPaymentsEntity @@ -143,7 +143,7 @@ def from_json(cls, json_str: str) -> PaymentEntityPaymentMethod: instance.actual_instance = PaymentMethodNetBankingInPaymentsEntity.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodUPIInPaymentsEntity @@ -151,7 +151,7 @@ def from_json(cls, json_str: str) -> PaymentEntityPaymentMethod: instance.actual_instance = PaymentMethodUPIInPaymentsEntity.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodAppInPaymentsEntity @@ -159,7 +159,7 @@ def from_json(cls, json_str: str) -> PaymentEntityPaymentMethod: instance.actual_instance = PaymentMethodAppInPaymentsEntity.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodCardlessEMIInPaymentsEntity @@ -167,7 +167,7 @@ def from_json(cls, json_str: str) -> PaymentEntityPaymentMethod: instance.actual_instance = PaymentMethodCardlessEMIInPaymentsEntity.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodPaylaterInPaymentsEntity @@ -175,7 +175,7 @@ def from_json(cls, json_str: str) -> PaymentEntityPaymentMethod: instance.actual_instance = PaymentMethodPaylaterInPaymentsEntity.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) # deserialize data into PaymentMethodCardEMIInPaymentsEntity @@ -183,7 +183,7 @@ def from_json(cls, json_str: str) -> PaymentEntityPaymentMethod: instance.actual_instance = PaymentMethodCardEMIInPaymentsEntity.from_json(json_str) match += 1 if (instance.actual_instance is not None): - return instance.actual_instance + return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) diff --git a/configuration.py b/configuration.py index 9d5099a..c959079 100644 --- a/configuration.py +++ b/configuration.py @@ -434,7 +434,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 2022-09-01\n"\ - "SDK Package Version: 3.2.5".\ + "SDK Package Version: 3.2.6".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/docs/CashbackDetails.md b/docs/CashbackDetails.md index 9ff7219..e743a0b 100644 --- a/docs/CashbackDetails.md +++ b/docs/CashbackDetails.md @@ -6,8 +6,8 @@ Cashback detail boject Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cashback_type** | **str** | Type of discount | -**cashback_value** | **str** | Value of Discount. | -**max_cashback_amount** | **str** | Maximum Value of Cashback allowed. | +**cashback_value** | **float** | Value of Discount. | +**max_cashback_amount** | **float** | Maximum Value of Cashback allowed. | ## Example diff --git a/docs/DiscountDetails.md b/docs/DiscountDetails.md index 906e640..f9d8ab8 100644 --- a/docs/DiscountDetails.md +++ b/docs/DiscountDetails.md @@ -6,8 +6,8 @@ detils of the discount object of offer Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **discount_type** | **str** | Type of discount | -**discount_value** | **str** | Value of Discount. | -**max_discount_amount** | **str** | Maximum Value of Discount allowed. | +**discount_value** | **float** | Value of Discount. | +**max_discount_amount** | **float** | Maximum Value of Discount allowed. | ## Example diff --git a/pyproject.toml b/pyproject.toml index 1dd6a02..cbc0ff2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cashfree_pg" -version = "3.2.6" +version = "3.2.7" description = "Cashfree Payment Gateway APIs" authors = ["API Support "] license = "Apache 2.0" diff --git a/setup.py b/setup.py index d616968..8e4f485 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "cashfree_pg" -VERSION = "3.2.6" +VERSION = "3.2.7" with open("README.md", "r", encoding="utf-8") as fh: readme = fh.read() PYTHON_REQUIRES = ">=3.7" diff --git a/test/test_cashback_details.py b/test/test_cashback_details.py index ae62506..e2d6e25 100644 --- a/test/test_cashback_details.py +++ b/test/test_cashback_details.py @@ -40,14 +40,14 @@ def make_instance(self, include_optional): if include_optional : return CashbackDetails( cashback_type = 'flat', - cashback_value = '0', - max_cashback_amount = '0' + cashback_value = 1.337, + max_cashback_amount = 1.337 ) else : return CashbackDetails( cashback_type = 'flat', - cashback_value = '0', - max_cashback_amount = '0', + cashback_value = 1.337, + max_cashback_amount = 1.337, ) """ diff --git a/test/test_create_offer_request.py b/test/test_create_offer_request.py index ec5d3ec..af9f491 100644 --- a/test/test_create_offer_request.py +++ b/test/test_create_offer_request.py @@ -41,14 +41,14 @@ def make_instance(self, include_optional): return CreateOfferRequest( offer_meta = {"offer_title":"some title","offer_description":"some offer description","offer_code":"CFTESTOFFER","offer_start_time":"2023-03-21T08:09:51Z","offer_end_time":"2023-03-29T08:09:51Z"}, offer_tnc = {"offer_tnc_type":"text","offer_tnc_value":"TnC for the Offer."}, - offer_details = {"offer_type":"DISCOUNT_AND_CASHBACK","discount_details":{"discount_type":"flat","discount_value":"10","max_discount_amount":"10"},"cashback_details":{"cashback_type":"percentage","cashback_value":"20","max_cashback_amount":"150"}}, + offer_details = {"offer_type":"DISCOUNT_AND_CASHBACK","discount_details":{"discount_type":"flat","discount_value":"10","max_discount_amount":"10"},"cashback_details":{"cashback_type":"percentage","cashback_value":20,"max_cashback_amount":"150"}}, offer_validations = {"min_amount":10,"payment_method":{"wallet":{"issuer":"paytm"}},"max_allowed":2} ) else : return CreateOfferRequest( offer_meta = {"offer_title":"some title","offer_description":"some offer description","offer_code":"CFTESTOFFER","offer_start_time":"2023-03-21T08:09:51Z","offer_end_time":"2023-03-29T08:09:51Z"}, offer_tnc = {"offer_tnc_type":"text","offer_tnc_value":"TnC for the Offer."}, - offer_details = {"offer_type":"DISCOUNT_AND_CASHBACK","discount_details":{"discount_type":"flat","discount_value":"10","max_discount_amount":"10"},"cashback_details":{"cashback_type":"percentage","cashback_value":"20","max_cashback_amount":"150"}}, + offer_details = {"offer_type":"DISCOUNT_AND_CASHBACK","discount_details":{"discount_type":"flat","discount_value":"10","max_discount_amount":"10"},"cashback_details":{"cashback_type":"percentage","cashback_value":20,"max_cashback_amount":"150"}}, offer_validations = {"min_amount":10,"payment_method":{"wallet":{"issuer":"paytm"}},"max_allowed":2}, ) """ diff --git a/test/test_discount_details.py b/test/test_discount_details.py index 29ea163..da74a01 100644 --- a/test/test_discount_details.py +++ b/test/test_discount_details.py @@ -40,14 +40,14 @@ def make_instance(self, include_optional): if include_optional : return DiscountDetails( discount_type = 'flat', - discount_value = '0', - max_discount_amount = '0' + discount_value = 1.337, + max_discount_amount = 1.337 ) else : return DiscountDetails( discount_type = 'flat', - discount_value = '0', - max_discount_amount = '0', + discount_value = 1.337, + max_discount_amount = 1.337, ) """ diff --git a/test/test_offer_entity.py b/test/test_offer_entity.py index 6c72751..73e397b 100644 --- a/test/test_offer_entity.py +++ b/test/test_offer_entity.py @@ -43,7 +43,7 @@ def make_instance(self, include_optional): offer_status = 'active', offer_meta = {"offer_title":"some title","offer_description":"some offer description","offer_code":"CFTESTOFFER","offer_start_time":"2023-03-21T08:09:51Z","offer_end_time":"2023-03-29T08:09:51Z"}, offer_tnc = {"offer_tnc_type":"text","offer_tnc_value":"TnC for the Offer."}, - offer_details = {"offer_type":"DISCOUNT_AND_CASHBACK","discount_details":{"discount_type":"flat","discount_value":"10","max_discount_amount":"10"},"cashback_details":{"cashback_type":"percentage","cashback_value":"20","max_cashback_amount":"150"}}, + offer_details = {"offer_type":"DISCOUNT_AND_CASHBACK","discount_details":{"discount_type":"flat","discount_value":"10","max_discount_amount":"10"},"cashback_details":{"cashback_type":"percentage","cashback_value":20,"max_cashback_amount":"150"}}, offer_validations = {"min_amount":10,"payment_method":{"wallet":{"issuer":"paytm"}},"max_allowed":2} ) else :