Commit 6d11eb5d authored by Sylvie Ye's avatar Sylvie Ye Committed by Vincent A

[hellobank] PSD2 account id are different from scraped account id

* Avoid account_id check on transfer
* Search the account by iban in iter_transfer_recipient to get the right account_id
parent 04681719
......@@ -96,7 +96,13 @@ class HelloBankModule(Module, CapBankWealth, CapBankTransferAddRecipient, CapPro
def iter_transfer_recipients(self, origin_account):
if isinstance(origin_account, Account):
origin_account = origin_account.id
emitter_account = find_object(self.iter_accounts(), id=origin_account.id)
if not emitter_account:
# account_id is different in PSD2 case
# search for the account with iban first to get the account_id
assert origin_account.iban, 'Cannot do iter_transfer_recipient, the origin account was not found'
emitter_account = find_object(self.iter_accounts(), iban=origin_account.iban, error=AccountNotFound)
origin_account = emitter_account.id
return self.browser.iter_recipients(origin_account)
def new_recipient(self, recipient, **params):
......@@ -138,6 +144,10 @@ class HelloBankModule(Module, CapBankWealth, CapBankTransferAddRecipient, CapPro
# iternal recipients id
return old == new
def transfer_check_account_id(self, old, new):
# don't check account id because in PSD2 case, account_id is different
return True
def iter_transfers(self, account=None):
return self.browser.iter_transfers(account)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment