feat(billing): PaymentProvider + Mock, self-service пополнение баланса
Шаг 0.13 плана production-готовности: - интерфейс PaymentProvider (createPayment/verifyWebhook/getPaymentStatus) - MockPaymentProvider с настоящим webhook (sha256-подпись, идемпотентность) - applySucceededPayment: транзакция с guard, credit, авто-снятие billingBlocked - роуты payments + confirm-test (только mock) + публичный webhook - Billing.tsx: Пополнить/Подтвердить (тест), фикс setLocation в рендере - миграция 0080 billing_payments, 13 новых тестов (78/78)
This commit is contained in:
@@ -311,7 +311,8 @@ const router = Router();
|
||||
router.get('/api/billing/summary', authenticateToken, requirePermission('billing.manage'), async (req: AuthenticatedRequest, res) => {
|
||||
try {
|
||||
const summary = await storage.getBillingSummary(req.organizationId!);
|
||||
return res.json({ success: true, summary });
|
||||
const { getPaymentProviderName } = await import('../billing/payment-provider');
|
||||
return res.json({ success: true, summary: { ...summary, paymentProvider: getPaymentProviderName() } });
|
||||
} catch (error) {
|
||||
console.error('Billing summary error:', error);
|
||||
return res.status(500).json({ success: false, error: 'Внутренняя ошибка сервера' });
|
||||
|
||||
Reference in New Issue
Block a user