Skip to content

Create a license upon invoice.paid event #149

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

Merged
merged 2 commits into from
May 23, 2025

Conversation

steven-fox
Copy link
Collaborator

@steven-fox steven-fox commented May 23, 2025

Added invoice.paid to our production webhook events on Stripe.

I tested this locally for:

  • a new user performs a checkout and pays successfully (license created)
  • a new user performs a checkout, payment fails, and then payment succeeds (license created)
  • a user performs a checkout, payment fails, and then they use the billing portal to pay the invoice at a slightly later time (license created)
  • an existing user that doesn't already exist on stripe yet already has a license (old anystack contacts) performs a checkout and pays (new license created)

I can still think of some edge cases this won't handle. I will get going on those as soon as I can.

Also... definitely some refactoring that needs to be done to clean this all up once we've hit a steady state and our logic stops changing. There are a lot of code smells in here from moving fast that I'm not too happy about.

@steven-fox steven-fox merged commit 594e5ac into main May 23, 2025
2 checks passed
@steven-fox steven-fox deleted the create-licenses-from-invoice-paid branch May 23, 2025 16:57
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