Skip to content

Commit

Permalink
Generating Python SDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbucket-pipelines committed Jul 17, 2024
1 parent 7ca1444 commit 46d92db
Show file tree
Hide file tree
Showing 18 changed files with 105 additions and 105 deletions.
2 changes: 1 addition & 1 deletion cashfree_pg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
""" # noqa: E501


__version__ = "4.2.0"
__version__ = "4.2.1"

# import apis into sdk package
# import ApiClient
Expand Down
158 changes: 79 additions & 79 deletions cashfree_pg/api_client.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cashfree_pg/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 2023-08-01\n"\
"SDK Package Version: 4.2.0".\
"SDK Package Version: 4.2.1".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
6 changes: 3 additions & 3 deletions cashfree_pg/models/create_subscription_payment_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import json


from typing import Any, Dict, Optional, Union
from typing import Optional, Union
from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr

class CreateSubscriptionPaymentRequest(BaseModel):
Expand All @@ -29,11 +29,11 @@ class CreateSubscriptionPaymentRequest(BaseModel):
subscription_id: StrictStr = Field(..., description="A unique ID passed by merchant for identifying the subscription.")
subscription_session_id: Optional[StrictStr] = Field(None, description="Session ID for the subscription. Required only for Auth.")
payment_id: StrictStr = Field(..., description="A unique ID passed by merchant for identifying the subscription payment.")
payment_amount: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The charge amount of the payment. Required in case of charge.")
payment_amount: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The charge amount of the payment. Requried in case of charge.")
payment_schedule_date: Optional[StrictStr] = Field(None, description="The date on which the payment is scheduled to be processed. Required for UPI and CARD payment modes.")
payment_remarks: Optional[StrictStr] = Field(None, description="Payment remarks.")
payment_type: StrictStr = Field(..., description="Payment type. Can be AUTH or CHARGE.")
payment_method: Optional[Dict[str, Any]] = Field(None, description="Payment method. Can be one of [\"upi\", \"enach\", \"pnach\", \"card\"]")
payment_method: Optional[StrictStr] = Field(None, description="Payment method. Can be upi or card or enach or pnach.")
__properties = ["subscription_id", "subscription_session_id", "payment_id", "payment_amount", "payment_schedule_date", "payment_remarks", "payment_type", "payment_method"]

class Config:
Expand Down
2 changes: 1 addition & 1 deletion cashfree_pg/models/customer_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

class CustomerDetails(BaseModel):
"""
The customer details that are necessary.
The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details.
"""
customer_id: constr(strict=True, max_length=50, min_length=3) = Field(..., description="A unique identifier for the customer. Use alphanumeric values only.")
customer_email: Optional[constr(strict=True, max_length=100, min_length=3)] = Field(None, description="Customer email address.")
Expand Down
2 changes: 1 addition & 1 deletion cashfree_pg/models/customer_details_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CustomerDetailsResponse(BaseModel):
customer_bank_account_number: Optional[constr(strict=True, max_length=20, min_length=3)] = Field(None, description="Customer bank account. Required if you want to do a bank account check (TPV)")
customer_bank_ifsc: Optional[StrictStr] = Field(None, description="Customer bank IFSC. Required if you want to do a bank account check (TPV)")
customer_bank_code: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="Customer bank code. Required for net banking payments, if you want to do a bank account check (TPV)")
customer_uid: Optional[StrictStr] = Field(None, description="Customer identifier at Cashfree. You will get this when you create/get customer ")
customer_uid: Optional[StrictStr] = Field(None, description="Customer identifier at Cashfree. You will get this when you create/get customer")
__properties = ["customer_id", "customer_email", "customer_phone", "customer_name", "customer_bank_account_number", "customer_bank_ifsc", "customer_bank_code", "customer_uid"]

class Config:
Expand Down
4 changes: 2 additions & 2 deletions cashfree_pg/models/simulate_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@



from pydantic import BaseModel, Field, StrictStr, validator
from pydantic import BaseModel, Field, StrictInt, StrictStr, validator
from cashfree_pg.models.entity_simulation_request import EntitySimulationRequest

class SimulateRequest(BaseModel):
"""
simulate payment request object
"""
entity: StrictStr = Field(..., description="Entity type should be PAYMENTS only.")
entity_id: StrictStr = Field(..., description="In case of Entity type is PAYMENTS, entity_id will be transactionId")
entity_id: StrictInt = Field(..., description="In case of Entity type is PAYMENTS, entity_id will be transactionId")
entity_simulation: EntitySimulationRequest = Field(...)
__properties = ["entity", "entity_id", "entity_simulation"]

Expand Down
4 changes: 2 additions & 2 deletions cashfree_pg/models/simulation_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


from typing import Optional
from pydantic import BaseModel, StrictStr
from pydantic import BaseModel, StrictInt, StrictStr
from cashfree_pg.models.entity_simulation_response import EntitySimulationResponse

class SimulationResponse(BaseModel):
Expand All @@ -29,7 +29,7 @@ class SimulationResponse(BaseModel):
"""
simulation_id: Optional[StrictStr] = None
entity: Optional[StrictStr] = None
entity_id: Optional[StrictStr] = None
entity_id: Optional[StrictInt] = None
entity_simulation: Optional[EntitySimulationResponse] = None
__properties = ["simulation_id", "entity", "entity_id", "entity_simulation"]

