Skip to content

Fix: logger service injection#581

Merged
webaaz merged 3 commits intodevelopfrom
feature/ecom-4048-bug-alma-plugin-v601-error-order-confirmed-does-not-sent
Apr 20, 2026
Merged

Fix: logger service injection#581
webaaz merged 3 commits intodevelopfrom
feature/ecom-4048-bug-alma-plugin-v601-error-order-confirmed-does-not-sent

Conversation

@joyet-simon
Copy link
Copy Markdown
Contributor

Reason for change

Linear task

When BusinessEventsService::onOrderConfirmed() threw a BusinessEventsServiceException, it was propagated as a GatewayServiceException from GatewayService::woocommerceOrderStatusChanged(), blocking the WooCommerce order status change flow.

Code changes

Catch & log instead of throw: GatewayService now catches BusinessEventsServiceException and logs it as a debug message instead of re-throwing it as a GatewayServiceException.
Make LoggerService a required dependency: Removed nullable ?LoggerService with NullLogger fallback across 7 classes. LoggerService is now a required constructor parameter, enforcing proper DI.
Fix missing LoggerService in ConfigFormMapper: Added LoggerService injection to ConfigFormMapper so it can pass it to FeePlanConfiguration (which now requires it).

Fixed FeePlanConfigurationTest, FeePlanProviderTest, ConfigFormMapperTest to pass LoggerService mock.
Created GatewayServiceTest with 3 tests covering the new behavior (exception logged, success case, order not found).

How to test

As a reviewer, you are encouraged to test the PR locally.

Checklist for authors and reviewers

  • The title of the PR uses business wording, not technical jargon, for the changelog readers to understand it
  • The PR implements the changes asked in the referenced task / issue
  • The automated tests are compliant with the testing strategy
  • The tests are relevant, and cover the corner/error cases, not only the happy path
  • You understand the impact of this PR on existing code/features
  • The changes include adequate logging and Datadog traces
  • Documentation is updated (API, developer documentation, ADR, Notion...)

Non applicable

@webaaz webaaz merged commit a994598 into develop Apr 20, 2026
3 checks passed
@webaaz webaaz deleted the feature/ecom-4048-bug-alma-plugin-v601-error-order-confirmed-does-not-sent branch April 20, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants