LauLamanApps / iZettleApi

iZettle Api php intergration
MIT License
12 stars 15 forks source link

Is there a method to get tocken without sending login and password to the api #19

Closed tarekfellah closed 6 years ago

tarekfellah commented 6 years ago

In your code example you have this $accessToken = $izettleClient->getAccessTokenFromUserLogin('john.doe@example.com', 'password'); Can we use something like this :

curl -s -d \
'grant_type=authorization_code&redirect_uri=http%3A%2F%2Fhttpbin.org&code=4fa87ba8cc7f30e91ad2ab1ad21c1b3e&client_secret=7356b8a1-75ac-4336-970b-bef63cd219c1&client_id=c55de605-48b6-42ef-b69e-cd9d14ded15a' \
-H'Content-Type: application/x-www-form-urlencoded' \
'{{URL}}/token' | python -m json.tool

Thanks

pazion commented 6 years ago

getAccessTokenFromAuthorizedCode is implemented. So now you can request accessToken with code retrieved after succesfull approval and redirect.

The redirect_url must be whitelisted on iZettle side ( send an email ).