feat(balance): per-method quick amounts on top-up page

This commit is contained in:
Boris Kovalskii
2026-06-10 23:37:16 +10:00
parent 8b2501d908
commit 25784dbe18
2 changed files with 6 additions and 1 deletions

View File

@@ -375,7 +375,11 @@ export default function TopUpAmount() {
} }
}; };
const quickAmounts = [100, 300, 500, 1000].filter((a) => a >= minRubles && a <= maxRubles); const quickAmounts = (
method.quick_amounts && method.quick_amounts.length > 0
? method.quick_amounts.map((kopeks) => kopeks / 100)
: [100, 300, 500, 1000]
).filter((a) => a >= minRubles && a <= maxRubles);
const currencyDecimals = targetCurrency === 'IRR' || targetCurrency === 'RUB' ? 0 : 2; const currencyDecimals = targetCurrency === 'IRR' || targetCurrency === 'RUB' ? 0 : 2;
const getQuickValue = (rub: number) => const getQuickValue = (rub: number) =>
targetCurrency === 'IRR' targetCurrency === 'IRR'

View File

@@ -448,6 +448,7 @@ export interface PaymentMethod {
max_amount_kopeks: number; max_amount_kopeks: number;
is_available: boolean; is_available: boolean;
options?: PaymentMethodOption[] | null; options?: PaymentMethodOption[] | null;
quick_amounts?: number[];
// Если true — после получения payment_url кабинет сразу делает // Если true — после получения payment_url кабинет сразу делает
// window.location.href вместо показа панели с кнопкой "Открыть". // window.location.href вместо показа панели с кнопкой "Открыть".
open_url_direct?: boolean; open_url_direct?: boolean;