28 lines
956 B
TypeScript
28 lines
956 B
TypeScript
import { NextResponse } from "next/server";
|
|
|
|
/**
|
|
* POST /api/billing/auto-charge — RETIRED.
|
|
*
|
|
* Auto-pay is no longer a customer-toggleable setting. A saved
|
|
* card on file is the consent to auto-bill; customers manage their
|
|
* card via update/remove on /settings/billing, nothing else. The
|
|
* auto_charge_enabled flag is now an admin-only pause used during
|
|
* disputes, set from /admin/billing/orgs.
|
|
*
|
|
* This route is kept as an explicit 410 (Gone) so any stale client
|
|
* that still POSTs here fails loudly rather than silently toggling
|
|
* a flag the customer shouldn't control. The old behaviour lived
|
|
* here through Phase 9b-2.
|
|
*/
|
|
export async function POST() {
|
|
return NextResponse.json(
|
|
{
|
|
error:
|
|
"Auto-pay can no longer be disabled. A saved card is required for service. " +
|
|
"Contact support if you need to switch to bank-transfer billing.",
|
|
code: "auto_pay_not_toggleable",
|
|
},
|
|
{ status: 410 }
|
|
);
|
|
}
|