chore: /api/billing/plans fiyat kimliği + webhook tanılaması
This commit is contained in:
@@ -132,6 +132,9 @@ export function planCatalog() {
|
|||||||
...p,
|
...p,
|
||||||
satinAlinabilir: Boolean(p.priceEnv && process.env[p.priceEnv] && billingConfigured()),
|
satinAlinabilir: Boolean(p.priceEnv && process.env[p.priceEnv] && billingConfigured()),
|
||||||
satinAlinabilirYillik: Boolean(p.priceEnvYillik && process.env[p.priceEnvYillik] && billingConfigured()),
|
satinAlinabilirYillik: Boolean(p.priceEnvYillik && process.env[p.priceEnvYillik] && billingConfigured()),
|
||||||
|
// Tanılama: fiyat kimliği sunucuya ulaştı mı? (anahtardan bağımsız — değer sızdırmaz)
|
||||||
|
fiyatIdVar: Boolean(p.priceEnv && process.env[p.priceEnv]),
|
||||||
|
fiyatIdVarYillik: Boolean(p.priceEnvYillik && process.env[p.priceEnvYillik]),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -750,7 +750,7 @@ const server = http.createServer(async (req, res) => {
|
|||||||
|
|
||||||
// --- Abonelik / ödeme ---
|
// --- Abonelik / ödeme ---
|
||||||
if (url.pathname === '/api/billing/plans') {
|
if (url.pathname === '/api/billing/plans') {
|
||||||
return json(res, 200, { configured: billingConfigured(), plans: planCatalog() });
|
return json(res, 200, { configured: billingConfigured(), webhookHazir: webhookConfigured(), plans: planCatalog() });
|
||||||
}
|
}
|
||||||
if (url.pathname === '/api/billing/checkout' && req.method === 'POST') {
|
if (url.pathname === '/api/billing/checkout' && req.method === 'POST') {
|
||||||
const user = userFromAuthHeader(req.headers['authorization']);
|
const user = userFromAuthHeader(req.headers['authorization']);
|
||||||
|
|||||||
Reference in New Issue
Block a user