WIP 1.51.11: money on v2 via v1 handlers (viaV1 adapter)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls1vMdg2GYqbnKZmPaX1ot
This commit is contained in:
2026-10-29 13:43:36 +02:00
co-authored by Claude Opus 5.5
parent de08f057ad
commit fb36e9c8ac
36 changed files with 10334 additions and 154 deletions
@@ -1,7 +1,7 @@
"use client";
import { useEffect, useState } from "react";
import { apiFetch } from "@/lib/api";
import { apiV2Data } from "@/lib/apiV2";
type ProvidersResponse = { providers: { id: string; label: string }[]; minimumAmount: number };
@@ -21,7 +21,7 @@ export type OnlinePayments = {
// One request per page load, shared by every component that asks.
let pending: Promise<ProvidersResponse | null> | null = null;
function load() {
if (!pending) pending = apiFetch<ProvidersResponse>("/api/payments/providers").catch(() => null);
if (!pending) pending = (apiV2Data("get", "/payments/providers") as Promise<ProvidersResponse>).catch(() => null);
return pending;
}