#Mahesh K
1 messages · Page 1 of 1 (latest)
Hello! Do you have a question?
yes
i generating url for creating a connect account by using this
const accountLink = await stripe.accountLinks.create({
type: "account_onboarding",
account: accountID,
refresh_url: ${origin},
return_url: ${returnUrl},
});
but i am redirecting the generated url its changing to another url
Can you give me a more specific example? What URL is it being changed to?
like....
'https://connect.stripe.com/setup/s/acct_1NVENBQrPYFZ4g8B/QgHG8xccfuwC'
this is the generated url but it is redirecting to this url https://testapi.cortracker.com/api/cor_payment/connect/createAccount
no its redirecting to this url https://testapi.cortracker.com/setup/s/acct_1NVENBQrPYFZ4g8B/QgHG8xccfuwC
i am using res.redirect() method in nodejs
https://testapi.cortracker.com it is my currect server domain
Do you happen to be reusing/revisiting these URLs at all?
Account links are meant to be one-time use, so as soon as it's visisted once we redirect to the refresh_url that you have specified
Even posting the link in a place like slack or discord will consume the link
because slack/discord will visit the link in order to generate the embedded preview
no i am not getting what you are saying
i know its a one time url
const accountLink = await stripe.accountLinks.create({
type: "account_onboarding",
account: accountID,
refresh_url: ${origin},
return_url: ${returnUrl},
});
console.log(accountLink.url)
res.redirect(accountLink.url)
this is my code
when i do console i am getting the actual url gnerated by the stripe api
but when i am redireting it is changing into https://testapi.cortracker.com/setup/s/acct_1NVENBQrPYFZ4g8B/QgHG8xccfuwC
did you got my point?
Yeah I hear what you're saying
Let's try something else - jsut create an account link, don't do res.redirect, and then take the URL and paste it directly into your browser
I just want to be see if that one also redirects you to a different URL
no if i do that its taking to the correct url
like its taking to the onboarding page only
Okay so when you do that it works fine?
So then it HAS to be someting about what your code is doing
you cant do anythig ?
if i do it using test mode its woring
but when i am woring with the live mode i am getting this error
Do you have different setup on your end for live vs test mode? I'm guessing you have something enabled on your production server that's accidentally consuming the link and then taking you directly to your refresh_url
Any luck with chasing it down?