Migrate billing from Paddle to Lemon Squeezy

This commit is contained in:
Codex Agent
2026-02-03 10:59:54 +01:00
parent 2f4ebfefd4
commit a0ef90e13a
228 changed files with 4369 additions and 4067 deletions

View File

@@ -3,7 +3,7 @@ export type GiftVoucherTier = {
label: string;
amount: number;
currency: string;
paddle_price_id?: string | null;
lemonsqueezy_variant_id?: string | null;
can_checkout: boolean;
};
@@ -78,14 +78,14 @@ export async function createGiftVoucherCheckout(data: GiftVoucherCheckoutRequest
return payload as GiftVoucherCheckoutResponse;
}
export async function fetchGiftVoucherByCheckout(checkoutId?: string | null, transactionId?: string | null): Promise<GiftVoucherLookupResponse | null> {
if (!checkoutId && !transactionId) {
export async function fetchGiftVoucherByCheckout(checkoutId?: string | null, orderId?: string | null): Promise<GiftVoucherLookupResponse | null> {
if (!checkoutId && !orderId) {
return null;
}
const params = new URLSearchParams();
if (checkoutId) params.set('checkout_id', checkoutId);
if (transactionId) params.set('transaction_id', transactionId);
if (orderId) params.set('order_id', orderId);
const response = await fetch(`/api/v1/marketing/gift-vouchers/lookup?${params.toString()}`, {
headers: { Accept: 'application/json' },