Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe redirect_uri will not work

I have connected stripe standalone accounts to platform accounts before. In fact I did it a week back and it worked perfectly. But somehow this time it simply will not work even though I am following exactly the same procedure. I have set the redirect_uri to a url that is valid. This is what the link looks for my stripe connect button in my platform's page looks like

https://connect.stripe.com/oauth/authorize?response_type=code&client_id=platform_clientid&scope=read_write&redirect_uri=redirecturi

I have also set the redirect_uri to exactly the same thing in the stripe dashboard of the stand alone account. But when I click on the stripe button instead of being taken to the stripe site I end up with an error like this.

{
 "error": "invalid_redirect_uri",
  "error_description": "Invalid redirect URI 'redirecturi'. Ensure this 
   uri exactly matches one of the uris specified in your application 
   settings",
  "state": null
}

I am not even taken to the stripe site to log into my standalone account. As soon as I click the button I get this error. And the redirect_uri url is valid and points to a page that exists. Can anyone help?

like image 443
jai Avatar asked Apr 27 '17 06:04

jai


2 Answers

This error indicates that you are explicitly telling Stripe to redirect to a specific URL and that URL is not in the list of whitelisted redirect URLs in your platform settings.

When you redirect your user to Stripe, you send them to a URL that looks like this:

https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_XXXX&scope=read_write

If you have multiple redirect URLs, you would explicitly tell Stripe where to send the user back by adding an extra GET parameter with the name redirect_uri. You must be setting this at the moment and that URL does not exactly match one of the URLs in your settings so Stripe is returning an error.

You need to double check the URLs you've set in Stripe and make sure that you use one from the list or add a new one to the list.

like image 175
koopajah Avatar answered Nov 08 '22 23:11

koopajah


One thing to double check here as well: make sure you save the redirect URL in both test mode and in live mode. Stripe has separate settings for each, and the settings are only exposed when you change from live to test, or vice vera.

like image 1
Phil Johnston Avatar answered Nov 08 '22 23:11

Phil Johnston