Skip to content

Add status-based discovery for canceled subscriptions#23

Open
nickchang91 wants to merge 3 commits intomainfrom
improve-subscription-sync
Open

Add status-based discovery for canceled subscriptions#23
nickchang91 wants to merge 3 commits intomainfrom
improve-subscription-sync

Conversation

@nickchang91
Copy link

The previous implementation only captured subscription updates through:

  1. created_at searches (new subscriptions)
  2. Transaction lookahead (renewals/payments)

This missed canceled subscriptions because cancellations don't generate transactions. They only update the subscription's status.

Solution:

Added an approach to capture all subscription updates:

Strategy What it captures
Created At Search New subscriptions
Transaction Lookahead Renewals, payments
Status-Based Discovery Canceled, Expired, Past Due
Next Billing Date Search Upcoming renewals

Changes

  • Added _fetch_subscriptions_by_status() to search by subscription status
  • Added _fetch_subscriptions_by_ids() helper for cleaner code
  • Searches Canceled, Expired, and PastDue statuses directly from Braintree API
  • Added 7-day lookahead for upcoming billing dates

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.

1 participant