From 9123dbb4c0590f399df54f0e4d470180ed2892b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C4=B0pek?= Date: Mon, 17 Nov 2025 17:58:54 +0300 Subject: [PATCH] feat: expand cryptocurrency options and streamline payment flow - Added support for 16 cryptocurrencies including Bitcoin, Ethereum, Monero, and popular stablecoins - Removed email field from payment form as notifications are configured in merchant settings - Organized crypto options by category (popular, stablecoins, other) for better UX --- src/app/api/support/create-payment/route.ts | 2 +- src/components/SupportModal.tsx | 43 +++++++++++---------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/app/api/support/create-payment/route.ts b/src/app/api/support/create-payment/route.ts index 7499024..6a8285f 100644 --- a/src/app/api/support/create-payment/route.ts +++ b/src/app/api/support/create-payment/route.ts @@ -60,6 +60,7 @@ export async function POST(request: NextRequest) { } // Prepare data for Cryptomus + // Note: Email notifications are configured in merchant account settings, not in API const paymentData = { merchant_id: MERCHANT_ID, amount: body.amount.toString(), @@ -68,7 +69,6 @@ export async function POST(request: NextRequest) { description: body.description, url_callback: `${process.env.NEXTAUTH_URL || 'http://localhost:3002'}/api/support/webhook`, url_success: `${process.env.NEXTAUTH_URL || 'http://localhost:3002'}/support/success`, - email: body.email || undefined, lifetime: 3600, // 1 hour is_payment_multiple: false } diff --git a/src/components/SupportModal.tsx b/src/components/SupportModal.tsx index 960f926..7710266 100644 --- a/src/components/SupportModal.tsx +++ b/src/components/SupportModal.tsx @@ -17,18 +17,32 @@ interface SupportModalProps { export function SupportModal({ isOpen, onClose }: SupportModalProps) { const [amount, setAmount] = useState('') const [currency, setCurrency] = useState('USDT') - const [email, setEmail] = useState('') const [loading, setLoading] = useState(false) const [error, setError] = useState('') const { t } = useLocale() const cryptoOptions = [ - { value: 'USDT', label: 'USDT (TRC20)', network: 'TRC20' }, - { value: 'USDC', label: 'USDC (TRC20)', network: 'TRC20' }, - { value: 'BTC', label: 'Bitcoin', network: 'BTC' }, - { value: 'ETH', label: 'Ethereum', network: 'ETH' }, - { value: 'LTC', label: 'Litecoin', network: 'LTC' }, - { value: 'TRX', label: 'TRON', network: 'TRC20' } + // Popular cryptocurrencies + { value: 'BTC', label: 'Bitcoin (BTC)', network: 'BTC' }, + { value: 'ETH', label: 'Ethereum (ETH)', network: 'ETH' }, + { value: 'XMR', label: 'Monero (XMR)', network: 'XMR' }, + { value: 'SOL', label: 'Solana (SOL)', network: 'SOL' }, + { value: 'BNB', label: 'Binance Coin (BNB)', network: 'BSC' }, + + // Stablecoins + { value: 'USDT', label: 'Tether (USDT)', network: 'TRC20' }, + { value: 'USDC', label: 'USD Coin (USDC)', network: 'ETH' }, + { value: 'BUSD', label: 'Binance USD (BUSD)', network: 'BSC' }, + + // Other cryptocurrencies + { value: 'LTC', label: 'Litecoin (LTC)', network: 'LTC' }, + { value: 'TRX', label: 'TRON (TRX)', network: 'TRC20' }, + { value: 'AVAX', label: 'Avalanche (AVAX)', network: 'Avalanche' }, + { value: 'MATIC', label: 'Polygon (MATIC)', network: 'Polygon' }, + { value: 'BCH', label: 'Bitcoin Cash (BCH)', network: 'BCH' }, + { value: 'DASH', label: 'Dash (DASH)', network: 'DASH' }, + { value: 'DOGE', label: 'Dogecoin (DOGE)', network: 'DOGE' }, + { value: 'SHIB', label: 'Shiba Inu (SHIB)', network: 'ETH' } ] const handleSubmit = async (e: React.FormEvent) => { @@ -46,8 +60,7 @@ export function SupportModal({ isOpen, onClose }: SupportModalProps) { amount: parseFloat(amount), currency, order_id: `support_${Date.now()}`, - description: t('support.description'), - email: email || undefined + description: t('support.description') }) }) @@ -71,7 +84,6 @@ export function SupportModal({ isOpen, onClose }: SupportModalProps) { const resetForm = () => { setAmount('') setCurrency('USDT') - setEmail('') setError('') } @@ -134,17 +146,6 @@ export function SupportModal({ isOpen, onClose }: SupportModalProps) { -
- - ) => setEmail(e.target.value)} - /> -
- {error && (