提现
This commit is contained in:
parent
ec0eb17fb3
commit
ece1ef09ad
|
|
@ -12,7 +12,7 @@ const withdrawalService = require('../services/withdrawalService');
|
|||
const createWithdrawal = async (req, res) => {
|
||||
try {
|
||||
const userId = req.user.id;
|
||||
const { amount, paymentMethod, paymentDetails } = req.body;
|
||||
const { amount, currency, paymentMethod, paymentDetails } = req.body;
|
||||
|
||||
// Validate required fields
|
||||
if (!amount || !paymentMethod || !paymentDetails) {
|
||||
|
|
@ -27,6 +27,7 @@ const createWithdrawal = async (req, res) => {
|
|||
|
||||
const withdrawal = await withdrawalService.createWithdrawal(userId, {
|
||||
amount,
|
||||
currency,
|
||||
paymentMethod,
|
||||
paymentDetails,
|
||||
});
|
||||
|
|
@ -37,6 +38,7 @@ const createWithdrawal = async (req, res) => {
|
|||
id: withdrawal.id,
|
||||
withdrawalNo: withdrawal.withdrawalNo,
|
||||
amount: parseFloat(withdrawal.amount).toFixed(2),
|
||||
currency: withdrawal.currency || 'CNY',
|
||||
paymentMethod: withdrawal.paymentMethod,
|
||||
status: withdrawal.status,
|
||||
createdAt: withdrawal.createdAt,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user