#mdrifat_94613
1 messages · Page 1 of 1 (latest)
hi, there are some good tips on that error message at https://stackoverflow.com/questions/55686949/why-i-am-getting-insufficient-funds-when-trying-stripe-transfers-even-though-i/55687932#55687932 , I'd suggest reading that in detail.
i want to send this amount only for test mood
but the link you provided, its not for test mood
hmm, yes it is.
this is my code. actually i'm a fresher. so can you suggest me with my code ? . code : payment_request_confirm = async (req, res) =>{
const {paymentId} = req.body
try {
const payment = await withdrawRequest.findById(paymentId)
if(payment){
const {stripeId} = await stripeModel.findOne({
sellerId: new ObjectId(payment.sellerId)
})
await stripe.charges.create({
amount: payment.amount*100,
currency: 'usd',
destination: stripeId
})
await withdrawRequest.findByIdAndUpdate(paymentId,{status:'success'})
res.status(200).json({payment, message: "Payment send successful"})
}
} catch (error) {
console.log(error);
res.status(500).json({message: "Internal server Error"})
}
}
i changed stripe.transfers.create to stripe.charges.create
was there a specific guide you were reading? using stripe.charges.create like this is legacy.
that doesn't make sense sorry, they're completely different APIs.
let's step back. What are you trying to do, what is the overall goal?
i made a multivendor e-commerce website. i'm trying to transfer some amount of money to my seller or others. now i'm on test mood and this error shows when action hit to transfer money
I would suggest implementing that direcly using the guide https://stripe.com/docs/connect/collect-then-transfer-guide
you can't "just" transfer money, since the money needs to be available as is explained in the StackOverflow answer