Added shop and checkout to the CMS
Checkout is done with stripe Added reservation system
This commit is contained in:
parent
09e54033dd
commit
702d99b9ed
42 changed files with 3332 additions and 21 deletions
17
app/src/lib/stripe.server.ts
Normal file
17
app/src/lib/stripe.server.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import Stripe from 'stripe';
|
||||
import { env } from '$env/dynamic/private';
|
||||
|
||||
let stripe: Stripe | null = null;
|
||||
|
||||
export function getStripe(): Stripe {
|
||||
if (!stripe) {
|
||||
const key = env.STRIPE_SECRET_KEY;
|
||||
if (!key) throw new Error('STRIPE_SECRET_KEY is not set');
|
||||
stripe = new Stripe(key);
|
||||
}
|
||||
return stripe;
|
||||
}
|
||||
|
||||
export function getCurrency(): string {
|
||||
return env.STRIPE_CURRENCY || 'eur';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue