Skip to content

Conversation

@shanerbaner82
Copy link
Contributor

Summary

  • Refactored plugin checkout to pass cart_id in Stripe metadata instead of comma-separated plugin_ids/bundle_ids
  • HandleInvoicePaidJob now looks up the cart by ID and creates licenses from cart items
  • Switched from checkout.session.completed to invoice.paid webhook for better reliability with delayed payments
  • Cart is cleared and marked as completed after successful purchase
  • Completed carts are now excluded when getting a user's cart (prevents reusing old carts)

Test plan

  • Add plugin to cart and complete checkout
  • Verify license is created after webhook processes
  • Verify cart is cleared after purchase
  • Verify cart icon shows correct count after purchase
  • Add bundle to cart and verify all plugin licenses are created

- Pass cart_id in Stripe metadata instead of plugin_ids/bundle_ids
- HandleInvoicePaidJob now looks up cart and creates licenses from cart items
- Listen for invoice.paid webhook instead of checkout.session.completed
- Clear cart items when cart is marked as completed
- Exclude completed carts when getting cart for user
- Add stripe_checkout_session_id and completed_at to carts table
- Add stripe_invoice_id to plugin_licenses table
shanerbaner82 and others added 5 commits January 26, 2026 05:55
- Store Stripe checkout session ID on cart before redirect
- Allow GET requests to checkout route for post-login redirects
- Fix guest cart transfer to only merge into active (non-completed) carts
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.

3 participants