Skip to content

Commit

Permalink
Merge PR #712 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Aug 9, 2024
2 parents 747c454 + 770a65a commit f5509b3
Showing 1 changed file with 5 additions and 2 deletions.
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,7 +57,9 @@ 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)(
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

0 comments on commit f5509b3

Please sign in to comment.