refactor: remove embedded checkout components and update billing API integration for streamlined checkout flow

This commit is contained in:
Usman Baig
2026-02-20 03:51:20 +01:00
parent 96b3919e52
commit 17106517d9
7 changed files with 27 additions and 269 deletions

View File

@@ -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