mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-10-29 07:54:44 +00:00
refactor(db): replace sqlc with handwritten pgx repos
- Finish Paddle-to-Stripe billing migration; drop paddle/stripe libs - Renumber migrations; add 00012 memberships+manage_token, 00013 location_type_capacity - Add tests: admin, auth, bookings customer service - Remove graphify-out artifacts and stale env files Authored By: TDvorak <[email protected]> Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
2039669e2c
commit
f2f7439050
93 files changed
+6987
-69060
No files matched your search
@@ -1,23 +0,0 @@
|
||||
import { initializePaddle, type Paddle } from "@paddle/paddle-js";
|
||||
|
||||
const paddleToken = import.meta.env.VITE_PADDLE_CLIENT_TOKEN ?? "";
|
||||
const paddleEnvironment = (import.meta.env.VITE_PADDLE_ENV ?? "sandbox").toLowerCase() === "live" ? "production" : "sandbox";
|
||||
|
||||
let paddlePromise: Promise<Paddle | undefined> | null = null;
|
||||
|
||||
export function paddleConfigured() {
|
||||
return paddleToken.trim() !== "";
|
||||
}
|
||||
|
||||
export async function getPaddle() {
|
||||
if (!paddleConfigured()) {
|
||||
return undefined;
|
||||
}
|
||||
if (!paddlePromise) {
|
||||
paddlePromise = initializePaddle({
|
||||
environment: paddleEnvironment,
|
||||
token: paddleToken,
|
||||
});
|
||||
}
|
||||
return paddlePromise;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import { loadStripe, type Stripe } from "@stripe/stripe-js";
|
||||
|
||||
const stripePublishableKey = import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY ?? "";
|
||||
|
||||
let stripePromise: Promise<Stripe | null> | null = null;
|
||||
|
||||
export function stripeConfigured() {
|
||||
return stripePublishableKey.trim() !== "";
|
||||
}
|
||||
|
||||
export async function getStripe() {
|
||||
if (!stripeConfigured()) {
|
||||
return null;
|
||||
}
|
||||
if (!stripePromise) {
|
||||
stripePromise = loadStripe(stripePublishableKey);
|
||||
}
|
||||
return stripePromise;
|
||||
}
|
||||
Reference in new issue
Block a user