From b95077ffae7487d7509c0018bff9327a085d8c03 Mon Sep 17 00:00:00 2001 From: Sylvie Ye Date: Wed, 2 Sep 2020 18:23:01 +0200 Subject: [PATCH] capabilities.bank.transfer: add new CapTransfer attributes Add theses 2 new attributes in order to be more explicite about transfer behavior: * can_initiate_transfer_to_untrusted_beneficiary: the module can do transfer to untrusted beneficiary, for example: when module can't add new beneficiary without doing a transfer like n26 or when module can do transfer to a beneficiary not listed in `iter_transfer_recipients` like for PSD2 modules * can_initiate_transfer_without_emitter: the module can do transfer without giving it the emitter, for example: there is only, and will be only, one account like wallet or when the module can initiate transfer without emitter and the emitter is chosen afterwards like for PSD2 modules --- weboob/capabilities/bank/transfer.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/weboob/capabilities/bank/transfer.py b/weboob/capabilities/bank/transfer.py index 25da53ea55..91b6e238db 100644 --- a/weboob/capabilities/bank/transfer.py +++ b/weboob/capabilities/bank/transfer.py @@ -307,8 +307,23 @@ class Emitter(BaseAccount): class CapTransfer(Capability): - accepted_beneficiary_types = (BeneficiaryType.RECIPIENT, ) + can_do_transfer_to_untrusted_beneficiary = False + """ + The module can do transfer to untrusted beneficiary, for example: + when module can't add new beneficiary without doing a transfer like n26 + or when module can do transfer to a beneficiary not listed + in `iter_transfer_recipients` like for PSD2 modules + """ + can_do_transfer_without_emitter = False + """ + The module can do transfer without giving the emitter, for example: + when there is only, and will be only, one account like wallet + or when the module can initiate transfer without emitter + and the emitter is chosen afterwards like for PSD2 modules + """ + + accepted_beneficiary_types = (BeneficiaryType.RECIPIENT, ) accepted_execution_date_types = (TransferDateType.FIRST_OPEN_DAY, TransferDateType.DEFERRED) def iter_transfer_recipients(self, account): -- GitLab