Download src/lib/api/billing.ts from asnannp/DocDoeAI: direct link, hf CLI and curl.
- Browser
- Download file 788 Bytes
-
https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/src/lib/api/billing.ts
- Command line
-
hf download hf://spaces/asnannp/DocDoeAI/src/lib/api/billing.ts
-
curl -L -o billing.ts https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/src/lib/api/billing.ts
788 Bytes
| import { apiPost } from "@/lib/api/client"; | |
| import type { BillingMe } from "@/lib/api/types"; | |
| import type { ActivePaidBillingPlanKey } from "@/lib/billing/activePlans"; | |
| export type CheckoutSession = { | |
| url: string; | |
| session_id: string; | |
| }; | |
| export type BillingPortalSession = { | |
| url: string; | |
| }; | |
| export function createCheckoutSession(plan: ActivePaidBillingPlanKey) { | |
| return apiPost<CheckoutSession, { plan: ActivePaidBillingPlanKey }>( | |
| "/billing/create-checkout-session", | |
| { plan }, | |
| ); | |
| } | |
| export function startBillingTrial() { | |
| return apiPost<BillingMe, Record<string, never>>("/billing/start-trial", {}); | |
| } | |
| export function createBillingPortalSession() { | |
| return apiPost<BillingPortalSession, Record<string, never>>( | |
| "/billing/create-portal-session", | |
| {}, | |
| ); | |
| } | |