Skip to content

RecurringPaymentRegisteredEvent uses stale cardStatus on cancellation #19

Description

@fupelaqu

Bug

In RecurringPaymentCommandHandler.scala, the UpdateRecurringCardPaymentRegistration handler constructs the RecurringPaymentRegisteredEvent using the original recurringPayment object (with IN_PROGRESS status) instead of the updated one with the new cardStatus (e.g., ENDED).

File: core/src/main/scala/app/softnetwork/payment/persistence/typed/RecurringPaymentCommandHandler.scala line 300

RecurringPaymentRegisteredEvent.defaultInstance
  .withExternalUuid(paymentAccount.externalUuid)
  .withRecurringPayment(recurringPayment)  // ← BUG: uses pre-update recurringPayment

Impact

Any downstream EventProcessorStream that reads RecurringPaymentRegisteredEvent and checks cardStatus to detect cancellation (e.g., Payment2LicenseProcessorStream in the license-server) will never see ENDED — it always sees the old status (IN_PROGRESS).

This breaks the subscription cancellation → license revocation flow.

Fix

.withRecurringPayment(recurringPayment.withCardStatus(result.status))

Found during

Story 5.11 Stripe integration testing in softclient4es-license-server.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions