sumup / sumup-ecom-php-sdk

SumUp eCom PHP SDK
Other
41 stars 18 forks source link

No documentation that actually works for creating YOUR-AUTHORIZATION-CODE #9

Closed terrypearson closed 5 years ago

terrypearson commented 5 years ago

This page (https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/HowToAuthorize.md) says you need to put in YOUR-AUTHORIZATION-CODE that you obtained from authorizing a merchant.

However, I use the linked example on obtaining such a code (https://developer.sumup.com/docs/authorization#authorization-code-flow) and redirect the user to the following url: https://api.sumup.com/authorize?response_type=code&client_id=XXXXXX&redirect_uri=XXXXXX&scope=payments%20user.app-settings%20transactions.history%20user.profile_readonly&state=XXXXXX

Obviously, the XXXXX are replaced with real values.... By redirecting to that url, I get a 200 return code with no text or payload. So there is no way to obtain a code and use the API.

So my question is twofold, what is the proper way to get this auth code and can it be done through the PHP API?

lyubomir-sumup commented 5 years ago

Hi, @terrypearson You should get the code from the callback url as a query parameter ?code=XXXXX.

https://sample-app.example.com/callback?code=be366ce9fccd0c337d1da29b31d06dd1135ab95401562883&state=2cFCsY36y95lFHk4

You can read more here.