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