Skip to content

5.0.2#96

Open
rajnandan1 wants to merge 1 commit intomasterfrom
5.0.2
Open

5.0.2#96
rajnandan1 wants to merge 1 commit intomasterfrom
5.0.2

Conversation

@rajnandan1
Copy link
Contributor

Raising PR to github

Copilot AI review requested due to automatic review settings January 21, 2026 10:30
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 PR updates the Cashfree Payment Gateway Python SDK to version 1.0.0, migrating from Pydantic v1 to Pydantic v2 and updating Python version requirements.

Changes:

  • Migrated from Pydantic v1 to v2 with updated field definitions and configuration syntax
  • Updated Python version requirement from >=3.7 to >=3.9
  • Removed extraneous blank lines across test files and model files

Reviewed changes

Copilot reviewed 298 out of 553 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
setup.py Updated package metadata, Python version requirement to 3.9+, and Pydantic dependency to 2.11.7
pyproject.toml Updated Python version requirement and Pydantic dependency specification
configuration.py Updated SDK package version string in debug report
cashfree_pg/rest.py Removed extra blank line for consistency
cashfree_pg/models/*.py Migrated all model files to Pydantic v2 syntax with updated Field definitions, model_config, field_validator, and model_rebuild() calls
test/*.py Removed extra blank lines for code consistency

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

# http://pypi.python.org/pypi/setuptools
NAME = "cashfree_pg"
VERSION = "4.5.1"
NAME = "cashfree-pg"
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The package name has changed from 'cashfree_pg' to 'cashfree-pg' (underscore to hyphen). This is a breaking change that will require users to update their import statements and dependencies. Consider whether this change is intentional and ensure it's documented in release notes.

Suggested change
NAME = "cashfree-pg"
NAME = "cashfree_pg"

Copilot uses AI. Check for mistakes.
author="Cashfree Payments",
author_email="developers@cashfree.com",
url="https://cashfree.com",
url="",
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The package URL has been set to an empty string. This removes important metadata from the package. The URL should point to the project repository or homepage (e.g., 'https://cashfree.com' or the GitHub repository URL).

Suggested change
url="",
url="https://cashfree.com",

Copilot uses AI. Check for mistakes.
else:
actual_instance: Any
one_of_schemas: List[str] = Field(TERMINALPAYMENTENTITYPAYMENTMETHOD_ONE_OF_SCHEMAS, const=True)
one_of_schemas: List[str] = Literal[TERMINALPAYMENTENTITYPAYMENTMETHOD_ONE_OF_SCHEMAS]
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The type annotation is incorrect. Literal expects literal values, not a variable. This should be List[str] = Field(default=TERMINALPAYMENTENTITYPAYMENTMETHOD_ONE_OF_SCHEMAS) or use a class variable annotation without Literal.

Suggested change
one_of_schemas: List[str] = Literal[TERMINALPAYMENTENTITYPAYMENTMETHOD_ONE_OF_SCHEMAS]
one_of_schemas: List[str] = Field(default=TERMINALPAYMENTENTITYPAYMENTMETHOD_ONE_OF_SCHEMAS)

Copilot uses AI. Check for mistakes.
else:
actual_instance: Any
one_of_schemas: List[str] = Field(PAYORDERREQUESTPAYMENTMETHOD_ONE_OF_SCHEMAS, const=True)
one_of_schemas: List[str] = Literal[PAYORDERREQUESTPAYMENTMETHOD_ONE_OF_SCHEMAS]
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The type annotation is incorrect. Literal expects literal values, not a variable. This should be List[str] = Field(default=PAYORDERREQUESTPAYMENTMETHOD_ONE_OF_SCHEMAS) or use a class variable annotation without Literal.

Suggested change
one_of_schemas: List[str] = Literal[PAYORDERREQUESTPAYMENTMETHOD_ONE_OF_SCHEMAS]
one_of_schemas: List[str] = Field(default=PAYORDERREQUESTPAYMENTMETHOD_ONE_OF_SCHEMAS)

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