Skip to content

Add dispute events, subscription engine, batch verification, and relative stream creation`#139

Merged
Pvsaint merged 2 commits into
MetroLogic:mainfrom
miss-yusrah:feat/payment
Apr 28, 2026
Merged

Add dispute events, subscription engine, batch verification, and relative stream creation`#139
Pvsaint merged 2 commits into
MetroLogic:mainfrom
miss-yusrah:feat/payment

Conversation

@miss-yusrah
Copy link
Copy Markdown
Contributor

closes #103
closes #107
closes #112
closes #126

Pr Description

Task 1 - Standardized Event Emissions for Dispute Lifecycle:

  • Updated event names from DISPUTE/OPENEDDISPUTE_CREATED, DISPUTE/UNDER_REVIEWDISPUTE_REVIEWED, DISPUTE/RESOLVEDDISPUTE_RESOLVED, DISPUTE/REJECTEDDISPUTE_REJECTED
  • Events now include dispute_id and payment_id as specified
  • Updated EVENTS.md documentation

Task 2 - Subscription/Recurring Payment Engine:

  • Added Subscription and SubscriptionPlan structs
  • Added SubscriptionStatus enum (Active, Paused, Cancelled, Expired)
  • Added storage keys for subscription plans and subscriptions
  • Implemented functions: create_subscription_plan, subscribe, pause_subscription, resume_subscription, cancel_subscription, process_due_subscriptions

Task 3 - Batch Payment Verification:

  • Added verify_batch function to PaymentLinkManager that takes a Vec<String> of link IDs and returns payment status for each

Task 4 - create_stream_relative Entry-Point:

  • Added Stream and StreamStatus structs
  • Implemented create_stream_relative function that accepts relative time offsets (start_delay, cliff_delay, duration) instead of absolute timestamps
  • Validates cliff_delay >= start_delay and duration > 0
  • Computes absolute times using env.ledger().timestamp()

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 28, 2026

@miss-yusrah Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Pvsaint Pvsaint merged commit 758408b into MetroLogic:main Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants