Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change to complex objects instead of raw dictionaries
This commit introduces a significant architectural change in how we handle API responses. Instead of working with raw dictionaries, we now use proper model classes (Charge, CardToken, Refund, etc.) to represent API resources. Key changes: - Created new models.py file with proper data classes for all API resources - Updated client methods to return typed objects instead of dictionaries - Modified examples to demonstrate usage with new object-oriented approach - Updated tests to work with new model classes - Added type hints throughout the codebase This change brings several benefits: 1. Better type safety and IDE support 2. More intuitive API with proper object methods 3. Easier validation and data manipulation 4. Improved code maintainability 5. Better documentation through type hints The change is backwards compatible as the model classes can still be accessed as dictionaries through their attributes. Signed-off-by: Avelino <[email protected]>
- Loading branch information