Skip to content

5.0.1-beta#87

Open
rajnandan1 wants to merge 1 commit intomasterfrom
5.0.1-beta
Open

5.0.1-beta#87
rajnandan1 wants to merge 1 commit intomasterfrom
5.0.1-beta

Conversation

@rajnandan1
Copy link
Contributor

Raising PR to github

Copilot AI review requested due to automatic review settings January 16, 2026 11:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request upgrades the Cashfree Payment Gateway Python SDK from version 4.5.1 to 5.0.1-beta, migrating from Pydantic v1 to Pydantic v2. This is a major breaking change that requires significant updates to all Pydantic model configurations throughout the codebase.

Changes:

  • Upgraded pydantic dependency from >= 1.10.24, < 2 to >= 2.11.7 in setup.py
  • Updated version to 5.0.1-beta in setup.py, pyproject.toml, and configuration.py
  • Migrated all Pydantic model classes from v1 Config class to v2 model_config dictionary
  • Updated all @validator decorators to @field_validator for Pydantic v2 compatibility

Reviewed changes

Copilot reviewed 267 out of 268 changed files in this pull request and generated 228 comments.

Show a summary per file
File Description
setup.py Updated version to 5.0.1-beta and pydantic requirement to >= 2.11.7
pyproject.toml Updated version to 5.0.1-beta
configuration.py Updated SDK version string to 4.5.1
cashfree_pg/models/*.py Migrated ~200+ model files from Pydantic v1 to v2 syntax
cashfree_pg/api_response.py Added compatibility comment
Comments suppressed due to low confidence (1)

pyproject.toml:17

  • The pyproject.toml file still specifies pydantic v1 constraints (^1.10.5, <2) which conflicts with the setup.py requirement of >= 2.11.7. This will cause dependency resolution failures. Update this to match the setup.py requirement: pydantic = \"^2.11.7\"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"Python Version: {pyversion}\n"\
"Version of the API: 2023-08-01\n"\
"SDK Package Version: 4.3.10".\
"SDK Package Version: 4.5.1".\
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK version in the debug report string is hardcoded to '4.5.1' but should be updated to '5.0.1-beta' to match the actual package version being released.

Copilot uses AI. Check for mistakes.
Comment on lines +39 to 40
@field_validator('channel')
def channel_validate_enum(cls, value):
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pydantic v2 field validators require the 'mode' parameter to be specified. The decorator should be @field_validator('channel', mode='before') or @field_validator('channel', mode='after') depending on when validation should occur. This applies to all field_validator usages across all model files.

Copilot uses AI. Check for mistakes.

from typing import Optional
from pydantic import BaseModel, Field, StrictStr
from pydantic import field_validator
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Suggested change
from pydantic import field_validator

Copilot uses AI. Check for mistakes.

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

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Suggested change
from pydantic import field_validator

Copilot uses AI. Check for mistakes.
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 field_validator
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Suggested change
from pydantic import field_validator

Copilot uses AI. Check for mistakes.
from typing import List, Optional
from pydantic import BaseModel, conlist
from cashfree_pg.models.vendor_entity_related_docs_inner import VendorEntityRelatedDocsInner
from pydantic import field_validator
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Copilot uses AI. Check for mistakes.
from cashfree_pg.models.bank_details import BankDetails
from cashfree_pg.models.schedule_option import ScheduleOption
from cashfree_pg.models.vendor_entity_related_docs_inner import VendorEntityRelatedDocsInner
from pydantic import field_validator
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Copilot uses AI. Check for mistakes.

from typing import Optional
from pydantic import BaseModel, StrictStr
from pydantic import field_validator
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Copilot uses AI. Check for mistakes.

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

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Copilot uses AI. Check for mistakes.

from typing import Optional
from pydantic import BaseModel, StrictStr
from pydantic import field_validator
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'field_validator' is not used.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants