"use client"; import getPocketBase from "@/lib/pocketbase"; /** Browser-session authentication is distinct from the audit attribution header. */ export async function paymentFetch(url: string, init?: RequestInit): Promise { const headers = new Headers(init?.headers); headers.set("Authorization", `Bearer ${getPocketBase().authStore.token}`); const response = await fetch(url, { ...init, headers, cache: "no-store" }); const result = await response.json(); if (!response.ok) throw new Error(result.error || `Request failed (${response.status})`); return result as T; }