Commit f5ee8a96 authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[bnp] 'idBeneficiaire' is not stable, change recipient id

use iban as id for external recipient
parent 4e666e97
......@@ -404,7 +404,7 @@ class BNPParibasBrowser(JsonBrowserMixin, LoginBrowser):
add recipient with sms otp authentication
"""
data = {}
data['idBeneficiaire'] = recipient.id
data['idBeneficiaire'] = recipient._transfer_id
data['typeActivation'] = 1
data['codeActivation'] = params['code']
return self.activate_recip_sms.go(data=json.dumps(data), headers={'Content-Type': 'application/json'}).get_recipient(recipient)
......@@ -422,7 +422,7 @@ class BNPParibasBrowser(JsonBrowserMixin, LoginBrowser):
# prepare data for polling
assert recipient._id_transaction
polling_data = {}
polling_data['idBeneficiaire'] = recipient.id
polling_data['idBeneficiaire'] = recipient._transfer_id
polling_data['idTransaction'] = recipient._id_transaction
polling_data['typeActivation'] = 2
......@@ -452,7 +452,7 @@ class BNPParibasBrowser(JsonBrowserMixin, LoginBrowser):
data['montant'] = str(amount)
data['typeVirement'] = 'SEPA'
if recipient.category == u'Externe':
data['idBeneficiaire'] = recipient.id
data['idBeneficiaire'] = recipient._transfer_id
else:
data['compteCrediteur'] = recipient.id
return data
......
......@@ -403,9 +403,9 @@ class RecipientsPage(BNPPage):
# For the moment, only yield ready to transfer on recipients.
condition = lambda self: Dict('libelleStatut')(self.el) in [u'Activé', u'Temporisé', u'En attente']
obj_id = Dict('idBeneficiaire')
obj_id = obj_iban = Dict('ibanNumCompte')
obj__transfer_id = Dict('idBeneficiaire')
obj_label = Dict('nomBeneficiaire')
obj_iban = Dict('ibanNumCompte')
obj_category = u'Externe'
obj__web_state = Dict('libelleStatut')
......@@ -440,7 +440,7 @@ class ValidateTransferPage(BNPPage):
self.abort_if_unknown(transfer_data)
if 'idBeneficiaire' in transfer_data and transfer_data['idBeneficiaire'] is not None:
assert transfer_data['idBeneficiaire'] == recipient.id
assert transfer_data['idBeneficiaire'] == recipient._transfer_id
elif transfer_data.get('ibanCompteCrediteur'):
assert transfer_data['ibanCompteCrediteur'] == recipient.iban
......
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