Skip to content

V2 purchase flow #139

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 4 commits into from
May 18, 2025
Merged

V2 purchase flow #139

merged 4 commits into from
May 18, 2025

Conversation

steven-fox
Copy link
Collaborator

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

  • When a guest visits the /mobile route (everyone, before auth is in place) and clicks one of the buttons to purchase a license, we'll now show them a modal to collect their email.
  • Upon submitting the email, we'll determine if a user already exists for that email. If one does not, we create one with the supplied email. Then, we create a stripe customer record for the user record if necessary and then redirect to a customer-specific checkout session in Stripe for the correct plan.
  • Once a purchase is completed, we do the regular work:
    • Cashier handles subscription info for the existing user record.
    • We create an anystack contact (if necessary) and create a license.

This has been coded to also handle an authenticated user visiting the /mobile page. When this happens, we do not show a modal and upon clicking one of buttons, we would immediately redirect to a stripe checkout.

image image ^^^ Note the email is fixed in this screenshot, indicating a customer-specific checkout session for the correct user.

@steven-fox steven-fox requested a review from simonhamp May 17, 2025 17:06
Copy link
Member

@simonhamp simonhamp left a comment

Choose a reason for hiding this comment

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

Looks great! Let's go

@simonhamp simonhamp merged commit e08c5a1 into main May 18, 2025
2 checks passed
@steven-fox steven-fox deleted the v2-purchase-flow branch May 18, 2025 14:54
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.

2 participants