The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

Commit 675ce763 authored by Florent Viard's avatar Florent Viard Committed by Vincent A

[creditmutuel] Reworked addrecipient and transfer otp handling to be more...

[creditmutuel] Reworked addrecipient and transfer otp handling to be more reliable and to support sms otp for transfer
parent e438b112
This diff is collapsed.
......@@ -117,7 +117,7 @@ def new_recipient(self, recipient, **params):
return self.browser.new_recipient(recipient, **params)
def init_transfer(self, transfer, **params):
if {'Clé', 'resume'} & set(params.keys()):
if {'Clé', 'resume', 'code'} & set(params.keys()):
return self.browser.continue_transfer(transfer, **params)
# There is a check on the website, transfer can't be done with too long reason.
......
......@@ -2073,6 +2073,12 @@ def needs_personal_key_card_validation(self):
def needs_otp_validation(self):
return bool(self.doc.xpath('//input[@name="otp_password"]'))
def get_transfer_code_form(self):
form = self.get_form(id='P:F')
code_form = dict(form.items())
code_form['url'] = form.url
return code_form
def can_transfer_pro(self, origin_account):
for li in self.doc.xpath('//ul[@id="idDetailsListCptDebiterVertical:ul"]//ul/li'):
if CleanText(li.xpath('.//span[@class="_c1 doux _c1"]'), replace=[(' ', '')])(self) in origin_account:
......@@ -2201,7 +2207,19 @@ def get_transfer_webid(self):
parsed = urlparse(self.url)
return parse_qs(parsed.query)['_saguid'][0]
def handle_response(self, account, recipient, amount, reason, exec_date):
def handle_response_reuse_transfer(self, transfer):
self.check_errors()
exec_date, r_amount, currency = self.check_data_consistency(
transfer.account_id, transfer.recipient_id, transfer.amount, transfer.label)
transfer.exec_date = exec_date
transfer.amount = r_amount
transfer.currency = currency
return transfer
def handle_response_create_transfer(self, account, recipient, amount, reason, exec_date):
self.check_errors()
self.check_success()
......
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