After the refactoring in #686, this doesn't work anymore:
- The API URL didn't end in "/", so the join_url doesn't do correctly
the join.
- There's an infinite loop when getting the headers for getting the
token.
It is possible that, when making the request to the requisitions endpoint,
the IBAN bank account comes with a lower alphanumeric string.
When comparing with the sanitized bank account (stored with upper) fails.
self.journal_id.bank_account_id.sanitized_acc_number == account_data["iban"]
to
self.journal_id.bank_account_id.sanitized_acc_number == account_data["iban"].upper()
Refactor method _gocardless_finish_requisition to be able to mock the requests made inside and create a unit test.
Refactor requests methods.
Some banks only allow one credentials, while others work better with
separate ones, so it's a matter of trying. This commit introduces
a wizard for choosing one method or the other.
TT48828
It turns out that the timeout is for receiving whole answer, so in real
tests, the previous timeout was not enough for getting the answer when
there are some transactions load (like a month).
Let's increase this timeout then to a reasonable amount.
Check if there's another provider already linked for the same bank
institution, and if so, reuse it for this bank account, as some banks
don't allow several requisitions from the same source (GoCardless).
TT47944
Since one week ago, banks like Sabadell is sending the information in
the JSON list `remittanceInformationUnstructuredArray` instead of
`remittanceInformationUnstructured`.
Thus, we need to parse both for finding the proper element. For the rest
that are using the previous one, there's no change.
TT47491
If the bank account is shared across multiple companies (no assigned company_id),
we can't launch the "Select Bank Account Identifier" wizard, so we fallback
to the journal company for getting the country.
TT43849
Not all banks provide an entry reference or transaction ID, so we need
to fallback to the Gocardless internal ID for getting the unique ID
in such cases.
TT46640
This module provides online bank statements from GoCardless Bank Account
Data, which provides a free API for connecting and getting transactions
for bank accounts.
TT45760
Co-Authored-By: Christopher Ormaza <chris.ormaza@forgeflow.com>
Co-Authored-By: Jordi Ballester <jordi.ballester@forgeflow.com>