Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.0
7.18.0
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ from cashfree_pg.api_client import Cashfree
from cashfree_pg.models.customer_details import CustomerDetails
from cashfree_pg.models.order_meta import OrderMeta

Cashfree.XClientId = "<x-client-id>"
Cashfree.XClientSecret = "<x-client-secret>"
Cashfree.XEnvironment = Cashfree.SANDBOX
x_api_version = "2023-08-01"
cashfree_instance = Cashfree(
XEnvironment=Cashfree.SANDBOX,
XClientId="<x-client-id>",
XClientSecret="<x-client-secret>",
XPartnerKey="<x-partner-key>",
XClientSignature="<x-client-signature>",
XPartnerMerchantId="<x-partner-merchant-id>"
)
```

Generate your API keys (x-client-id , x-client-secret) from [Cashfree Merchant Dashboard](https://merchant.cashfree.com/merchants/login)
Expand All @@ -42,7 +46,7 @@ customerDetails = CustomerDetails(customer_id="walterwNrcMi", customer_phone="99
orderMeta = OrderMeta(return_url="https://www.cashfree.com/devstudio/preview/pg/web/checkout?order_id={order_id}")
createOrderRequest = CreateOrderRequest(order_amount=1, order_currency="INR", customer_details=customerDetails, order_meta=orderMeta)
try:
api_response = Cashfree().PGCreateOrder(x_api_version, createOrderRequest, None, None)
api_response = cashfree_instance.PGCreateOrder(x_api_version, createOrderRequest, None, None)
print(api_response.data)
except Exception as e:
print(e)
Expand All @@ -51,7 +55,7 @@ except Exception as e:
Get Order
```python
try:
api_response = Cashfree().PGFetchOrder(x_api_version, "order_3242X4jQ5f0S9KYxZO9mtDL1Kx2Y7u", None)
api_response = cashfree_instance.PGFetchOrder(x_api_version, "order_3242X4jQ5f0S9KYxZO9mtDL1Kx2Y7u", None)
print(api_response.data)
except Exception as e:
print(e)
Expand Down
15 changes: 7 additions & 8 deletions cashfree_pg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
# flake8: noqa

"""
Cashfree Payment Gateway APIs
Cashfree Payment Gateway APIs

Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.

The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501


__version__ = "4.5.1"
__version__ = "5.0.5"

# import apis into sdk package
# import ApiClient
Expand Down
1,588 changes: 847 additions & 741 deletions cashfree_pg/api_client.py

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions cashfree_pg/api_response.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""API response object."""

from __future__ import annotations
from typing import Any, Dict, Optional
from pydantic import Field, StrictInt, StrictStr
from typing import Any, Dict, Optional, List, Tuple, Union
from pydantic import validate_arguments, ValidationError, Field, StrictStr, StrictBytes, StrictInt, StrictFloat, StrictBool, field_validator, BaseModel

# Updated imports for Pydantic v2 compatibility

class ApiResponse:
"""
Expand Down
15 changes: 7 additions & 8 deletions cashfree_pg/configuration.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# coding: utf-8

"""
Cashfree Payment Gateway APIs
Cashfree Payment Gateway APIs
Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501


import copy
import logging
import multiprocessing
Expand Down Expand Up @@ -434,7 +433,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.5.1".\
"SDK Package Version: 5.0.5".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
13 changes: 6 additions & 7 deletions cashfree_pg/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# coding: utf-8

"""
Cashfree Payment Gateway APIs
Cashfree Payment Gateway APIs

Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.

The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501


class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""

Expand Down
13 changes: 6 additions & 7 deletions cashfree_pg/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@

# flake8: noqa
"""
Cashfree Payment Gateway APIs
Cashfree Payment Gateway APIs

Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.

The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501


# import models into model package
from cashfree_pg.models.address_details import AddressDetails
from cashfree_pg.models.adjust_vendor_balance_request import AdjustVendorBalanceRequest
Expand Down
55 changes: 31 additions & 24 deletions cashfree_pg/models/address_details.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,52 @@
# coding: utf-8

"""
Cashfree Payment Gateway APIs
Cashfree Payment Gateway APIs
Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501


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

from datetime import date, datetime


from typing import Optional
from pydantic import BaseModel, Field, StrictStr
from pydantic import validate_arguments, ValidationError, Field, StrictStr, StrictBytes, StrictInt, StrictFloat, StrictBool, field_validator, BaseModel
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

class AddressDetails(BaseModel):
"""
Address associated with the customer.
"""
name: Optional[StrictStr] = Field(None, description="Full Name of the customer associated with the address.")
address_line_one: Optional[StrictStr] = Field(None, description="First line of the address.")
address_line_two: Optional[StrictStr] = Field(None, description="Second line of the address.")
country: Optional[StrictStr] = Field(None, description="Country Name.")
country_code: Optional[StrictStr] = Field(None, description="Country Code.")
state: Optional[StrictStr] = Field(None, description="State Name.")
state_code: Optional[StrictStr] = Field(None, description="State Code.")
city: Optional[StrictStr] = Field(None, description="City Name.")
pin_code: Optional[StrictStr] = Field(None, description="Pin Code/Zip Code.")
phone: Optional[StrictStr] = Field(None, description="Customer Phone Number.")
email: Optional[StrictStr] = Field(None, description="Cutomer Email Address.")
name: Optional[StrictStr] = Field(default=None, description="Full Name of the customer associated with the address.")
address_line_one: Optional[StrictStr] = Field(default=None, description="First line of the address.")
address_line_two: Optional[StrictStr] = Field(default=None, description="Second line of the address.")
country: Optional[StrictStr] = Field(default=None, description="Country Name.")
country_code: Optional[StrictStr] = Field(default=None, description="Country Code.")
state: Optional[StrictStr] = Field(default=None, description="State Name.")
state_code: Optional[StrictStr] = Field(default=None, description="State Code.")
city: Optional[StrictStr] = Field(default=None, description="City Name.")
pin_code: Optional[StrictStr] = Field(default=None, description="Pin Code/Zip Code.")
phone: Optional[StrictStr] = Field(default=None, description="Customer Phone Number.")
email: Optional[StrictStr] = Field(default=None, description="Cutomer Email Address.")
__properties = ["name", "address_line_one", "address_line_two", "country", "country_code", "state", "state_code", "city", "pin_code", "phone", "email"]

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
# Updated to Pydantic v2
"""Pydantic configuration"""
model_config = {
"populate_by_name": True,
"validate_assignment": True
}

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
Expand Down Expand Up @@ -98,3 +102,6 @@ def from_dict(cls, obj: dict) -> AddressDetails:
return _obj


# Pydantic v2: resolve forward references & Annotated types
AddressDetails.model_rebuild()

43 changes: 25 additions & 18 deletions cashfree_pg/models/adjust_vendor_balance_request.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
# coding: utf-8

"""
Cashfree Payment Gateway APIs
Cashfree Payment Gateway APIs

Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.

The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501


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

from datetime import date, datetime


from typing import Any, Dict, Optional, Union
from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr
from pydantic import validate_arguments, ValidationError, Field, StrictStr, StrictBytes, StrictInt, StrictFloat, StrictBool, field_validator, BaseModel
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

class AdjustVendorBalanceRequest(BaseModel):
"""
Adjust Vendor Balance Request
"""
transfer_from: StrictStr = Field(..., description="Mention to whom you want to transfer the on demand balance. Possible values - MERCHANT, VENDOR.")
transfer_type: StrictStr = Field(..., description="Mention the type of transfer. Possible values: ON_DEMAND.")
transfer_amount: Union[StrictFloat, StrictInt] = Field(..., description="Mention the on demand transfer amount.")
remark: Optional[StrictStr] = Field(None, description="Mention remarks if any for the on demand transfer.")
tags: Optional[Dict[str, Any]] = Field(None, description="Provide additional data fields using tags.")
transfer_from: StrictStr = Field(description="Mention to whom you want to transfer the on demand balance. Possible values - MERCHANT, VENDOR.")
transfer_type: StrictStr = Field(description="Mention the type of transfer. Possible values: ON_DEMAND.")
transfer_amount: Union[StrictFloat, StrictInt] = Field(description="Mention the on demand transfer amount.")
remark: Optional[StrictStr] = Field(default=None, description="Mention remarks if any for the on demand transfer.")
tags: Optional[Dict[str, Any]] = Field(default=None, description="Provide additional data fields using tags.")
__properties = ["transfer_from", "transfer_type", "transfer_amount", "remark", "tags"]

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
# Updated to Pydantic v2
"""Pydantic configuration"""
model_config = {
"populate_by_name": True,
"validate_assignment": True
}

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
Expand Down Expand Up @@ -86,3 +90,6 @@ def from_dict(cls, obj: dict) -> AdjustVendorBalanceRequest:
return _obj


# Pydantic v2: resolve forward references & Annotated types
AdjustVendorBalanceRequest.model_rebuild()

33 changes: 20 additions & 13 deletions cashfree_pg/models/adjust_vendor_balance_response.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
# coding: utf-8

"""
Cashfree Payment Gateway APIs
Cashfree Payment Gateway APIs

Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.

The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 2023-08-01
Contact: developers@cashfree.com
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501


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

from datetime import date, datetime


from typing import Optional, Union
from pydantic import BaseModel, StrictFloat, StrictInt
from cashfree_pg.models.balance_details import BalanceDetails
from cashfree_pg.models.charges_details import ChargesDetails
from cashfree_pg.models.transfer_details import TransferDetails
from pydantic import validate_arguments, ValidationError, Field, StrictStr, StrictBytes, StrictInt, StrictFloat, StrictBool, field_validator, BaseModel
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

class AdjustVendorBalanceResponse(BaseModel):
"""
Expand All @@ -35,10 +37,12 @@ class AdjustVendorBalanceResponse(BaseModel):
charges: Optional[ChargesDetails] = None
__properties = ["settlement_id", "transfer_details", "balances", "charges"]

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
# Updated to Pydantic v2
"""Pydantic configuration"""
model_config = {
"populate_by_name": True,
"validate_assignment": True
}

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
Expand Down Expand Up @@ -96,3 +100,6 @@ def from_dict(cls, obj: dict) -> AdjustVendorBalanceResponse:
return _obj


# Pydantic v2: resolve forward references & Annotated types
AdjustVendorBalanceResponse.model_rebuild()

Loading