refactor: remove embedded checkout components and update billing API integration for streamlined checkout flow
This commit is contained in:
@@ -85,24 +85,13 @@ export interface CreateCheckoutParams {
|
||||
limit: number
|
||||
}
|
||||
|
||||
export async function createCheckoutSession(params: CreateCheckoutParams): Promise<{ client_secret: string }> {
|
||||
return await billingFetch<{ client_secret: string }>('/api/billing/checkout', {
|
||||
export async function createCheckoutSession(params: CreateCheckoutParams): Promise<{ url: string }> {
|
||||
return await billingFetch<{ url: string }>('/api/billing/checkout', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(params),
|
||||
})
|
||||
}
|
||||
|
||||
export interface CheckoutSessionStatus {
|
||||
status: string
|
||||
customer_email: string
|
||||
}
|
||||
|
||||
export async function getCheckoutSessionStatus(sessionId: string): Promise<CheckoutSessionStatus> {
|
||||
return await billingFetch<CheckoutSessionStatus>(`/api/billing/checkout/session-status?session_id=${encodeURIComponent(sessionId)}`, {
|
||||
method: 'GET',
|
||||
})
|
||||
}
|
||||
|
||||
export interface Invoice {
|
||||
id: string
|
||||
amount_paid: number
|
||||
|
||||
Reference in New Issue
Block a user