-
-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] account_statement_import_online_gocardless : token/refresh endpoint #748
base: 16.0
Are you sure you want to change the base?
Conversation
2131017
to
0a4e9cc
Compare
…f the endpoint token/refresh request datas, plus the behavior of the _gocardless_get_token method which in case of a non expired refresh token was calling the endpoint token/new instead of token/refresh
@pedrobaeza @njeudy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok for me !
@@ -84,17 +84,17 @@ def _gocardless_get_token(self): | |||
# Refresh token | |||
if ( | |||
self.gocardless_refresh_token | |||
and now > self.gocardless_refresh_expiration | |||
and now < self.gocardless_refresh_expiration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedrobaeza refresh_token can be used if it is still valid, else, you should use "create new token".
): | ||
endpoint = "token/refresh" | ||
request_data = {"refresh": self.gocardless_refresh_token} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you use "refresh" and not 'create new' you can update openbanking authorization vith the valid refresh token, else, create new.
Correction of the endpoint token/refresh request datas that were not correctly set up, this request expects the refresh token but not the secret_id and secret_key.
Plus the behavior of the _gocardless_get_token method was calling the endpoint "token/new" instead of "token/refresh" in case of a non expired refresh token.