feat: add Stripe checkout, order persistence, and webhook handling

Stripe-hosted Checkout integration with full order lifecycle:
- stripity_stripe ~> 3.2 with sandbox/prod config via env vars
- Order and OrderItem schemas with price snapshots at purchase time
- CheckoutController creates pending order then redirects to Stripe
- StripeWebhookController verifies signatures and confirms payment
- Success page with real-time PubSub updates from webhook
- Shop flash messages for checkout error feedback
- Cart cleared after successful payment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-07 08:30:17 +00:00
parent cff21703f1
commit ff1bc483b9
19 changed files with 931 additions and 69 deletions

View File

@@ -83,6 +83,9 @@ config :phoenix, :json_library, Jason
# ex_money configuration for currency handling
config :ex_money, default_cldr_backend: SimpleshopTheme.Cldr
# Stripe configuration
config :stripity_stripe, api_version: "2024-12-18.acacia"
# Oban configuration for background jobs
config :simpleshop_theme, Oban,
engine: Oban.Engines.Lite,
@@ -91,7 +94,7 @@ config :simpleshop_theme, Oban,
{Oban.Plugins.Pruner, max_age: 60},
{Oban.Plugins.Lifeline, rescue_after: :timer.minutes(5)}
],
queues: [images: 2, sync: 1]
queues: [images: 2, sync: 1, checkout: 1]
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.