diff --git a/test_request/test_request.py b/test_request/test_request.py index 331234a..fc0ddf2 100644 --- a/test_request/test_request.py +++ b/test_request/test_request.py @@ -6,9 +6,9 @@ access_cred = json.load(f) f.close() -client_id = access_cred['client_id'] -client_secret = access_cred['client_secret'] -redirect_uri="https://httpbin.org/get" +client_id = access_cred["client_id"] +client_secret = access_cred["client_secret"] +redirect_uri = "https://httpbin.org/get" url = "https://purchase.izettle.com/purchases/v2" @@ -16,9 +16,7 @@ token_url = "https://oauth.zettle.com/token" scope = ["READ:PURCHASE"] -zettle = OAuth2Session(client_id, - scope=scope, - redirect_uri=redirect_uri) +zettle = OAuth2Session(client_id, scope=scope, redirect_uri=redirect_uri) authrization_url, state = zettle.authorization_url(authorization_base_url) @@ -28,15 +26,12 @@ print(client_id) -ret = zettle.fetch_token(token_url, - include_client_id=True, - client_secret=client_secret, - authorization_response=redirect_response - ) +ret = zettle.fetch_token( + token_url, + include_client_id=True, + client_secret=client_secret, + authorization_response=redirect_response, +) r = zettle.get("https://purchase.izettle.com/purchases/v2?limit=50&descending=true") print(r) - - - -