4

I want to set UserId in redirect URI of Stripe, My URL changes like this

www.mydomain.com/registration/1
www.mydomain.com/registration/2

I have www.mydomain.com/registration/ set in redirect URI which works fine but breaks when Stripe sees that number in URI

I need to: Connect the users to Stripe using this feature

mahaDev
  • 125
  • 3
  • 10

2 Answers2

1

You should just redirect to one page on your site.

That one page can either: a) finalize the oauth process and then do the redirect, or b) redirect to the page that will complete the oauth process

Matthew Arkin
  • 4,460
  • 2
  • 27
  • 28
  • This sounds promising but I am expecting some solution at Stripe Redirect URI. – mahaDev Dec 30 '15 at 06:22
  • 2
    This would be the only solution, the redirect URI is not dynamic, though you can use a state query string parameter which Stripe will append to your redirect uri. – Matthew Arkin Dec 30 '15 at 16:56
  • 2
    The state query string can have information embedded in it. – richard Jul 18 '18 at 06:12
  • do URLs being sent in query string require to be registered in Stripe connect settings? I wanna achieve this feature without registering it before, but on runtime when I send query string. – Arslan Ahmed Oct 15 '19 at 14:00
0

You can literally use a url in your app like this:

<a 
  href={`https://dashboard.stripe.com/oauth/authorize?response_type=code&state=${profile?.id}&client_id=${process.env.NEXT_PUBLIC_STRIPE_OAUTH_CLIENT_ID}&scope=read_write&redirect_uri=localhost.com/business/verify`}
>  Connect with Stripe </a>
Lonare
  • 3,581
  • 1
  • 41
  • 45