Expand Down
8 changes: 4 additions & 4 deletions cashfree_pg/models/subscription_customer_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class SubscriptionCustomerDetails(BaseModel):
customer_name: Optional[StrictStr] = Field(None, description="Name of the customer.")
customer_email: StrictStr = Field(..., description="Email of the customer.")
customer_phone: StrictStr = Field(..., description="Phone number of the customer.")
customer_bank_account_holder_name: Optional[StrictStr] = Field(None, description="Bank holder name of the customer.")
customer_bank_holder_name: Optional[StrictStr] = Field(None, description="Bank holder name of the customer.")
customer_bank_account_number: Optional[StrictStr] = Field(None, description="Bank account number of the customer.")
customer_bank_ifsc: Optional[StrictStr] = Field(None, description="IFSC code of the customer.")
customer_bank_code: Optional[StrictStr] = Field(None, description="Bank code of the customer.")
customer_bank_account_type: Optional[StrictStr] = Field(None, description="Bank account type of the customer.")
__properties = ["customer_name", "customer_email", "customer_phone", "customer_bank_account_holder_name", "customer_bank_account_number", "customer_bank_ifsc", "customer_bank_code", "customer_bank_account_type"]
__properties = ["customer_name", "customer_email", "customer_phone", "customer_bank_holder_name", "customer_bank_account_number", "customer_bank_ifsc", "customer_bank_code", "customer_bank_account_type"]

class Config:
"""Pydantic configuration"""
Expand All @@ -58,7 +58,7 @@ def from_json(cls, json_str: str) -> SubscriptionCustomerDetails:
def from_json_for_one_of(cls, json_str: str) -> SubscriptionCustomerDetails:
"""Create an instance of SubscriptionCustomerDetails from a JSON string"""
temp_dict = json.loads(json_str)
if "customer_name, customer_email, customer_phone, customer_bank_account_holder_name, customer_bank_account_number, customer_bank_ifsc, customer_bank_code, customer_bank_account_type" in temp_dict.keys():
if "customer_name, customer_email, customer_phone, customer_bank_holder_name, customer_bank_account_number, customer_bank_ifsc, customer_bank_code, customer_bank_account_type" in temp_dict.keys():
return cls.from_dict(json.loads(json_str))
return None

