#preston_code

1 messages ¡ Page 1 of 1 (latest)

leaden copperBOT
#

👋 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/1295443712284954645

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

graceful fiber
#

Hello, what specifically isn't accessible in the API after you create the account?

feral bough
#

the error i get is when i start the paymentintent, and it says it cant find the destination in transfer_data. here's the code for the paymentintent, correct me if im wrong with any of my code. (btw this paymentintent uses available balance in buyer connected account, not bank)

#

await stripe.paymentIntents.create({
amount: amountCents,
currency: 'usd',
customer: buyerStripeId,
on_behalf_of: process.env.ESCROW_ACCOUNT,
transfer_data: {
destination: process.env.ESCROW_ACCOUNT,
},
metadata: {
transactionId: transactionId.toString(),
sellerUsername: sellerUsername,
buyerUsername: buyerUsername,
buyerStripeId: buyerStripeId,
sellerStripeId: sellerStripeId,
transactionAmountUSD: amount,
transactionAmountCents: amountCents,
description: 'Buyer deposited money into escrow',
},
confirm: true,
}, { stripeAccount: buyerStripeId });

#

when i wrote code to check if the permissions of the escrow connected account were set, and to also check if its a test account, it printed out that its a live account.

#

i need it to be a test account

#

"Error processing payment: No such destination: 'acct_BLANK_ID'" (replaced id so i can keep it private)

#

sorry for spam messages. but just realized something, even with the test accounts i already created, it says its live when i use the code i made to retrieve that info. but even though it says its live, it has to be a test account because i have test funds in their available balance that arent actually real.... so im confused... all my stripe connect accounts are live but have test funds in them... so that brings the question, how do i test out payments with these test funds, even though the accounts are live?

graceful fiber
#

Can you send me the request ID req_123 from a time when you got that error?

#

Specifying the acct_1234 ID in those two fields should be the correct place. If you are creating the accounts in live mode they should also be connected to you in test mode as far as I am aware so I am not immediately sure what may be going wrong here

feral bough
#

whats the request id?

graceful fiber
feral bough
#

req_TDNCsk63QaCYNj

#

wait shit, i shouldnt have shown you that? cuz now you know my connected account id that the log mentioned

#

are accout id's private info?

graceful fiber
#

They are considered to be safe to share, no one can do anything with them unless they have your secret key

#

And thank you for the ID, checking in to what happened here

feral bough
#

thank you

graceful fiber
#

Ah I see what happened

#

You are also specifying the Stripe-Account header when making that API call. That tells Stripe to make the API call as that connected account, so you are getting that error because that connected account is not connected to itself

#

Yep, I overlooked that in the code that you sent. If you remove { stripeAccount: buyerStripeId } this should work

feral bough
#

also i just realized my code that tells you if its live or test mode, was wrong. all the accounts are test accounts actually

#

and okay, i gotcha, but without the code stripeAccount, how will it know where to move the funds from? is the fields i have in the beginning enough?

#

now im getting a new error when i make the paymentintent

#

it says "no such customer: acct_id_here"

graceful fiber
#

transfer_data.destination is what specifies the account to send funds to

feral bough
#

req_30eZvzSb2flZAc

#

this is the new request log with the error

#

it says it cant find the customer now

graceful fiber
#

Customers and Accounts are separate object types in Stripe. Customers represent people that you charge and accounts represent people that you send funds to

feral bough
#

ohhh

#

so what would i replace customer field in the paymentintent with? to use the account i had originally (the buyer)

#

for me, in my app. the buyer can be a seller and a seller can be a buyer. do they need two account id's? one for their buyer account and two for their seller account? and if so, how could i make them merge so their available balance is all in one place

graceful fiber
#

Can you tell me more about what you are trying to do with this process? Typically when you are both charging and paying out to someone you would need both an Account and a Customer object to represent them

#

Can you explain the balance part of what you are trying to do in more detail?

feral bough
#

i want accounts that have both customer and seller abilities. or at least a way to organize their two accounts (customer and account for selling)

#

like, i added test funds to the balance of who i listed the customer as, (we found out that its an account though not a customer), and i wanted them to take their balance i added onto, and send to the seller accounts balance. and the balance is basically their stripe balance.

#

and i want like, the available balance that seller now would have in their account, i want them to be able to use those funds now to be a buyer (customer) for someone else.

#

i want it to go both ways

#

one big available balance, for both buying and selling.

graceful fiber
#

Gotcha, unfortunately we don't have a good way of doing that in Stripe right now. The customer and account balances are always separate at the moment. I am trying to think of what you can do here. I know you can debit Express account balances but I forget if we support that for scenarios where an account is buying something from another account

#

Not immediately finding guidance on this. API-wise I think you can do this but it would be complicated. Looking a bit more in to this and will update you shortly

feral bough
#

i asked chatgpt and it said connected accounts can be buyers and sellers if they have the right capabilities, and i should go back to using , { stripeAccount: buyerStripeId } and then remove the "customer" field. but when i do that, now its not finding the destination of the escrow account

#

yeah this is def complicated, but im determined. let me know if you find anything please and ill let you know if i find anything too

graceful fiber
#

I am not sure what exactly ChatGPT said but it may not fully understand our API or supported business policies. Accounts support sending funds and being charged via account debits[1], but we don't support things like saving PaymentMethods to them like we do for Customers.
[1] https://docs.stripe.com/connect/account-debits

leaden copperBOT
feral bough
#

oh yup

graceful fiber
#

Ultimately to do this, you would need to manage two different payment intents or charges if you wanted to have a user use their Stripe balance and one of their customer payment methods to pay for something. Unfortunately that would make some things fairly complicated and I am not fully sure if we support that (we have restrictions around connected accounts sending money to each other)

#

If you reach out to our support team they can find out for you whether we support that as a use case for connect https://support.stripe.com/?contact=true

feral bough
#

i have my own account system on my apps API, and it basically saves their stripeId in mongodb. should i have them set up their accounts as a buyer, seller, or both. and have them go through the steps to be both a buyer and seller if they chose to?

#

this way we can store their customer id in one place, and seller id in another

graceful fiber
#

That is up to you, though after thinking about it more I would recommend not trying to allow users to pay with things via their Stripe balance. Right now the most straightforward approach is to create an Account for anyone acting as a seller and a Customer for anyone acting as a buyer. If support says we do allow using Stripe balances that way, then you definitely can go in to implementing that, but it may be more trouble than it is worth.

#

We do have things to make this kind of setup easier on the roadmap but unfortunately I am not aware of any ETA on that