#feni-patel_api
1 messages ¡ Page 1 of 1 (latest)
đ 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.
- feni-patel_api, 6 days ago, 48 messages
@coarse rain Hello
Hi there, can you decribe the problem in details?
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
https://docs.stripe.com/api/account_links/create#create_account_link-refresh_url you need to implement the refresh URL so that when the previous account link expires, your user can get a refreshed account link for the onboarding
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes, i have implemented that refresh url but still getting the same issue.
Can you share the code? I'd like to know how you implement the refresh URL
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
Hmm, why you create a new account?
if account with provided email is not esists then onyly i am creating the new
It shouldn't be part of refresh_url logic
And do you redirect your user to the new account link's URL?
Ok, then that explains why it's not working.
i don't know that's why i asked you what i did wrong ?
Two things
- You shouldn't create a new account in the
refresh_urlimplementation - You should redirect your user to the new account link's URL
so what should i need to change so that this issue will be resolved
I believe I just told you the answer.
Okay let me check and update the code, will let you know if i am facing anything.
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
Does it solve your problem?
https://apivu.prolifictechnocrat.com/stripe/onboarding-link/acct_1QNDU4Fw2rXRYYQl this is one connected account link now this url is expired. now for this account id i am generated refresh url like https://connect.stripe.com/setup/s/acct_1QNDU4Fw2rXRYYQl/P7T33PmfQeVW url ut still link is not auto refreshed.
https://apivu.prolifictechnocrat.com/stripe/onboarding-link/acct_1QNDU4Fw2rXRYYQl doesn't look like an account link URL. I'd expect it to be a stripe hosted URL.
then what should it be ?
it should be something like "https://connect.stripe.com/setup/xxx"
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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
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);
}
}
here i called my refreshUrl function and from this i am getting link like https://connect.stripe.com/setup/s/acct_1QNDU4Fw2rXRYYQl/otyNyVk2idII
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?
data.url is checking for the data.url https://connect.stripe.com/setup/s/acct_1QNDU4Fw2rXRYYQl/344vgmAY0wpe