#rajveer_api

1 messages Β· Page 1 of 1 (latest)

open cliffBOT
#

πŸ‘‹ Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

πŸ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1216678267197591552

πŸ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

delicate sorrelBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

forest umbra
acoustic blade
#

Listen i have a test mode stripe account so what can i do for withdrawal process?

forest umbra
#

follow one of the guides linked on the page above.

acoustic blade
#

not understand

forest umbra
#

what can I clarify for you?

acoustic blade
#

listen i have use the test mode stripe account so with the use of testing bank account can i will made the withdrawal demo?

forest umbra
#

you need to integrate Stripe Conenct and create and onboard connected accounts before you can even begin to think about implementing payouts.

#

so hence, you'd follow one of the getting-started guides for Connect.

acoustic blade
#

listen

forest umbra
#

#πŸ“–rules 2 : be civil (telling people "to listen" is quite rude).

#

I completely understand your issue. You have a bank account token btok_xxx and you think you can use that to do a payout in testmode(a withdrawal as you call it). You can't, that's not how Stripe works. You need to create a Connect account for the user who is going to receive money, onboard that account to collect identity verification, and then you can start processing payments and transferring money to the account in order to make payouts to them. It's a whole process and quite complicated.
So the advice is β€” start with a Connect guide, linked above.
hope that helps!

acoustic blade
#

so in test mode can withdrawal functionality will works?

forest umbra
#

yes.

acoustic blade
#

so brother can you provide me any simple demo for that?

forest umbra
#

no, but I can provide the docs that help you to build such a demo.

acoustic blade
#

okay so please provide me

acoustic blade
#

but in this doc not any resources for the test mode

forest umbra
#

not sure what you mean, you can build all that code in test mode using test mode API keys.

#

I've done it myself many times

acoustic blade
#

so please send me the code because i have the urgent

forest umbra
#

I can't do that but I can provide the docs that help you to build such a demo.

acoustic blade
#

but in docs i can't understand it

forest umbra
#

what can I clarify for you?

acoustic blade
#

okay first i was create this api is it right?
// Route to create a bank account token
app.post('/create-bank-account-token', async (req, res) => {
try {
const bankAccountToken = await stripe.tokens.create({
bank_account: {
country: 'IN',
currency: 'INR',
account_holder_name: req.body.account_holder_name,
account_holder_type: req.body.account_holder_type,
routing_number: 'HDFC0000261',
account_number: '000123456789'
},
});
console.log(bankAccountToken);
console.log(bankAccountToken.id);

    res.json({ token: bankAccountToken.id });
} catch (err) {
    console.error('Error creating bank account token:', err);
    res.status(500).json({ error: 'Could not create bank account token' });
}

});

forest umbra
#

that's one very small part , yep

acoustic blade
#

now see i was create this api is it right?
// Route to initiate a withdrawal
app.post('/withdraw', async (req, res) => {
console.log("Hello");
console.log("Hello", req.body.amount);
console.log("Hello", req.body.destination);
console.log(req.body);

try {
    const withdrawal = await stripe.payouts.create({
        amount: req.body.amount,
        currency: 'INR',
        destination: req.body.destination,
        // amount: 300,
        // country: 'IN',
        // currency: 'INR',
        // account_holder_name: "Mansi",
        // account_holder_type: "Individual",
        // routing_number: 'HDFC0000261',
        // account_number: '000123456789'
    });
    console.log(withdrawal)
    res.json({ message: 'Withdrawal initiated successfully' });
} catch (err) {
    console.error('Error initiating withdrawal:', err);
    res.status(500).json({ error: 'Could not initiate withdrawal' });
}

});

forest umbra
#

no.

#

sorry we're going around in circles here

#

I told you an hour ago: you can't payout to a Token object [which is what that code is trying to do], you have to attach the token to a Connect account first.

#

you really need to stop, ignore this code for now, and go read and understand the docs for Connect in detail and ask any clarifying questions about Connect.

acoustic blade
#

okay so after this API create-bank-account-token what can i do you can guide me step by step process plesae

forest umbra
acoustic blade
#

but listen i have an indian stripe account so can work?

forest umbra
#

yes.

acoustic blade
#

okay so now we will not talk for code okay we will discuss only on what i will do in stripe dashboard so please tell me only steps

forest umbra
#

you have to write code for this.

acoustic blade
#

so after the token API plesae provide me remaining code

forest umbra
acoustic blade
#

okay see i have create one api for create account is it right?
stripe.accounts.createExternalAccount(
'acct_1032D82eZvKYlo2C', // The ID of the Stripe account you're adding the external account to
{
external_account: {
object: 'bank_account',
country: 'IN',
currency: 'inr',
account_holder_name: 'Mansi Purohit',
account_holder_type: 'individual', // Or 'company' if it's a business account
account_number: 'HDFC0000261',
routing_number: '000123456789', // IFSC code for Indian accounts
},
},
function (err, bankAccount) {
// Handle the response or error
if (err) {
console.error(err);
} else {
console.log(bankAccount);
}
}
);

#

and this api is necessary for test mode or ot?

velvet plover
acoustic blade
#

i can't understand the docs i am very confused

velvet plover
#

What part are you confused about exactly?

acoustic blade
#

i have only created this API:
app.post('/create-bank-account-token', async (req, res) => {
try {
const bankAccountToken = await stripe.tokens.create({
bank_account: {
country: 'IN',
currency: 'INR',
account_holder_name: req.body.account_holder_name,
account_holder_type: req.body.account_holder_type,
routing_number: 'HDFC0000261',
account_number: '000123456789'
},
});
console.log(bankAccountToken);
console.log(bankAccountToken.id);

        res.json({ token: bankAccountToken.id });
    } catch (err) {
        console.error('Error creating bank account token:', err);
        res.status(500).json({ error: 'Could not create bank account token' });
    }
});
#

then further process i am very confused

velvet plover
#

Did the guide tell you to create this code?

acoustic blade
#

no

#

i was do some R&D and all and create this code

#

I was tried this process for last 15 days but not working so can you and i was tried to find any demo for this but no so plesae help me because it's very urgent

velvet plover
#

I can't explain how Connect works better than professionally written docs, unfortunately. I can only answer specific questions if you have any. But otherwise I strongly advice you to go through the docs and my colleague and I shared, before attempting to write any code.

open cliffBOT
acoustic blade
#

Hello

bleak nexus
#

πŸ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

acoustic blade
#

look i have tried the withdrawal past 20-25 days but not working so please help me

bleak nexus
#

for payout issues please contact https://support.stripe.com/?contact=true

acoustic blade
#

no means i don't understand the flow i don't understand which APIS will make for this

bleak nexus
#

have you read the docs that my colleagues sent you?

acoustic blade
#

yess

#

but i don't understand

bleak nexus
#

what exactly?

acoustic blade
#

i don't know which APIS i will create

#

Plesae guide me proper

bleak nexus
#

I walked you through it last week, where are you stuck?

acoustic blade
#

currently i have create this API :
app.post('/create-bank-account-token', async (req, res) => {
try {
const bankAccountToken = await stripe.tokens.create({
bank_account: {
country: 'IN',
currency: 'INR',
account_holder_name: req.body.account_holder_name,
account_holder_type: req.body.account_holder_type,
routing_number: 'HDFC0000261',
account_number: '000123456789'
},
});
console.log(bankAccountToken);
console.log(bankAccountToken.id);

    res.json({ token: bankAccountToken.id });
} catch (err) {
    console.error('Error creating bank account token:', err);
    res.status(500).json({ error: 'Could not create bank account token' });
}

});

bleak nexus
acoustic blade
#

yess but it's not working

bleak nexus
#

you can't create a payout on your own account using these APIs

#

you need to login to your dashboard

#

and set the information there

acoustic blade
#

but i have test mode stripe account

#

so in that i have not permission to add bank account

bleak nexus
#

then you can't do payouts

#

payouts in test mode won't get to your bank account

acoustic blade
#

but i was use the test bank account for this i will only create the successfull demo that's it

