Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(stripe): handle Stripe subscription events #9768

Merged
merged 3 commits into from
May 27, 2024

Conversation

tianrunhe
Copy link
Contributor

@tianrunhe tianrunhe commented May 22, 2024

Description

When we increase the team subscription price from $6 to $8, it would be a new pricing (parabol-pro-800 vs. parabol-pro-600) and that means we need to migrate all customers from the old subscriptions to new ones. I plan to do the migration with a separate script that interacts with Stripe directly. The change we need from Parabol app side is to listen for the subscription changes and then update the stripeSubscriptionId field for the org accordingly.

Testing scenarios

  1. Start a local listener stripe listen --forward-to localhost:3000/stripe
  2. Upgrade an org to team tier and verify the stripeId and stripeSubscriptionId in Organization table match with the customerId and subscriptionId in Stripe
  3. Go to the customer page in Stripe, cancel that subscription. Verify the stripeSubscriptionId in Organization table is removed.
  4. Go back to the customer page in Stripe and manually create a new subscription. Verify the stripeSubscriptionId in the Organization table is updated with the subscriptionId from the new subscription.

Final checklist

  • I checked the code review guidelines
  • I have added Metrics Representative as reviewer(s) if my PR invovles metrics/data/analytics related changes
  • I have performed a self-review of my code, the same way I'd do it for any other team member
  • I have tested all cases I listed in the testing scenarios and I haven't found any issues or regressions
  • Whenever I took a non-obvious choice I added a comment explaining why I did it this way
  • I added the label Skip Maintainer Review Indicating the PR only requires reviewer review and can be merged right after it's approved if the PR introduces only minor changes, does not contain any architectural changes or does not introduce any new patterns and I think one review is sufficient'
  • PR title is human readable and could be used in changelog

@tianrunhe tianrunhe changed the title feat/handleStripeSubscriptionEvents feat(stripe): handle subscription related events May 22, 2024
@tianrunhe tianrunhe changed the title feat(stripe): handle subscription related events feat(stripe): handle Stripe subscription events May 22, 2024
@tianrunhe tianrunhe marked this pull request as ready for review May 22, 2024 17:57
Copy link
Contributor

@Dschoordsch Dschoordsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the function naming, it looks good and works

@tianrunhe tianrunhe merged commit 2243667 into master May 27, 2024
5 checks passed
@tianrunhe tianrunhe deleted the feat/handleStripeSubscriptionEvents branch May 27, 2024 16:12
@github-actions github-actions bot mentioned this pull request May 29, 2024
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants