Packages paid through Stripe Checkout
CI / test (push) Successful in 1m25s
CI / build (push) Successful in 5m24s
CI / deploy (push) Skipped

The catalog stays in packages.rs: every checkout session carries the
package's name and gross price, nothing has to be kept in Stripe. The
package is granted once, when Stripe confirms the payment: by the signed
webhook, or by the return page asking Stripe when the webhook is late.
With a test key only admins can buy, so Stripe's test cards give nobody
free packages. Without the keys nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-20 06:41:21 +00:00
co-authored by Claude Opus 5.5
parent 55101f8637
commit 42a982010d
31 changed files with 842 additions and 37 deletions
+4 -1
View File
@@ -186,6 +186,8 @@ pub enum Source {
Mock,
/// A redeemed promo code.
Promo,
/// Paid through Stripe Checkout.
Stripe,
}
impl Source {
@@ -194,6 +196,7 @@ impl Source {
Source::Admin => "admin",
Source::Mock => "mock",
Source::Promo => "promo",
Source::Stripe => "stripe",
}
}
}
@@ -268,7 +271,7 @@ async fn record(
let order = Uuid::now_v7();
let price = match source {
Source::Admin | Source::Promo => 0,
Source::Mock => package.price_huf,
Source::Mock | Source::Stripe => package.price_huf,
};
sqlx::query(
"INSERT INTO package_orders (id, user_id, package, source, price_huf, note, created_by) \