10 lines
331 B
JavaScript
10 lines
331 B
JavaScript
|
|
import { paymentService } from '../../../services/paymentService';
|
||
|
|
import { connectDB } from '../../../lib/db';
|
||
|
|
|
||
|
|
export async function POST(req) {
|
||
|
|
await connectDB();
|
||
|
|
const { orderId, gateway } = await req.json();
|
||
|
|
const result = await paymentService.pay(orderId, gateway);
|
||
|
|
return Response.json({ success: true, result });
|
||
|
|
}
|