Migrate billing from Paddle to Lemon Squeezy
This commit is contained in:
@@ -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' },
|
||||
|
||||
Reference in New Issue
Block a user