Skip to content

Conversation

@zulquer
Copy link
Collaborator

@zulquer zulquer commented Nov 28, 2025

This pull request refactors import statements and improves code formatting across multiple example scripts in the repository. The main goals are to standardize import styles, simplify module paths, and enhance readability by reformatting multi-line statements. No functional changes to logic or behavior are introduced.

Import statement refactoring:

  • Switched to using package-level imports (e.g., from multisafepay import Sdk) and grouped related imports, reducing deep or redundant module paths in all example scripts. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

Code formatting and readability improvements:

  • Reformatted multi-line function calls and object instantiations for better readability, especially in request creation and response handling (e.g., capture_request, order_request, and API response assignments). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Variable naming consistency:

  • Updated variable names to follow consistent snake_case conventions (e.g., gatewayListing to gateway_listing).

These changes collectively make the example scripts easier to maintain and understand, especially for onboarding and future development.

@zulquer zulquer requested a review from danielcivit November 28, 2025 09:06
@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.69%. Comparing base (ec4ccf1) to head (a8fd0d5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #38      +/-   ##
==========================================
+ Coverage   90.23%   90.69%   +0.45%     
==========================================
  Files         107      143      +36     
  Lines        2355     2471     +116     
==========================================
+ Hits         2125     2241     +116     
  Misses        230      230              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danielcivit danielcivit requested a review from Copilot December 1, 2025 10:41
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 standardizes import statements across the codebase by introducing package-level __init__.py exports and refactoring example scripts to use simplified import paths. The changes improve code maintainability and readability without altering any functional behavior.

Key changes:

  • Added __all__ exports to package __init__.py files for cleaner public API exposure
  • Refactored example scripts to use package-level imports (e.g., from multisafepay import Sdk instead of from multisafepay.sdk import Sdk)
  • Improved code formatting in example scripts with better multi-line statement formatting

Reviewed changes

Copilot reviewed 60 out of 61 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/multisafepay/__init__.py Added Sdk export to enable top-level imports
src/multisafepay/api/__init__.py Added empty __all__ list for API package
src/multisafepay/api/base/__init__.py Exported AbstractManager for easier access
src/multisafepay/api/base/listings/__init__.py Exported Listing and ListingPager classes
src/multisafepay/api/base/response/__init__.py Exported CustomApiResponse class
src/multisafepay/api/paths/__init__.py Exported all manager classes for API paths
src/multisafepay/api/paths/auth/__init__.py Exported ApiToken class
src/multisafepay/api/paths/*/request/__init__.py Added exports for request models across multiple endpoints
src/multisafepay/api/paths/*/response/__init__.py Added exports for response models across multiple endpoints
src/multisafepay/api/shared/__init__.py Exported shared API components
src/multisafepay/api/shared/cart/__init__.py Exported cart-related classes
src/multisafepay/api/shared/checkout/__init__.py Exported checkout-related classes
src/multisafepay/client/__init__.py Exported Client and ApiKey classes
src/multisafepay/exception/__init__.py Exported all exception classes
src/multisafepay/model/__init__.py Exported base model classes
src/multisafepay/util/__init__.py Exported Webhook utility
src/multisafepay/value_object/__init__.py Exported all value object classes
tests/multisafepay/unit/api/path/orders/request/components/test_unit_custom_info.py Fixed import path from customer_info to custom_info
src/multisafepay/api/paths/orders/request/order_request.py Corrected import path for CustomInfo
src/multisafepay/api/paths/orders/request/components/__init__.py Added CustomInfo export and fixed module name
examples/*.py Updated all example scripts to use simplified imports and improved formatting

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

@danielcivit danielcivit merged commit ffdfce0 into master Dec 1, 2025
6 checks passed
@danielcivit danielcivit deleted the PTHMINT-89 branch December 1, 2025 10:43
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.

3 participants