#luft-connect-questions
1 messages ยท Page 1 of 1 (latest)
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.
- luft-connect-balancetest, 20 hours ago, 7 messages
- luft-checkout-connect, 20 hours ago, 17 messages
- luftjunkie-transfers-topups, 1 day ago, 17 messages
`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.
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
Sorry ๐ ?
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,
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.
By credits are you referring to money in the Available Stripe Account Balance?
Yes sir.
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?
Platform is your account that has all the other accounts connected to it
Sorry, I got it.
So you need to transfer from connect account to another connect account?
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.
You can only transfer money from platform -> connect account
Not connect -> connect
Is there no possibility to replenish one account from the another?
If it's an express or custom account you could debit it: https://stripe.com/docs/connect/account-debits
Then issue a transfer to the destination
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But that's kinda hacky
Yeah that's really the only way
And that's only possible if the accounts are express or custom
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.
Yes please ask
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.
Hi ๐
I'm stepping in as my colleague needs to go soon
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`
I'm sorry but did you read our documents thoroughly? I ask because this is explained.
Hello.
Essentially you need to provide the Platform ID and Connected Account ID for each parameter
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.
No that's an account id, but where to get the platform from.
Do you mean in my code now?
Well, I do not know which account the platform is, but I know which connected account is.
You will need to know both before you start trying to create any Stripe objects between the two
That's an connected account id. But if it pertains The Platform account, please tell me the secret master.
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
Excuse me, but I don't get it tbh. Like the user creates an account and setups it and so forth by it self and to the user belongs only one account and not many.
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.
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?
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?
Okay, your code does this, right? https://stripe.com/docs/connect/collect-then-transfer-guide?platform=web#create-account
Of course it does.
User's stripe connected account, you mean? right after this setup and other shit.
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
I'm getting confused do you mean now private or secret key?
Yes, it's true.
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
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.
Maybe I'll show you how the account looks in my database.
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
Why then? and the destinationId the same as organizatorId is an property of id got from the stripeAccountData.