#arvind_singh_21006
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
You can use this API method: https://stripe.com/docs/api/payouts/create
but is this possbile to direct payout in bank account not using the transfer method
You mean you want to pay out from your Platform's balance to the Connected account's bank account?
That's not possible, unfortunately.
then how can we do this ?
Why you can't transfer funds to your Connected account first?
What your current setup looks like?
wait i given the code
this connect Api for the connect account
router.get('/connectStripe', auth, (req, res) => {
const queryData = {
response_type: 'code',
// client_id:'ca_OCtAPDoVdQTGpnrsFf1mzpT4HSNHzeEL',
client_id: 'ca_OGDQJ3NpZbanZCtQCpQe8UHk1bBRfuNB',
scope: 'read_write',
redirect_uri: 'http://localhost:8889/cms/booking/redirect/'
}
let authorizationHeaader = req.headers.token;
const connectUri=https://connect.stripe.com/oauth/v2/authorize?response_type=code&client_id=ca_OGDQJ3NpZbanZCtQCpQe8UHk1bBRfuNB&stripe_user[email]=${req.user.email}&scope=read_write&state=${authorizationHeaader}&redirect_uri=http://localhost:8889/cms/booking/redirect/
// const connectUri=https://connect.stripe.com/oauth/v2/authorize?response_type=code&client_id=ca_OGDQJ3NpZbanZCtQCpQe8UHk1bBRfuNB&scope=&tokenId=${req.user._id}&redirect_uri=http://localhost:8889/cms/booking/redirect/
// return connectUri
return res.json({ connect: connectUri })
})
and this
exports.fundTransfer = async (req, res) => {
try {
// const transfer = await stripe.transfers.create({
// amount: Math.round(6 * 100),
// currency: 'aud',
// // customer: 'cus_OCsxl2nNhvTGig',
// source_transaction: "ch_3NTdwhI2JnJVTkz00FQjxRE0",
// destination: 'acct_1NTTFbDKP93GjLMk', // Replace with the destination account ID or seller's Stripe account ID
// // source_transaction: 'ch_3NQO33LvhvigSbBg0zAJ3rNe' // Replace with the charge ID associated with the payment
// // transfer_group: 'ORDER_95'
// })
// return transfer
const transfer = await stripe.transfers.create({
amount: Math.round(1 * 100),
currency: 'aud',
source_transaction: 'ch_3NUmeMHnkNc8JPqN1f6mymTD',
destination: 'acct_1NVTVII93ppumMX9',
});
return transfer;
} catch (error) {
console.log("🚀 ~ file: booking-service.js:3018 ~ exports.fundTransfer= ~ error:", error)
throw error;
}
}
transfer fund from stripe plateform to connect account balance
and this payout method to payout to bank account const payout = await stripe.payouts.create({
amount: Math.round(1 * 100),
currency: 'aud',
});
After you transfer the funds with stripe.transfers.create() you can pay out to the connected account's bank account.
You can set a schedule for the payouts or pay out manually:
Happy to help!