#feni-patel_api

1 messages ¡ Page 1 of 1 (latest)

mellow tartanBOT
#

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

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

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.

raw laurel
#

@coarse rain Hello

coarse rain
#

Hi there, can you decribe the problem in details?

raw laurel
#

I have completed the generation of the connected account. but i need to implement refresh logic for that connected account link. i have implemented the logic but still after 3 mins connected account link is expires. can you help me with that ?

#

static async refreshUrl(req, user) {
const { accountId } = req.params;
const { stripe } = await stripeService.getStripeInstance();
const accountLink = await stripe.accountLinks.create({
account: accountId,
refresh_url: https://apivu.prolifictechnocrat.com/stripe/onboarding-link/${accountId},
return_url: https://vu.prolifictechnocrat.com/,
type: 'account_onboarding',
});
return accountLink;
}

this is my code

coarse rain
raw laurel
#

Yes, i have implemented that refresh url but still getting the same issue.

coarse rain
#

Can you share the code? I'd like to know how you implement the refresh URL

raw laurel
#

Sure

#

if (data) {
accountLink = await stripe.accountLinks.create({
account: data.id,
refresh_url: https://apivu.prolifictechnocrat.com/stripe/onboarding-link/${data.id},
return_url: https://vu.prolifictechnocrat.com/,
type: 'account_onboarding',
});
accountId = data.id;
} else {
const account = await stripe.accounts.create({
type: 'standard',
email: email,
});

            accountLink = await stripe.accountLinks.create({
                account: account.id,
                refresh_url: `https://apivu.prolifictechnocrat.com/stripe/onboarding-link/${account.id}`,
                return_url: `https://vu.prolifictechnocrat.com/`,
                type: 'account_onboarding',
            });
            accountId = account.id;
        }

this is my logic for the

#

refresh url

coarse rain
#

Hmm, why you create a new account?

raw laurel
#

if account with provided email is not esists then onyly i am creating the new

coarse rain
#

It shouldn't be part of refresh_url logic

#

And do you redirect your user to the new account link's URL?

raw laurel
#

No

#

it's not like

coarse rain
#

Ok, then that explains why it's not working.

raw laurel
#

i don't know that's why i asked you what i did wrong ?

coarse rain
#

Two things

  1. You shouldn't create a new account in the refresh_url implementation
  2. You should redirect your user to the new account link's URL
raw laurel
#

so what should i need to change so that this issue will be resolved

coarse rain
#

I believe I just told you the answer.

raw laurel
#

Okay let me check and update the code, will let you know if i am facing anything.

raw laurel
#

static async refreshUrl(req, user) {
const { accountId } = req.params;
const { stripe } = await stripeService.getStripeInstance();
const accountLink = await stripe.accountLinks.create({
account: accountId,
refresh_url: https://apivu.prolifictechnocrat.com/stripe/onboarding-link/${accountId},
return_url: https://vu.prolifictechnocrat.com/,
type: 'account_onboarding',
});
console.log("accountLink",accountLink)
return accountLink;
}

using above code i am getting the https://connect.stripe.com/setup/s/acct_1QNDU4Fw2rXRYYQl/P7T33PmfQeVW url

coarse rain
#

Does it solve your problem?

raw laurel
coarse rain
raw laurel
#

then what should it be ?

coarse rain
#

I don't think you've implemented the redirection to new account link URL.

#

I'd expect it redirect me to another account link URL

raw laurel
#

yes, i have implemented the redirection for the new account link URL which is
static async refreshUrl(req, res) {
try {
const data = await stripeService.refreshUrl(req, res.locals.user);
console.log("checking for the data",data)
console.log("checking for the data.url",data.url)
res.redirect(data.url);
} catch (error) {
console.error('Error refreshing Stripe onboarding link:', error);
Utils.sendResponse(error, null, res, error.message);
}
}

coarse rain
#

Nope, it looks like your app is still redirecting to your own website instead of stripe account link URL.

#

What's the data.url that shows up in your log?

raw laurel
coarse rain
#

Hmm, does your endpoint accepts GET method on https://apivu.prolifictechnocrat.com/stripe/onboarding-link/ end point?

#

Because your server returned 404 on this URL