bleak nexus
#

what's your account ID?

acoustic blade
#

acct_1OFED1SD98LCdufV

bleak nexus
#

did you manage to login to the dashboard?

acoustic blade
#

yes

bleak nexus
#

then click on the test mode switch

acoustic blade
#

but i was use test mode so how can i do it?

bleak nexus
#

once you do, you can then click on View all settings

#

and then you can click on Add bank account

#

and setup the payout schedule

#

if you have any issues, you need to speak with https://support.stripe.com/?contact=true to get help when it comes to dashboard actions, here on this channel we can help you with coding questions

acoustic blade
#

but i will do it in test mode not in live mode

bleak nexus
#

yes in test mode

#

make sure that the test mode switch is on

acoustic blade
#

okay i was turn it now?

bleak nexus
#

I'm not sure I understand

acoustic blade
#

look i on the test mode then

bleak nexus
#

would you mind sharing a screenshot?

acoustic blade
#

nono i ask you to the next step?

bleak nexus
acoustic blade
#

okay i was check it in that all settings are disabled because they all are available in live mode only

bleak nexus
#

would you mind sharing a screenshot?

acoustic blade
fierce whale
#

Hi πŸ‘‹ jumping in as my teammate needed to step away. Do you see a message of any sort when you hover over the Add bank account button? I'm not sure offhand why it would be grayed out.

#

Alright, based on what I'm seeing in the thread history, your next steps here are to switch to livemode and provide bank details to add an external account to your Stripe account. I'm pretty sure this is required to simulate payouts in your test account.

Looking back at your original request, I see you're providing the destination parameter when creating a Payout. That is not necessary, nor supported, when you're creating a Payout for your own account. If you omit that parameter without making any other changes to your account, do you continue to encounter an error (I believe something about not having an external account or bank account)?

acoustic blade
#

you will guide me the further process please

fierce whale
#

Sure, turn off the testmode toggle, click the Add bank account button, and enter your bank account details.

acoustic blade
#

but i will do it in test mode

fierce whale
#

Yup, I know

#

You still need a bank account in livemode

acoustic blade
#

but i want to do it all process in test mode

fierce whale
#

You will need to enter a bank account in livemode in order to test payouts in testmode.

acoustic blade
#

but how it's work like the money ws testing and account is real?

fierce whale
#

You won't actually be using that account, but it needs to be there for testmode payouts to work. (Assuming you are hitting an error when you remove the destination parameter from your request to create a Payout)

acoustic blade
#

but if i create the custom test account so it will work or not?

fierce whale
#

How is this related to a Custom account? You're trying to pay out for your own account, right?

acoustic blade
#

yess means i want withdraw money from stripe to bank account that's it

fierce whale
#

Then it doesn't sound like you need to worry about a Custom account, or any sort of Connected Account. Those are only involved if you want to pay out money to other people.

acoustic blade
#

yes yes means i want if multiple accounts will come then pay them like this

fierce whale
#

What do you mean by multiple accounts?

acoustic blade
#

means i have pay the money to the multiple accounts

#

but listen now do this for only one account

fierce whale
#

When you say multiple accounts, is that multiple bank accounts, multiple Stripe accounts, are they all owned by you or by third parties?

#

No, I need to understand exactly what you're trying to build, there is no point testing for a single account architecture if that doesn't support the flow you're trying to build.

acoustic blade
#

means listen i want whole functionality will i have one stripe test mode account and i want to withdraw money from that to one test bank account.i want this currently

fierce whale
#

That's not a good test if you want to pay out to third-parties, but okay, add a bank account in livemode.

acoustic blade
#

but the test account will not work?

fierce whale
#

Huh?

#

I don't understand the question.

acoustic blade
#

look you can guide me just for my requirment

fierce whale
#

I've tried, did you add a bank account in livemode as I've suggested yet?

acoustic blade
#

is it necessary to add bank acount?

fierce whale
#

Yes, to test in the scenario you're describing.

acoustic blade
#

but if i will add any Custom account the the withdrawal is possible or not?