Skip to content

feat(payments): implement provider-backed subscription pause - #1115

Merged
RUKAYAT-CODER merged 2 commits into
rinafcode:mainfrom
pharwasz:feature/pause-provider-billing
Jul 28, 2026
Merged

feat(payments): implement provider-backed subscription pause#1115
RUKAYAT-CODER merged 2 commits into
rinafcode:mainfrom
pharwasz:feature/pause-provider-billing

Conversation

@pharwasz

Copy link
Copy Markdown
Contributor

Summary

This PR implements provider-backed subscription pausing to ensure that pausing a subscription suspends billing both locally and at the payment provider. close #1005

What Changed

  • Added a PAUSED subscription status and migration support.

  • Updated subscription pause/resume flow to:

    • Set the subscription status to PAUSED on pause.
    • Restore the status to ACTIVE on resume.
    • Call the payment provider's pause/resume API to suspend and resume billing.
  • Added a scheduled job to automatically resume subscriptions at resumeAt.

  • Updated renewal processing to skip paused subscriptions.

  • Updated active subscription queries to exclude paused subscriptions.

  • Added/updated tests covering pause and resume behavior.

  • Fixed TypeScript issues related to the Stripe provider implementation and subscription processing.

Why

Previously, pausing a subscription only updated local metadata while the subscription remained active at the payment provider. As a result:

  • Customers continued to be billed.
  • Paused subscriptions were still treated as active.
  • Renewal processing continued for paused subscriptions.

This implementation keeps the local subscription state and the payment provider in sync, ensuring paused subscriptions are not billed or renewed until they are resumed.

Testing

  • npm run typecheck
  • ✅ Updated unit tests for subscription pause/resume behavior

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@pharwasz 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

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER
RUKAYAT-CODER merged commit 33095e8 into rinafcode:main Jul 28, 2026
3 checks passed
@pharwasz

Copy link
Copy Markdown
Contributor Author

Thank you for contributing to the project.

Thanks for the opportunity 🙇

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make subscription pause actually suspend provider billing rather than only annotating metadata

2 participants