Skip to content

Commit 5f8e21f

Browse files
author
bitbucket-pipelines
committed
Generating Python SDK.
1 parent 4e4d008 commit 5f8e21f

File tree

553 files changed

+8569
-6930
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

553 files changed

+8569
-6930
lines changed

.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.0
1+
7.18.0

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# ref: https://docs.travis-ci.com/user/languages/python
22
language: python
33
python:
4-
- "3.7"
5-
- "3.8"
64
- "3.9"
75
- "3.10"
86
- "3.11"

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ from cashfree_pg.api_client import Cashfree
2727
from cashfree_pg.models.customer_details import CustomerDetails
2828
from cashfree_pg.models.order_meta import OrderMeta
2929

30-
Cashfree.XClientId = "<x-client-id>"
31-
Cashfree.XClientSecret = "<x-client-secret>"
32-
Cashfree.XEnvironment = Cashfree.SANDBOX
33-
x_api_version = "2023-08-01"
30+
cashfree_instance = Cashfree(
31+
XEnvironment=Cashfree.SANDBOX,
32+
XClientId="<x-client-id>",
33+
XClientSecret="<x-client-secret>",
34+
XPartnerKey="<x-partner-key>",
35+
XClientSignature="<x-client-signature>",
36+
XPartnerMerchantId="<x-partner-merchant-id>"
37+
)
3438
```
3539

3640
Generate your API keys (x-client-id , x-client-secret) from [Cashfree Merchant Dashboard](https://merchant.cashfree.com/merchants/login)
@@ -42,7 +46,7 @@ customerDetails = CustomerDetails(customer_id="walterwNrcMi", customer_phone="99
4246
orderMeta = OrderMeta(return_url="https://www.cashfree.com/devstudio/preview/pg/web/checkout?order_id={order_id}")
4347
createOrderRequest = CreateOrderRequest(order_amount=1, order_currency="INR", customer_details=customerDetails, order_meta=orderMeta)
4448
try:
45-
api_response = Cashfree().PGCreateOrder(x_api_version, createOrderRequest, None, None)
49+
api_response = cashfree_instance.PGCreateOrder(x_api_version, createOrderRequest, None, None)
4650
print(api_response.data)
4751
except Exception as e:
4852
print(e)
@@ -51,7 +55,7 @@ except Exception as e:
5155
Get Order
5256
```python
5357
try:
54-
api_response = Cashfree().PGFetchOrder(x_api_version, "order_3242X4jQ5f0S9KYxZO9mtDL1Kx2Y7u", None)
58+
api_response = cashfree_instance.PGFetchOrder(x_api_version, "order_3242X4jQ5f0S9KYxZO9mtDL1Kx2Y7u", None)
5559
print(api_response.data)
5660
except Exception as e:
5761
print(e)

cashfree_pg/__init__.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
# flake8: noqa
44

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

17-
18-
__version__ = "4.5.1"
17+
__version__ = "5.0.5"
1918

2019
# import apis into sdk package
2120
# import ApiClient

cashfree_pg/api_client.py

Lines changed: 847 additions & 741 deletions
Large diffs are not rendered by default.

cashfree_pg/api_response.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"""API response object."""
22

33
from __future__ import annotations
4-
from typing import Any, Dict, Optional
5-
from pydantic import Field, StrictInt, StrictStr
4+
from typing import Any, Dict, Optional, List, Tuple, Union
5+
from pydantic import validate_arguments, ValidationError, Field, StrictStr, StrictBytes, StrictInt, StrictFloat, StrictBool, field_validator, BaseModel
6+
7+
# Updated imports for Pydantic v2 compatibility
68

79
class ApiResponse:
810
"""

cashfree_pg/configuration.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
# coding: utf-8
22

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

15-
1615
import copy
1716
import logging
1817
import multiprocessing
@@ -434,7 +433,7 @@ def to_debug_report(self):
434433
"OS: {env}\n"\
435434
"Python Version: {pyversion}\n"\
436435
"Version of the API: 2023-08-01\n"\
437-
"SDK Package Version: 4.5.1".\
436+
"SDK Package Version: 5.0.5".\
438437
format(env=sys.platform, pyversion=sys.version)
439438

440439
def get_host_settings(self):

cashfree_pg/exceptions.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
# coding: utf-8
22

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

15-
1615
class OpenApiException(Exception):
1716
"""The base exception class for all OpenAPIExceptions"""
1817

cashfree_pg/models/__init__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

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

16-
1716
# import models into model package
1817
from cashfree_pg.models.address_details import AddressDetails
1918
from cashfree_pg.models.adjust_vendor_balance_request import AdjustVendorBalanceRequest

cashfree_pg/models/address_details.py

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,52 @@
11
# coding: utf-8
22

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

15-
1615
from __future__ import annotations
1716
import pprint
1817
import re # noqa: F401
1918
import json
2019

20+
from datetime import date, datetime
21+
2122

22-
from typing import Optional
23-
from pydantic import BaseModel, Field, StrictStr
23+
from pydantic import validate_arguments, ValidationError, Field, StrictStr, StrictBytes, StrictInt, StrictFloat, StrictBool, field_validator, BaseModel
24+
from typing import Any, Dict, List, Optional, Tuple, Union
25+
from typing_extensions import Annotated
2426

2527
class AddressDetails(BaseModel):
2628
"""
2729
Address associated with the customer.
2830
"""
29-
name: Optional[StrictStr] = Field(None, description="Full Name of the customer associated with the address.")
30-
address_line_one: Optional[StrictStr] = Field(None, description="First line of the address.")
31-
address_line_two: Optional[StrictStr] = Field(None, description="Second line of the address.")
32-
country: Optional[StrictStr] = Field(None, description="Country Name.")
33-
country_code: Optional[StrictStr] = Field(None, description="Country Code.")
34-
state: Optional[StrictStr] = Field(None, description="State Name.")
35-
state_code: Optional[StrictStr] = Field(None, description="State Code.")
36-
city: Optional[StrictStr] = Field(None, description="City Name.")
37-
pin_code: Optional[StrictStr] = Field(None, description="Pin Code/Zip Code.")
38-
phone: Optional[StrictStr] = Field(None, description="Customer Phone Number.")
39-
email: Optional[StrictStr] = Field(None, description="Cutomer Email Address.")
31+
name: Optional[StrictStr] = Field(default=None, description="Full Name of the customer associated with the address.")
32+
address_line_one: Optional[StrictStr] = Field(default=None, description="First line of the address.")
33+
address_line_two: Optional[StrictStr] = Field(default=None, description="Second line of the address.")
34+
country: Optional[StrictStr] = Field(default=None, description="Country Name.")
35+
country_code: Optional[StrictStr] = Field(default=None, description="Country Code.")
36+
state: Optional[StrictStr] = Field(default=None, description="State Name.")
37+
state_code: Optional[StrictStr] = Field(default=None, description="State Code.")
38+
city: Optional[StrictStr] = Field(default=None, description="City Name.")
39+
pin_code: Optional[StrictStr] = Field(default=None, description="Pin Code/Zip Code.")
40+
phone: Optional[StrictStr] = Field(default=None, description="Customer Phone Number.")
41+
email: Optional[StrictStr] = Field(default=None, description="Cutomer Email Address.")
4042
__properties = ["name", "address_line_one", "address_line_two", "country", "country_code", "state", "state_code", "city", "pin_code", "phone", "email"]
4143

42-
class Config:
43-
"""Pydantic configuration"""
44-
allow_population_by_field_name = True
45-
validate_assignment = True
44+
# Updated to Pydantic v2
45+
"""Pydantic configuration"""
46+
model_config = {
47+
"populate_by_name": True,
48+
"validate_assignment": True
49+
}
4650

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

100104

105+
# Pydantic v2: resolve forward references & Annotated types
106+
AddressDetails.model_rebuild()
107+

0 commit comments

Comments
 (0)