Skip to content

Implement subscription cancellation with retention flow #172

@Smartdevs17

Description

@Smartdevs17

Implement subscription cancellation with retention flow

Description

Context: Subscription cancellations often represent lost revenue that could be saved through retention offers, feedback collection, or win-back campaigns.

Current Limitation: The contract treats cancellation as an immediate, permanent termination with no retention mechanism or feedback loop.

Expected Outcome: Implement a comprehensive cancellation flow with retention offers, feedback collection, delayed cancellation, and reactivation capabilities.

Acceptance Criteria

  • Implement cancellation_flow states: REQUESTED, RETENTION_OFFER_PENDING, FEEDBACK_PENDING, SCHEDULED, COMPLETED, REACTIVATED
  • Add configurable retention offers (discount, pause, upgrade) presented before cancellation
  • Implement feedback collection with required/optional survey questions
  • Add scheduled cancellation (end of billing period) vs immediate cancellation options
  • Implement cancellation cooling-off period with reactivation window
  • Add retention analytics tracking for retention offer effectiveness
  • Create React Native cancellation flow UI with all states
  • Write tests for cancellation flow state transitions

Technical Scope

Files Likely Affected:

  • contracts/subscription/src/cancellation.rs - New cancellation module
  • contracts/subscription/src/retention.rs - Retention offers
  • app/stores/cancellationStore.ts - New cancellation state
  • app/screens/CancellationFlowScreen.tsx - New cancellation UI

APIs/Contracts Involved:

  • request_cancellation(subscription_id: SubscriptionId, type: CancelType) -> CancellationFlow
  • offer_retention(subscription_id: SubscriptionId, offer: RetentionOffer) -> CancellationFlow
  • submit_feedback(subscription_id: SubscriptionId, feedback: Feedback) -> CancellationFlow
  • reactivate_subscription(subscription_id: SubscriptionId) -> Subscription
  • get_cancellation_analytics(merchant_id: MerchantId) -> RetentionAnalytics

Edge Cases to Consider:

  • Reactivation after cancellation scheduled
  • Multiple cancellation requests for same subscription
  • Cancellation during active charging attempt
  • Retention offer expiration
  • Subscriber death/incapacitation handling

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestfeatureNew feature request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions