#lkcpo
1 messages · Page 1 of 1 (latest)
Here's our NodeJS code:
// code in NodeJS
const paymentData = {
amount,
currency,
// Do we make this false if we want to hold funds for "X" weeks?
automatic_payment_methods: {
enabled: true,
},
};
if (config.isConnectedAccount) {
// Does this transfer the funds to the connected account right away?
// Can we distribute via the STRIPE UI vs. Sending $ right away (if this is true)
paymentData['transfer_data'] = {
destination: config.connectedAccountId,
};
const customer = email ? await getOrCreateCustomer(email,name,config.connectedAccountId,stripe) : '';
let application_fee_amount = await getAmount(330, 2.9, amount);
paymentData['application_fee_amount'] = application_fee_amount;
paymentData['customer'] = customer?.id || '';
}
const paymentIntent = await stripe.paymentIntents.create(paymentData);
// our fees is $3.00
- If we want to refund, how do we take it from a connected account (if the above code is correct)?
- also, what is this line doing:
automatic_payment_methods: {
enabled: true,
},
Hello
What type of Connected Accounts are you working with?
So we have our main stripe account.
Then we have 2 client accounts that we move money into -- and I believe we're moving it at time of transaction -- that code above happens when someone "pays".
Okay but do you know what type of Connected Accounts these are?
If you have an example PaymentIntent ID that you can share I can also look at your integration directly
Ok. Let me snag it. Just looking for that thread in my TEAMS chats.
👍
destination: config.connectedAccountId
this is our account, just need to find the dang id. .one sec
Can I find this in my Stipe account dash or is this only in API?
of course, can't find thread, still looking for it
"connectedAccountId is our account - Lab3 Interactive "
but that probably doesn't help
It should look like acct_xxxx
got it
If you look at a Connected Account in the Dashboard the ID is in the top right
acct_1NXmBwPspnRWOyoF
This is 1 client account we are sending money too (and the majority)
FYI, I've paused payouts until I figure this out.
this is the other connected acct.
acct_1N6xaNQ5wcbB6Kcd
Okay looks to be an Express Account
So using a Destination Charge flow is indeed the recommended way to handle things as you are doing.
don't think I ever knew that.
And this does mean that refunds will come out of your platform account.
Are you setting reverse_transfer: true when you issue refunds?
Probably not.
We're kind of new at understanding best practices for handling refunds.
Let me take a look at a refund you have made in the past
Here's what happens:
- $100 transaction
- 2.9% + $0.30 - Stripe
- $3.00 - us (Sketchplay)
$93.80 = sent to connected account.
Check the $885 one, most recently.
Ah okay so that one you refunded via the Dashboard actually
The refund request is here: https://dashboard.stripe.com/logs/req_7H8azuVYSU3FhK
When you do that, there is a little tickbox that indicates you want to reverse the associated transfer.
You want to tick that box if you are going to refund via the Dashboard
ahhhhh
You can test this out in test mode as well
Got it... Is there an API for this as well?
Eventually we're going to build in ADMIN ability to refund via our platform.
and, can you actually tell me how reverse_transfer works?
https://stripe.com/docs/connect/destination-charges#issuing-refunds for information on how this works.
Really you should read through that whole doc if you haven't yet.
Got it.
Ok, so code wise at time of transaction, we're good --
but when/if we need to refund -- we should use reverse_transfer api to backout the transaction (assuming we also lose the stripe fee on the way in so refund is - the stripe fee?
Yep that's correct.
Ok, We'll read through this.. thank you! OH, one more quesiton ---
Is there a way to move money from connected account to main account. In other words, $885 that we paid, I want to take that back from the connected account?
(let's assume after I talk with client they are ok with this)
You can always reverse the transfer at any point.
Even if you didn't do it upon issuing the refund -- you can still do that now.
got it.
There is a button when you view the Transfer itself: https://dashboard.stripe.com/connect/transfers/tr_3OVHUfLKTM2K3idy0Jh6K5N4 or you can do this via the API: https://stripe.com/docs/api/transfer_reversals/create
Unfortunately, no. But you can grab the URL and refer back to it later if you need to.
Otherwise copy/paste is the only way
Ahh, it will still be here -- just closed?