#Mahesh K

1 messages · Page 1 of 1 (latest)

opal surgeBOT
wild storm
#

Hello! Do you have a question?

turbid gust
#

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

wild storm
#

Can you give me a more specific example? What URL is it being changed to?

turbid gust
#

i am using res.redirect() method in nodejs

wild storm
#

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

turbid gust
#

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

#

did you got my point?

wild storm
#

Yeah I hear what you're saying

turbid gust
#

is my code is correct?

wild storm
#

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

turbid gust
#

no if i do that its taking to the correct url

#

like its taking to the onboarding page only

wild storm
#

Okay so when you do that it works fine?

#

So then it HAS to be someting about what your code is doing

turbid gust
#

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

wild storm
#

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

turbid gust
#

i dont think so.

#

its ok, let me check

wild storm
#

Any luck with chasing it down?