Skip to content

5.0.1-beta-5#92

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

5.0.1-beta-5#92
rajnandan1 wants to merge 1 commit intomasterfrom
5.0.1-beta-5

Conversation

@rajnandan1
Copy link
Contributor

Raising PR to github

Copilot AI review requested due to automatic review settings January 20, 2026 09:38
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 migrates the codebase from Python to TypeScript, representing a major language change for the Cashfree Payment Gateway SDK. The changes convert Python model definitions to TypeScript interfaces and update the infrastructure accordingly.

Changes:

  • Converted all Python model files in cashfree_pg/models/ to TypeScript interface definitions
  • Updated API response handling from Pydantic-based to TypeScript/Pydantic v2 generic types
  • Modified CI configuration to support newer Python versions (3.9-3.13) and removed older versions (3.7-3.8)

Reviewed changes

Copilot reviewed 133 out of 856 changed files in this pull request and generated 8 comments.

File Description
cashfree_pg/models/*.py Converted Python Pydantic models to TypeScript interfaces with type annotations
cashfree_pg/api_response.py Updated ApiResponse class to use Pydantic v2 with generics and stricter typing
.travis.yml Updated Python version support, removing 3.7-3.8 and adding 3.12-3.13
cashfree_pg/models/init.py Cleaned up whitespace formatting

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

Comment on lines +24 to +33
* @type {int}
* @memberof FetchSettlementsRequestPagination
*/
'limit': int;
/**
* Specifies from where the next set of settlement details should be fetched.
* @type {str}
* @memberof FetchSettlementsRequestPagination
*/
'cursor'?: str;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

TypeScript does not have int or str types. These should be number and string respectively. This issue appears throughout all the converted TypeScript files.

Suggested change
* @type {int}
* @memberof FetchSettlementsRequestPagination
*/
'limit': int;
/**
* Specifies from where the next set of settlement details should be fetched.
* @type {str}
* @memberof FetchSettlementsRequestPagination
*/
'cursor'?: str;
* @type {number}
* @memberof FetchSettlementsRequestPagination
*/
'limit': number;
/**
* Specifies from where the next set of settlement details should be fetched.
* @type {string}
* @memberof FetchSettlementsRequestPagination
*/
'cursor'?: string;

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +45
* @type {List[str]}
* @memberof FetchSettlementsRequestFilters
*/
'cf_settlement_ids'?: List[str];
/**
* List of settlement UTRs for which you want the settlement reconciliation details.
* @type {List[str]}
* @memberof FetchSettlementsRequestFilters
*/
'settlement_utrs'?: List[str];
/**
* Specify the start date from when you want the settlement reconciliation details.
* @type {str}
* @memberof FetchSettlementsRequestFilters
*/
'start_date'?: str;
/**
* Specify the end date till when you want the settlement reconciliation details.
* @type {str}
* @memberof FetchSettlementsRequestFilters
*/
'end_date'?: str;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

TypeScript uses Array<string> or string[] syntax, not Python's List[str]. This pattern appears throughout all converted files and needs correction.

Suggested change
* @type {List[str]}
* @memberof FetchSettlementsRequestFilters
*/
'cf_settlement_ids'?: List[str];
/**
* List of settlement UTRs for which you want the settlement reconciliation details.
* @type {List[str]}
* @memberof FetchSettlementsRequestFilters
*/
'settlement_utrs'?: List[str];
/**
* Specify the start date from when you want the settlement reconciliation details.
* @type {str}
* @memberof FetchSettlementsRequestFilters
*/
'start_date'?: str;
/**
* Specify the end date till when you want the settlement reconciliation details.
* @type {str}
* @memberof FetchSettlementsRequestFilters
*/
'end_date'?: str;
* @type {Array<string>}
* @memberof FetchSettlementsRequestFilters
*/
'cf_settlement_ids'?: Array<string>;
/**
* List of settlement UTRs for which you want the settlement reconciliation details.
* @type {Array<string>}
* @memberof FetchSettlementsRequestFilters
*/
'settlement_utrs'?: Array<string>;
/**
* Specify the start date from when you want the settlement reconciliation details.
* @type {string}
* @memberof FetchSettlementsRequestFilters
*/
'start_date'?: string;
/**
* Specify the end date till when you want the settlement reconciliation details.
* @type {string}
* @memberof FetchSettlementsRequestFilters
*/
'end_date'?: string;

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +39
* @type {bool}
* @memberof EligibilityPaymentMethodsEntity
*/
'eligibility'?: bool;
/**
*
* @type {str}
* @memberof EligibilityPaymentMethodsEntity
*/
'entity_type'?: str;
/**
*
* @type {str}
* @memberof EligibilityPaymentMethodsEntity
*/
'entity_value'?: str;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

TypeScript uses boolean type, not bool. This issue occurs in multiple converted files.

Suggested change
* @type {bool}
* @memberof EligibilityPaymentMethodsEntity
*/
'eligibility'?: bool;
/**
*
* @type {str}
* @memberof EligibilityPaymentMethodsEntity
*/
'entity_type'?: str;
/**
*
* @type {str}
* @memberof EligibilityPaymentMethodsEntity
*/
'entity_value'?: str;
* @type {boolean}
* @memberof EligibilityPaymentMethodsEntity
*/
'eligibility'?: boolean;
/**
*
* @type {string}
* @memberof EligibilityPaymentMethodsEntity
*/
'entity_type'?: string;
/**
*
* @type {string}
* @memberof EligibilityPaymentMethodsEntity
*/
'entity_value'?: string;

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +39
* @type {object}
* @memberof ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner
*/
'tags'?: object;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

In TypeScript, generic objects should be typed as Record<string, any> or a specific interface rather than object for better type safety.

Suggested change
* @type {object}
* @memberof ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner
*/
'tags'?: object;
* @type {{[key: string]: any}}
* @memberof ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner
*/
'tags'?: Record<string, any>;

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +39
* @type {float}
* @memberof DiscountDetails
*/
'discount_value': float;
/**
* Maximum Value of Discount allowed.
* @type {float}
* @memberof DiscountDetails
*/
'max_discount_amount': float;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

TypeScript does not have a float type. Use number instead. This issue appears in multiple files.

Suggested change
* @type {float}
* @memberof DiscountDetails
*/
'discount_value': float;
/**
* Maximum Value of Discount allowed.
* @type {float}
* @memberof DiscountDetails
*/
'max_discount_amount': float;
* @type {number}
* @memberof DiscountDetails
*/
'discount_value': number;
/**
* Maximum Value of Discount allowed.
* @type {number}
* @memberof DiscountDetails
*/
'max_discount_amount': number;

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +5
from typing import Optional, Generic, Mapping, TypeVar
from pydantic import Field, StrictInt, StrictBytes, BaseModel
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

This file appears to still be Python code with Pydantic imports, but is among files being converted to TypeScript. The conversion is incomplete or the file extension is incorrect.

Copilot uses AI. Check for mistakes.
""" # noqa: E501


# import models into model package
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

This Python initialization file still contains Python imports but the models it's importing have been converted to TypeScript. This will cause import errors.

Copilot uses AI. Check for mistakes.
Comment on lines 4 to +8
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The CI configuration targets Python 3.13, but Python 3.13 is not released yet (current date is January 2026 per system instructions, but Python 3.13 stable was released in October 2024). The configuration should work, but verify the release dates align with testing requirements.

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