Commit b95077ff authored by Sylvie Ye's avatar Sylvie Ye Committed by Vincent A

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
parent 5f9d7581
...@@ -307,8 +307,23 @@ class Emitter(BaseAccount): ...@@ -307,8 +307,23 @@ class Emitter(BaseAccount):
class CapTransfer(Capability): 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) accepted_execution_date_types = (TransferDateType.FIRST_OPEN_DAY, TransferDateType.DEFERRED)
def iter_transfer_recipients(self, account): def iter_transfer_recipients(self, 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