Hintergründe zum EventInvitePage Layout Customizer hinzugefügt. Badge und CTA entfernt, Textfelder zu Textareas gemacht. Geschenkgutscheine verbessert, E-Mail-Versand ergänzt + Resend + Confirmationseite mit Code-Copy und Link zur Package-Seite, die den Code als URL-Parameter enthält.
This commit is contained in:
@@ -23,6 +23,19 @@ export type GiftVoucherCheckoutResponse = {
|
||||
id: string | null;
|
||||
};
|
||||
|
||||
export type GiftVoucherLookupResponse = {
|
||||
code: string;
|
||||
amount: number;
|
||||
currency: string;
|
||||
expires_at: string | null;
|
||||
recipient_name?: string | null;
|
||||
recipient_email?: string | null;
|
||||
purchaser_email?: string | null;
|
||||
status: string;
|
||||
redeemed_at?: string | null;
|
||||
refunded_at?: string | null;
|
||||
};
|
||||
|
||||
export async function fetchGiftVoucherTiers(): Promise<GiftVoucherTier[]> {
|
||||
const response = await fetch('/api/v1/marketing/gift-vouchers/tiers', {
|
||||
headers: {
|
||||
@@ -61,3 +74,45 @@ 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) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const params = new URLSearchParams();
|
||||
if (checkoutId) params.set('checkout_id', checkoutId);
|
||||
if (transactionId) params.set('transaction_id', transactionId);
|
||||
|
||||
const response = await fetch(`/api/v1/marketing/gift-vouchers/lookup?${params.toString()}`, {
|
||||
headers: { Accept: 'application/json' },
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const payload = await response.json();
|
||||
|
||||
return (payload?.data ?? null) as GiftVoucherLookupResponse | null;
|
||||
}
|
||||
|
||||
export async function fetchGiftVoucherByCode(code: string): Promise<GiftVoucherLookupResponse | null> {
|
||||
const trimmed = code.trim();
|
||||
if (!trimmed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const params = new URLSearchParams({ code: trimmed });
|
||||
const response = await fetch(`/api/v1/marketing/gift-vouchers/lookup?${params.toString()}`, {
|
||||
headers: { Accept: 'application/json' },
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const payload = await response.json();
|
||||
|
||||
return (payload?.data ?? null) as GiftVoucherLookupResponse | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user