Files
cozsweet-frontend-nextjs/src/lib/auth/checkout_handoff.ts
T

19 lines
581 B
TypeScript

import type {
CheckoutHandoffCreateResponse,
CheckoutIntent,
} from "@/data/schemas/auth";
import { getAuthRepository } from "@/data/repositories/auth_repository";
import type { Result } from "@/utils/result";
export function createCheckoutHandoff(
checkoutIntent: CheckoutIntent,
): Promise<Result<CheckoutHandoffCreateResponse>> {
return getAuthRepository().createCheckoutHandoff(checkoutIntent);
}
export function consumeCheckoutHandoff(
handoffToken: string,
): Promise<Result<CheckoutIntent>> {
return getAuthRepository().consumeCheckoutHandoff(handoffToken);
}