#ry_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1252246016611061782
📝 Have more to share? Add details, code, screenshots, videos, etc. below.
Hi 👋 I'm not sure I understand what you're trying to accomplish, can you elaborate a bit more?
Hey! I’m simply trying to make an authentication in node js and express js and I want to make it so we can easily send payouts but also I want to collect personal info like the users full name etc,.
If you're trying to onboard Connected Accounts, you should be using Account Links instead of Login Links. If you want a flow where you collect the necessary information for creating Connected Accounts in your own flow, and then provide that information to us, then you may be looking to leverage Custom Connected Accounts without a Stripe hosted onboarding flow.
But it is possible for me to do that? I just want the information so I can display like “Hello, $NAME” on the user dashboard page on my website
Depends on how you set up the Connected Account.
For instance, the individual hash, which would contain the name I believe you're referring to if you're onboarding individual type entities, is returned to you based on the contents to he controller hash or type that was set when creating the Connected Account.
Information about the person represented by the account. This property is null unless business_type is set to individual. After you create an Account Link or Account Session, this property is only returned for accounts where controller.requirement_collection is application, which includes Custom accounts.
https://docs.stripe.com/api/accounts/object#account_object-individual
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ah I see. Even when I select individual account though, it still doesn’t show any individual info
Did the account go through onboarding? What type of Connected Account did you create, or if you're using the controller hash when creating the account what did you pass in that hash?
Before that, how did you create the Account object?
Type standard
Ah, nevermind see it there
Yes sir
So yeah, you aren't using Custom accounts, so the information is more restricted. Let me double check whether this is just a testmode limitation.
No worries take your time
Hm, I believe I'm seeing the same behavior in livemode. On the Account you created, is business_profile.name being populated and visible to you?
https://docs.stripe.com/api/accounts/object#account_object-business_profile-name
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Are you able to share the ID of a Connected Account that I can take a closer look at?
Yes sir let me get that for you
Sorry my computer is acting strange
Okay, one account id is: acct_1PJwULFtSjIhMppH
As you can see there is no info like email, email or any personal info
Gotcha, and this is your Platform account ID? It doesn't look like it's connected to a Platform, so just want to double check that this isn't expected to be the ID of a Connected Account.
Ah my apologies, would you mind letting me know on how to get platform id?
I found it it is: acct_1PSQAtFmejEfYLi7
This seems to be the ID of a Connected Account that is associated with the Platform account you shared the ID for previously. (Though it is an Express account rather than a Standard one)
Let me double check with my teammates if this is possible for non-Custom accounts.
I found something weird...
const express = require('express');
const router = express.Router();
const { encrypt } = require('../../security/crypto/encrypt');
const connectToDB = require('../../db/connect');
var emailValidator = require("email-validator");
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
const User = require('../../models/user.model');
async function getInfoAndLog()
{
let user = await stripe.account.retrieve('acct_1PSfrICFFXywYQuq');
console.log(user)
}
getInfoAndLog()
async function getUserInfo(accountId)
{
let testUser = await stripe.account.retrieve(accountId)
return testUser
}
router.post('/link-account', async (req, res) => {
try {
const account = await stripe.accounts.create({
type: 'standard'
});
let accountId = account.id
const accountLink = await stripe.accountLinks.create({
account: accountId,
return_url: `http://localhost:2000/auth/post/return?accid=${accountId}`,
refresh_url: `http://localhost:2000/auth/post/refresh/`,
type: "account_onboarding",
});
res.json({accountLink: accountLink.url});
} catch (error) {
console.error(
"An error occurred when calling the Stripe API to create an account link:",
error
);
res.status(500);
res.send({ error: error.message });
}
});
// Re-authentication route
router.get('/reauth', async (req, res) => {
console.log("REAUTH");
});
// Return route
router.get('/return', async (req, res) => {
let user = getUserInfo(req.param.accid)
res.send(user)
});
module.exports = router;
thats my code
when i use the getInfoAndLog() function it includes all of the information i need like the name and stuff
but when i use res.send(user) with the same id, it doesnt give me some of the object returned
That doesn't make much sense to me, as those functions seem to be doing the same thing, aside from the fact that one is using a hard coded account ID.
In short though, I checked with a teammate who read the explanation on the individual hash the same way I did, that it's expected for that information to not be surfaced to you unless you're using a Custom connected account or corresponding values in the controller hash.
If you need access to this information and need to continue use the type of accounts you're using, I'd recommend writing in to our Support team, with an explanation of your use case, to see if there is anything they can offer you access to:
https://support.stripe.com/?contact=true
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Thats what i was thinking as well and Im very confused about it
Hello!
Hello
I found the issue
It had nothing to do with the api
but requesting a paramater from the url instead of the query
Ah glad you figured it out!