feat: merchant specific fees, TRON & BTC support, coin logos, and bug fixes

This commit is contained in:
mstfyldz
2026-03-13 00:34:42 +03:00
parent b0c1055c13
commit 2d435a4ee8
17 changed files with 708 additions and 233 deletions

View File

@@ -3,7 +3,7 @@ import { db } from '@/lib/db';
export async function POST(req: NextRequest) {
try {
const { name, webhook_url, payment_provider, provider_config } = await req.json();
const { name, webhook_url, payment_provider, provider_config, fee_percent } = await req.json();
if (!name) {
return NextResponse.json(
@@ -27,9 +27,9 @@ export async function POST(req: NextRequest) {
const configStr = provider_config ? JSON.stringify(provider_config) : '{}';
const result = await db.query(
`INSERT INTO merchants (name, webhook_url, short_id, payment_provider, provider_config)
VALUES ($1, $2, $3, $4, $5) RETURNING *`,
[name, webhook_url, shortId, provider, configStr]
`INSERT INTO merchants (name, webhook_url, short_id, payment_provider, provider_config, fee_percent)
VALUES ($1, $2, $3, $4, $5, $6) RETURNING *`,
[name, webhook_url, shortId, provider, configStr, fee_percent || 1.0]
);
if (result.rows.length === 0) {