Skip to content

Commit

Permalink
Merge pull request #567 from OCA/16.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/bank-statement-import (16.0)
  • Loading branch information
bt-admin authored Aug 11, 2024
2 parents 4443c34 + cba0c8e commit 3814973
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ addon | version | maintainers | summary
[account_statement_import_file_reconcile_oca](account_statement_import_file_reconcile_oca/) | 16.0.1.0.0 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) | Import Statement Files and Go Direct to Reconciliation
[account_statement_import_ofx](account_statement_import_ofx/) | 16.0.1.0.0 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) | Import OFX Bank Statement
[account_statement_import_online](account_statement_import_online/) | 16.0.1.3.0 | [![alexey-pelykh](https://github.com/alexey-pelykh.png?size=30px)](https://github.com/alexey-pelykh) | Online bank statements update
[account_statement_import_online_gocardless](account_statement_import_online_gocardless/) | 16.0.1.2.0 | | Online Bank Statements: GoCardless
[account_statement_import_online_gocardless](account_statement_import_online_gocardless/) | 16.0.1.2.2 | | Online Bank Statements: GoCardless
[account_statement_import_online_ofx](account_statement_import_online_ofx/) | 16.0.1.0.0 | | Online bank statements for OFX
[account_statement_import_online_paypal](account_statement_import_online_paypal/) | 16.0.1.0.1 | [![alexey-pelykh](https://github.com/alexey-pelykh.png?size=30px)](https://github.com/alexey-pelykh) | Online bank statements for PayPal.com
[account_statement_import_online_ponto](account_statement_import_online_ponto/) | 16.0.1.1.1 | | Online Bank Statements: MyPonto.com
Expand Down
2 changes: 1 addition & 1 deletion account_statement_import_online_gocardless/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Online Bank Statements: GoCardless
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7ab70d9d2a3900c480451072d76c9af5c6b540c14c5d8a4f60c3e38ca19134da
!! source digest: sha256:0e3cd4e57d7adb1850bd315606ddd9458fdf43215971c8026d272b0df2df08d4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion account_statement_import_online_gocardless/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Online Bank Statements: GoCardless",
"version": "16.0.1.2.0",
"version": "16.0.1.2.2",
"category": "Account",
"website": "https://github.com/OCA/bank-statement-import",
"author": "ForgeFlow, Tecnativa, Odoo Community Association (OCA)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from odoo.exceptions import UserError
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT as DF

GOCARDLESS_API = "https://bankaccountdata.gocardless.com/api/v2"
GOCARDLESS_API = "https://bankaccountdata.gocardless.com/api/v2/"
REQUESTS_TIMEOUT = 60


Expand Down Expand Up @@ -57,14 +57,16 @@ def _gocardless_get_headers(self, basic=False):
headers["Authorization"] = f"Bearer {self._gocardless_get_token()}"
return headers

def _gocardless_request(self, endpoint, request_type="get", params=None, data=None):
def _gocardless_request(
self, endpoint, request_type="get", params=None, data=None, basic_auth=False
):
content = {}
url = url_join(GOCARDLESS_API, endpoint)
response = getattr(requests, request_type)(
url,
data=data,
params=params,
headers=self._gocardless_get_headers(),
headers=self._gocardless_get_headers(basic=basic_auth),
timeout=REQUESTS_TIMEOUT,
)
if response.status_code in [200, 201]:
Expand Down Expand Up @@ -93,6 +95,7 @@ def _gocardless_get_token(self):
data=json.dumps(
{"secret_id": self.username, "secret_key": self.password}
),
basic_auth=True,
)
expiration_date = now + relativedelta(seconds=data.get("access_expires", 0))
vals = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Online Bank Statements: GoCardless</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7ab70d9d2a3900c480451072d76c9af5c6b540c14c5d8a4f60c3e38ca19134da
!! source digest: sha256:0e3cd4e57d7adb1850bd315606ddd9458fdf43215971c8026d272b0df2df08d4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/bank-statement-import/tree/16.0/account_statement_import_online_gocardless"><img alt="OCA/bank-statement-import" src="https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_online_gocardless"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/bank-statement-import&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module provides online bank statements from GoCardless Bank Account Data,
Expand Down

0 comments on commit 3814973

Please sign in to comment.