Skip to content

Implement subscription invoice type with recurring billing cycles #259

Description

@Kingsman-99

Overview

Add a subscription invoice variant where a creator defines a billing interval and the contract automatically opens a new invoice each cycle. Payers opt-in once and are billed per cycle until they cancel.

Acceptance Criteria

  • New InvoiceType::Subscription { interval_ledgers: u32, max_cycles: Option<u32> } variant in types.rs
  • create_subscription(params) entry point creates the first invoice and registers the subscription
  • advance_cycle(subscription_id) opens the next invoice when the previous cycle closes
  • cancel_subscription(subscription_id, caller) stops future cycles; caller must be the payer or creator
  • Contract enforces that only opted-in payers can pay a subscription invoice
  • Events emitted: subscription_created, cycle_advanced, subscription_cancelled

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 ptsfeatureNew contract feature or operation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions