Skip to content
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

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

arpol-dev
Copy link
Contributor

@arpol-dev arpol-dev commented Dec 14, 2024

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.

…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
@arpol-dev
Copy link
Contributor Author

@pedrobaeza @njeudy
Could one of you review this PR ?
I don't know what to do with the codecov fails :/
Happy new year and thank you !

Copy link

@njeudy njeudy left a 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
Copy link
Member

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.

Copy link

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}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants