#luft-connect-questions

1 messages ยท Page 1 of 1 (latest)

gritty needleBOT
#

Hello! We'll be with you shortly. 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.

hard zenith
#

`app.post('/createTransferToWinner', async (req, res) => {
try {
const { destinationId, amount, currency } = req.body;
console.log(destinationId, currency);

const paymentIntent = await stripe.paymentIntents.create({
amount: amount,
currency: currency,
off_session: true,
automatic_payment_methods: {
enabled: true,
},
transfer_data: {
destination: destinationId,
},
confirm: true,
return_url: "http://localhost:3000",
});

console.log(paymentIntent);
res.send({ paymentIntent });

} catch (err) {
res.send(400).end();
console.log(err);
}
});`

#

I thought at the first moment, that the automatic_payments_methods is the solution as in an instance in the docs, but apparently it is not.

sonic rapids
#

Not sure I understand exactly

#

But you aren't passing a customer id or payment method anywhere

#

So it doesn't know what to charge

hard zenith
#

Sorry ๐Ÿ˜…?

sonic rapids
#

How can you charge the amount without a payment method?

#

You confirm the above payment intent on creation but don't pass a payment method to charge

#

I don't understand what this means:
, if there is any possibility to charge the another user's stripe account from the credits in the stripe account's balance,

hard zenith
#

Ok, ok. I try to explain.

#

So there is an account that has a certain amount of money in stripe account balance right? And If any other person wins the competition I want to replenish the winner stripe account. But I don't know how to take the credits from the account of the user that wants to replenish.

sonic rapids
#

By credits are you referring to money in the Available Stripe Account Balance?

hard zenith
#

Yes sir.

sonic rapids
#

Ok and will you always be transferring money from the Platform to one of its Connect accounts? Or do you need to transfer between Connect accounts?

hard zenith
#

What's the difference if I may know?

#

Ow, only between the accounts/

sonic rapids
#

Platform is your account that has all the other accounts connected to it

hard zenith
#

Sorry, I got it.

sonic rapids
#

So you need to transfer from connect account to another connect account?

hard zenith
#

I mean, I want to do it, so if the user would be able then to payout the available balance or at least a part of it to an bank account or any other money holder like paypal etc.

#

The question is how to add the payment_method so the balance will be charged after executing the function and the money will be pushed to the destination account.

sonic rapids
#

You can only transfer money from platform -> connect account

#

Not connect -> connect

hard zenith
#

Is there no possibility to replenish one account from the another?

sonic rapids
#

Then issue a transfer to the destination

#

But that's kinda hacky

gritty needleBOT
hard zenith
#

So first to charge an account and then create transfer?

#

As far as I see.

sonic rapids
#

Yeah that's really the only way

#

And that's only possible if the accounts are express or custom

hard zenith
#

I've got express accounts so I'll do it. Btw, may i have one more query?

#

or actually 2 queries, because I reminded myself for a second.

sonic rapids
#

Yes please ask

hard zenith
#

Is there any specific code to confirm the paypal payments in this popup? Because apparently the code should be sent to my phone, but i did not get anything yet.

unkempt junco
#

Hi ๐Ÿ‘‹

I'm stepping in as my colleague needs to go soon

hard zenith
#

And what to put in the stripeAccount property, in this code: const transfer = await stripe.transfers.create( { amount: 1500, currency: 'pln', destination: '{{PLATFORM_STRIPE_ACCOUNT_ID}}', }, { stripeAccount: '{{CONNECTED_ACCOUNT_ID}}', } ); what to put in the both fields? Where should be sender and where receiver? Or is the stripeAccount something different I'll explain why I ask about it, because as I ran that code: `app.post('/createTransferToWinner', async (req, res) => {
try {
const { destinationId, amount, currency, organizatorId } = req.body;
console.log(destinationId, currency);

await stripe.charges.create({
amount: amount,
currency: currency,
source: organizatorId,
});

const transfer = await stripe.transfers.create(
{
amount: amount,
currency: currency,
destination: destinationId,
},
{
stripeAccount: organizatorId,
});

res.send({ transfer });

} catch (err) {
res.send(400).end();
console.log(err);
}
});Then i got a message like:StripeInvalidRequestError: Cannot create transfers between connected accounts. If you're trying
to debit a Connected account`

unkempt junco
#

I'm sorry but did you read our documents thoroughly? I ask because this is explained.

unkempt junco
#

Essentially you need to provide the Platform ID and Connected Account ID for each parameter

hard zenith
#

Platform ID? Is it available to grab it from that code: const account = await stripe.accounts.retrieve('{{CONNECTED_ACCOUNT_ID}}');. I mean, i read the docs quite rapidly so I could have overlooked the details.

unkempt junco
#

Hold on

#

take a step back

hard zenith
#

No that's an account id, but where to get the platform from.

unkempt junco
#

Do you know which account is the platform?

#

and which is the Connected Account?

hard zenith
#

Do you mean in my code now?

#

Well, I do not know which account the platform is, but I know which connected account is.

unkempt junco
#

You will need to know both before you start trying to create any Stripe objects between the two

hard zenith
#

That's an connected account id. But if it pertains The Platform account, please tell me the secret master.

unkempt junco
#

I can't help you with this. This is something you need to know about your integration.

#

For instance I created a test Stripe Account and then I used that account to create a bunch of test Connected Accounts. My initial Stripe Account is the platform for all those Connected Accounts

#

But I'm sorry this is bare bones fundamental Stripe Connect and if you don't have this straight before you start coding you will get yourself into a nightmare of a situation

hard zenith
unkempt junco
#

IF you don't get that then you need to read our Stripe Connect docs top to bottom

hard zenith
#

Well, I read the docs, but I still don't understand your outrage. The process looks like that User creates and account in my platform from UI side and creates also in the background the stripe account ---> then we link the user to setup he's stripe account. There is nothing said about and special other account. Or maybe I'm dumb that i do not understand it. May you point me the line where it's said? I read the docs from scratch and i did not found what you said.

unkempt junco
#

It's not outrage, it's concern you do not understand the system you are building

#

I don't want you to wind up in a bad situation

#

But I think you answered your own question

User creates and account in my platform
So wouldn't your account be the Platform account?

hard zenith
#

Well, let's separate every thing from each other. What do you mean by platform account precisely? The account of the platform owner or the account of the user in the platform?

unkempt junco
hard zenith
#

Of course it does.

unkempt junco
#

Then your account is the Platform

#

Once again, core Connect concepts here

hard zenith
#

User's stripe connected account, you mean? right after this setup and other shit.

unkempt junco
#

The account you create, with your Stripe Account API key, is the Connected Account

#

I know it may be some other person but they are using a UI you built that is run by your code so it's you creating the account

#

That account is Connected to your Platform

hard zenith
hard zenith
unkempt junco
#

Okay so your account is the Platform. That means your account ID goes where the the Platform ID is specified in the code snippet you linked

hard zenith
#

So what is the difference now between the connected account and the platform ? If it seems that's the same, because I have to setup the connected account anyways, and then you say that the account after setup is platform, or am I really to stupid to apprehend it.

gritty needleBOT
hard zenith
#

Maybe I'll show you how the account looks in my database.

unkempt junco
#

No that isn't going to help

#

I'm sorry to keep saying this but I think you really need to review our connect docs. Not from the standpoint of writing code but try to understand how the concepts relate to your actual business. I think it will make this much easier to understand

hard zenith
#

Why then? and the destinationId the same as organizatorId is an property of id got from the stripeAccountData.

somber plank
#

luft-connect-questions

#

๐Ÿ‘‹ Taking over for @unkempt junco ! I'm happy to help but only after you carefully review the docs first and then ask one clear question about your overall issue with a clear summary and not just pictures