refactor!: reorganize models by business domain and improve 3DS handling#37
Merged
gustavovalverde merged 1 commit intomainfrom Jun 2, 2025
Merged
refactor!: reorganize models by business domain and improve 3DS handling#37gustavovalverde merged 1 commit intomainfrom
gustavovalverde merged 1 commit intomainfrom
Conversation
- Restructure models from technical organization to business domain alignment - Move from schemas.py/secure.py to domain directories (payment/, datavault/, three_ds/, payment_page/, verification/) - Simplify model names removing verbose suffixes (Sale vs SaleTransactionModel) - Implement unified 3DS callback handling with automatic detection and routing - Add comprehensive session management for 3DS transactions with status tracking - Improve 3DS response processing with better challenge and method detection - Consolidate secure transaction processing with common transaction handler - Enhance error handling and logging throughout 3DS flows - Restructure test organization moving integration tests to e2e/ directory - Split CI workflows into separate unit and end-to-end test execution - Maintain full backwards compatibility for existing imports The 3DS improvements provide a more robust and maintainable authentication flow while the model reorganization aligns the SDK structure with Azul's business organization, making both development and payment processing more intuitive. BREAKING CHANGE: Internal imports may need updates, though public API remains compatible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements a comprehensive refactoring that delivers two major architectural improvements:
Changes Made
Model Organization Restructure
schemas.py,secure.py) mixing different business domainspayment/- Core payment processing (Sale, Hold, Refund, Void, Post)datavault/- Card tokenization and token managementthree_ds/- 3D Secure authentication and challenge flowspayment_page/- Hosted payment page integrationverification/- Transaction status and verificationSaleinstead ofSaleTransactionModel,Holdinstead ofHoldTransactionModel3D Secure Flow Enhancements
Unified Callback Handling
Enhanced Session Management
Improved Response Processing
_process_3ds_response()with better 3DS requirement detectionTransaction Processing Consolidation
_process_secure_transaction()method eliminates code duplicationTest Structure Improvements
e2e/directory for accurate categorizationDevelopment Experience Improvements
Key Technical Improvements
3DS Session Management
Automatic 3DS Flow Detection
Transaction Status Management
Benefits
For Developers
payment/, 3DS models inthree_ds/, etc.For Production Use
For Maintenance