#ry_api

1 messages · Page 1 of 1 (latest)

tender axleBOT
#

👋 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.

agile crescent
#

Hi 👋 I'm not sure I understand what you're trying to accomplish, can you elaborate a bit more?

verbal rain
#

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,.

agile crescent
#

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.

verbal rain
#

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

agile crescent
#

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

verbal rain
#

Ah I see. Even when I select individual account though, it still doesn’t show any individual info

agile crescent
#

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?

verbal rain
#

I’m using accountLinks

agile crescent
#

Before that, how did you create the Account object?

verbal rain
#

Type standard

agile crescent
#

Ah, nevermind see it there

verbal rain
#

Yes sir

agile crescent
#

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.

verbal rain
#

No worries take your time

agile crescent
verbal rain
#

No sir

#

I’m not really getting many populated fields

agile crescent
#

Are you able to share the ID of a Connected Account that I can take a closer look at?

verbal rain
#

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

agile crescent
#

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.

verbal rain
#

Ah my apologies, would you mind letting me know on how to get platform id?

#

I found it it is: acct_1PSQAtFmejEfYLi7

agile crescent
#

Let me double check with my teammates if this is possible for non-Custom accounts.

verbal rain
#

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

agile crescent
#

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

verbal rain
round raftBOT
verbal rain
#

Hello!

trim galleon
#

Hello

verbal rain
#

I found the issue

#

It had nothing to do with the api

#

but requesting a paramater from the url instead of the query

trim galleon
#

Ah glad you figured it out!

verbal rain
#

Thank you both for your help and your time!

#

Is there somewhere i can let someone know about how helpful you were?

trim galleon
#

I'll pass it along!

#

Thanks for the kind words