@coursebuilder/core
Version:
Core package for Course Builder
974 lines (971 loc) • 33.9 kB
text/typescript
import { z } from 'zod';
declare const checkoutSessionCompletedEvent: z.ZodObject<{
id: z.ZodString;
created: z.ZodNumber;
data: z.ZodObject<{
object: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
mode: z.ZodLiteral<"payment">;
payment_intent: z.ZodString;
subscription: z.ZodNull;
id: z.ZodString;
object: z.ZodLiteral<"checkout.session">;
amount_subtotal: z.ZodNumber;
amount_total: z.ZodNumber;
created: z.ZodNumber;
currency: z.ZodString;
custom_fields: z.ZodArray<z.ZodUnknown, "many">;
customer: z.ZodString;
customer_details: z.ZodObject<{
address: z.ZodObject<{
city: z.ZodNullable<z.ZodString>;
country: z.ZodNullable<z.ZodString>;
line1: z.ZodNullable<z.ZodString>;
line2: z.ZodNullable<z.ZodString>;
postal_code: z.ZodNullable<z.ZodString>;
state: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
}, {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
}>;
email: z.ZodNullable<z.ZodString>;
name: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
}, {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
}>;
livemode: z.ZodBoolean;
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
payment_method_collection: z.ZodString;
payment_status: z.ZodString;
phone_number_collection: z.ZodObject<{
enabled: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
enabled: boolean;
}, {
enabled: boolean;
}>;
status: z.ZodString;
success_url: z.ZodString;
total_details: z.ZodObject<{
amount_discount: z.ZodNumber;
amount_shipping: z.ZodNumber;
amount_tax: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
}, {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
}>;
}, "strip", z.ZodTypeAny, {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: null;
customer: string;
payment_intent: string;
created: number;
livemode: boolean;
currency: string;
mode: "payment";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
}, {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: null;
customer: string;
payment_intent: string;
created: number;
livemode: boolean;
currency: string;
mode: "payment";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
}>, z.ZodObject<{
mode: z.ZodLiteral<"subscription">;
payment_intent: z.ZodNull;
subscription: z.ZodString;
id: z.ZodString;
object: z.ZodLiteral<"checkout.session">;
amount_subtotal: z.ZodNumber;
amount_total: z.ZodNumber;
created: z.ZodNumber;
currency: z.ZodString;
custom_fields: z.ZodArray<z.ZodUnknown, "many">;
customer: z.ZodString;
customer_details: z.ZodObject<{
address: z.ZodObject<{
city: z.ZodNullable<z.ZodString>;
country: z.ZodNullable<z.ZodString>;
line1: z.ZodNullable<z.ZodString>;
line2: z.ZodNullable<z.ZodString>;
postal_code: z.ZodNullable<z.ZodString>;
state: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
}, {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
}>;
email: z.ZodNullable<z.ZodString>;
name: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
}, {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
}>;
livemode: z.ZodBoolean;
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
payment_method_collection: z.ZodString;
payment_status: z.ZodString;
phone_number_collection: z.ZodObject<{
enabled: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
enabled: boolean;
}, {
enabled: boolean;
}>;
status: z.ZodString;
success_url: z.ZodString;
total_details: z.ZodObject<{
amount_discount: z.ZodNumber;
amount_shipping: z.ZodNumber;
amount_tax: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
}, {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
}>;
}, "strip", z.ZodTypeAny, {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: string;
customer: string;
payment_intent: null;
created: number;
livemode: boolean;
currency: string;
mode: "subscription";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
}, {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: string;
customer: string;
payment_intent: null;
created: number;
livemode: boolean;
currency: string;
mode: "subscription";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
}>, z.ZodObject<{
mode: z.ZodLiteral<"setup">;
payment_intent: z.ZodNull;
subscription: z.ZodNull;
id: z.ZodString;
object: z.ZodLiteral<"checkout.session">;
amount_subtotal: z.ZodNumber;
amount_total: z.ZodNumber;
created: z.ZodNumber;
currency: z.ZodString;
custom_fields: z.ZodArray<z.ZodUnknown, "many">;
customer: z.ZodString;
customer_details: z.ZodObject<{
address: z.ZodObject<{
city: z.ZodNullable<z.ZodString>;
country: z.ZodNullable<z.ZodString>;
line1: z.ZodNullable<z.ZodString>;
line2: z.ZodNullable<z.ZodString>;
postal_code: z.ZodNullable<z.ZodString>;
state: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
}, {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
}>;
email: z.ZodNullable<z.ZodString>;
name: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
}, {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
}>;
livemode: z.ZodBoolean;
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
payment_method_collection: z.ZodString;
payment_status: z.ZodString;
phone_number_collection: z.ZodObject<{
enabled: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
enabled: boolean;
}, {
enabled: boolean;
}>;
status: z.ZodString;
success_url: z.ZodString;
total_details: z.ZodObject<{
amount_discount: z.ZodNumber;
amount_shipping: z.ZodNumber;
amount_tax: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
}, {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
}>;
}, "strip", z.ZodTypeAny, {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: null;
customer: string;
payment_intent: null;
created: number;
livemode: boolean;
currency: string;
mode: "setup";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
}, {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: null;
customer: string;
payment_intent: null;
created: number;
livemode: boolean;
currency: string;
mode: "setup";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
}>]>;
}, "strip", z.ZodTypeAny, {
object: {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: null;
customer: string;
payment_intent: string;
created: number;
livemode: boolean;
currency: string;
mode: "payment";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
} | {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: string;
customer: string;
payment_intent: null;
created: number;
livemode: boolean;
currency: string;
mode: "subscription";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
} | {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: null;
customer: string;
payment_intent: null;
created: number;
livemode: boolean;
currency: string;
mode: "setup";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
};
}, {
object: {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: null;
customer: string;
payment_intent: string;
created: number;
livemode: boolean;
currency: string;
mode: "payment";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
} | {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: string;
customer: string;
payment_intent: null;
created: number;
livemode: boolean;
currency: string;
mode: "subscription";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
} | {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: null;
customer: string;
payment_intent: null;
created: number;
livemode: boolean;
currency: string;
mode: "setup";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
};
}>;
type: z.ZodLiteral<"checkout.session.completed">;
}, "strip", z.ZodTypeAny, {
type: "checkout.session.completed";
id: string;
data: {
object: {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: null;
customer: string;
payment_intent: string;
created: number;
livemode: boolean;
currency: string;
mode: "payment";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
} | {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: string;
customer: string;
payment_intent: null;
created: number;
livemode: boolean;
currency: string;
mode: "subscription";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
} | {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: null;
customer: string;
payment_intent: null;
created: number;
livemode: boolean;
currency: string;
mode: "setup";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
};
};
created: number;
}, {
type: "checkout.session.completed";
id: string;
data: {
object: {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: null;
customer: string;
payment_intent: string;
created: number;
livemode: boolean;
currency: string;
mode: "payment";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
} | {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: string;
customer: string;
payment_intent: null;
created: number;
livemode: boolean;
currency: string;
mode: "subscription";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
} | {
object: "checkout.session";
id: string;
status: string;
metadata: Record<string, string>;
subscription: null;
customer: string;
payment_intent: null;
created: number;
livemode: boolean;
currency: string;
mode: "setup";
amount_subtotal: number;
amount_total: number;
custom_fields: unknown[];
customer_details: {
name: string | null;
email: string | null;
address: {
state: string | null;
city: string | null;
country: string | null;
line1: string | null;
line2: string | null;
postal_code: string | null;
};
};
payment_method_collection: string;
payment_status: string;
phone_number_collection: {
enabled: boolean;
};
success_url: string;
total_details: {
amount_discount: number;
amount_shipping: number;
amount_tax: number;
};
};
};
created: number;
}>;
type CheckoutSessionCompletedEvent = z.infer<typeof checkoutSessionCompletedEvent>;
export { type CheckoutSessionCompletedEvent, checkoutSessionCompletedEvent };