Skip to content

Conversation

@gustaavik
Copy link
Member

This pull request refactors error handling and response encoding in the OrderHandler and PaymentHandler classes to improve code consistency and maintainability. The changes replace direct calls to http.Error with reusable helper methods and adjust variable naming for clarity.

Refactoring Error Handling:

  • internal/interfaces/api/handler/payment_handler.go: Replaced http.Error calls with h.writeErrorResponse for consistent error handling across multiple methods (CapturePayment, CancelPayment, RefundPayment, ForceApproveMobilePayPayment). Additionally, introduced h.handleValidationError for validating request body errors in ForceApproveMobilePayPayment. [1] [2] [3] [4] [5] [6] [7] [8]

Response Encoding Adjustment:

@gustaavik gustaavik merged commit 36e989b into main Jul 10, 2025
5 checks passed
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