Skip to content

Add post-purchase flow with sync license creation#276

Merged
simonhamp merged 2 commits intonativephp-masterclass-landingfrom
course-post-purchase-flow
Mar 9, 2026
Merged

Add post-purchase flow with sync license creation#276
simonhamp merged 2 commits intonativephp-masterclass-landingfrom
course-post-purchase-flow

Conversation

@simonhamp
Copy link
Member

@simonhamp simonhamp commented Mar 9, 2026

Summary

  • Uses Stripe's {CHECKOUT_SESSION_ID} template in the success URL so we can verify payment on return
  • When the user lands back on /course?session_id=..., the route verifies the Stripe session and creates the ProductLicense synchronously if the webhook hasn't processed the cart yet
  • Adds a success banner ("You're in! Thank you for your purchase.") after a completed purchase
  • Adds an error banner for the "already own this course" case
  • Webhook flow remains intact as the primary mechanism — this is a sync fallback for local dev and edge cases

Test plan

  • Complete a Stripe checkout and verify you're redirected back with the success banner
  • Verify a ProductLicense record is created in the database after purchase
  • Verify purchasing again shows "You already own this course" error
  • Confirm existing webhook flow still works and doesn't create duplicate licenses

🤖 Generated with Claude Code

simonhamp and others added 2 commits March 9, 2026 15:28
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ase confirmation

Instead of synchronously creating licenses on the /course page after Stripe checkout,
redirect to the existing cart/success page that polls for webhook confirmation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@simonhamp simonhamp marked this pull request as ready for review March 9, 2026 15:40
@simonhamp simonhamp merged commit e378c6b into nativephp-masterclass-landing Mar 9, 2026
2 checks passed
@simonhamp simonhamp deleted the course-post-purchase-flow branch March 9, 2026 15:41
simonhamp added a commit that referenced this pull request Mar 9, 2026
* Add NativePHP Masterclass landing page with Stripe checkout

- Create /course landing page with hero, curriculum, audience, pricing, and email signup sections
- Wire up Stripe checkout for one-time $99 early bird payment using Cart/Product infrastructure
- Add migration to seed Masterclass product and price in the database
- Integrate Mailcoach for email waitlist signup via direct form POST
- Fix null stripe_price crash in CustomerLicenseController dashboard
- Add feature tests for course page

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add Learn link to main nav, mobile menu, and footer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update masterclass price to $101

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Auto-submit checkout after login/registration flow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add availability timeline section for Summer/Fall 2026 launch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add New pill to Learn links and fix mobile menu on large screens

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add post-purchase flow with sync license creation (#276)

* Add post-purchase flow with sync license creation and success banner

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Redirect course checkout to cart success page for webhook-based purchase confirmation

Instead of synchronously creating licenses on the /course page after Stripe checkout,
redirect to the existing cart/success page that polls for webhook confirmation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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