Expand All @@ -83,7 +83,7 @@ def from_dict(cls, obj: dict) -> SubscriptionCustomerDetails:
"customer_name": obj.get("customer_name"),
"customer_email": obj.get("customer_email"),
"customer_phone": obj.get("customer_phone"),
"customer_bank_account_holder_name": obj.get("customer_bank_account_holder_name"),
"customer_bank_holder_name": obj.get("customer_bank_holder_name"),
"customer_bank_account_number": obj.get("customer_bank_account_number"),
"customer_bank_ifsc": obj.get("customer_bank_ifsc"),
"customer_bank_code": obj.get("customer_bank_code"),
Expand Down
2 changes: 1 addition & 1 deletion configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 2023-08-01\n"\
"SDK Package Version: 4.1.3".\
"SDK Package Version: 4.2.0".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cashfree_pg"
version = "4.2.0"
version = "4.2.1"
description = "Cashfree Payment Gateway APIs"
authors = ["API Support <developers@cashfree.com>"]
license = "Apache 2.0"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
NAME = "cashfree_pg"
VERSION = "4.2.0"
VERSION = "4.2.1"
with open("README.md", "r", encoding="utf-8") as fh:
readme = fh.read()
PYTHON_REQUIRES = ">=3.7"
Expand Down
2 changes: 1 addition & 1 deletion test/test_create_subscription_payment_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def make_instance(self, include_optional):
payment_schedule_date = '',
payment_remarks = '',
payment_type = '',
payment_method = None
payment_method = ''
)
else :
return CreateSubscriptionPaymentRequest(
Expand Down
4 changes: 2 additions & 2 deletions test/test_create_subscription_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def make_instance(self, include_optional):
if include_optional :
return CreateSubscriptionRequest(
subscription_id = '0',
customer_details = {"customer_name":"Test Cust","customer_email":"test@gmail.com","customer_phone":"9900755700","customer_bank_holder_name":"","customer_bank_account_holder_name":"","customer_bank_ifsc":"","customer_bank_code":"","customer_bank_account_type":""},
customer_details = {"customer_name":"Test Cust","customer_email":"test@gmail.com","customer_phone":"9900755700","customer_bank_holder_name":"","customer_bank_account_number":"","customer_bank_ifsc":"","customer_bank_code":"","customer_bank_account_type":""},
plan_details = cashfree_pg.models.create_subscription_request_plan_details.CreateSubscriptionRequest_plan_details(
plan_id = '',
plan_name = '',
Expand Down Expand Up @@ -71,7 +71,7 @@ def make_instance(self, include_optional):
else :
return CreateSubscriptionRequest(
subscription_id = '0',
customer_details = {"customer_name":"Test Cust","customer_email":"test@gmail.com","customer_phone":"9900755700","customer_bank_holder_name":"","customer_bank_account_holder_name":"","customer_bank_ifsc":"","customer_bank_code":"","customer_bank_account_type":""},
customer_details = {"customer_name":"Test Cust","customer_email":"test@gmail.com","customer_phone":"9900755700","customer_bank_holder_name":"","customer_bank_account_number":"","customer_bank_ifsc":"","customer_bank_code":"","customer_bank_account_type":""},
plan_details = cashfree_pg.models.create_subscription_request_plan_details.CreateSubscriptionRequest_plan_details(
plan_id = '',
plan_name = '',
Expand Down
4 changes: 2 additions & 2 deletions test/test_simulate_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ def make_instance(self, include_optional):
if include_optional :
return SimulateRequest(
entity = 'PAYMENTS',
entity_id = '',
entity_id = 56,
entity_simulation = {"payment_status":"FAILED","payment_error_code":"ISSUER_NOT_AVAILABLE"}
)
else :
return SimulateRequest(
entity = 'PAYMENTS',
entity_id = '',
entity_id = 56,
entity_simulation = {"payment_status":"FAILED","payment_error_code":"ISSUER_NOT_AVAILABLE"},
)
"""
Expand Down
2 changes: 1 addition & 1 deletion test/test_simulation_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def make_instance(self, include_optional):
return SimulationResponse(
simulation_id = '',
entity = '',
entity_id = '',
entity_id = 56,
entity_simulation = {"payment_status":"FAILED","payment_error_code":"ISSUER_NOT_AVAILABLE"}
)
else :
Expand Down
2 changes: 1 addition & 1 deletion test/test_subscription_customer_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def make_instance(self, include_optional):
customer_name = '',
customer_email = '',
customer_phone = '',
customer_bank_account_holder_name = '',
customer_bank_holder_name = '',
customer_bank_account_number = '',
customer_bank_ifsc = '',
customer_bank_code = '',
Expand Down
2 changes: 1 addition & 1 deletion test/test_subscription_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def make_instance(self, include_optional):
return SubscriptionEntity(
authorisation_details = {"authorization_amount":1,"authorization_amount_refund":false,"authorization_reference":"","authorization_time":"2022-06-14T23:47:52+05:30","authorization_status":"INITIALIZED","payment_id":"97877","payment_method":"NPCI_SBC"},
cf_subscription_id = '',
customer_details = {"customer_name":"Test Cust","customer_email":"test@gmail.com","customer_phone":"9900755700","customer_bank_holder_name":"","customer_bank_account_holder_name":"","customer_bank_ifsc":"","customer_bank_code":"","customer_bank_account_type":""},
customer_details = {"customer_name":"Test Cust","customer_email":"test@gmail.com","customer_phone":"9900755700","customer_bank_holder_name":"","customer_bank_account_number":"","customer_bank_ifsc":"","customer_bank_code":"","customer_bank_account_type":""},
plan_details = {"plan_currency":"INR","plan_id":"144436-03471-JD_TEST","plan_interval_type":"WEEK","plan_intervals":1,"plan_max_amount":1,"plan_max_cycles":4,"plan_name":"abscede","plan_note":"lsdkdn","plan_recurring_amount":1,"plan_status":"ACTIVE","plan_type":"PERIODIC"},
subscription_expiry_time = '',
subscription_first_charge_time = '',
Expand Down

0 comments on commit 46d92db

Please sign in to comment.