Skip to content

Commit

Permalink
Fix - Correction de l'assignation d'un IBAN via Manage
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmugnier committed Nov 26, 2020
1 parent b5b50b9 commit 9eab1c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public async Task<Result<bool>> Handle(UpdateBankAccountCommand request, Cancell
return Failed<bool>(resetResult.Exception);
bankAccount.SetIdentifier(string.Empty);
await _context.SaveChangesAsync(token);
}
bankAccount.SetAddress(address);
Expand All @@ -87,8 +88,6 @@ public async Task<Result<bool>> Handle(UpdateBankAccountCommand request, Cancell
bankAccount.SetIban(request.IBAN);
bankAccount.SetBic(request.BIC);
await _context.SaveChangesAsync(token);
var result = await _pspService.CreateBankIbanAsync(bankAccount, token);
if (!result.Success)
return Failed<bool>(result.Exception);
Expand Down
2 changes: 1 addition & 1 deletion Sheaft.Infrastructure.Services/PspService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public async Task<Result<string>> CreateBankIbanAsync(BankAccount payment, Cance
if (string.IsNullOrWhiteSpace(payment.User.Identifier))
return BadRequest<string>(MessageKind.PsP_CannotCreate_Bank_User_Not_Exists);
if (payment.Identifier.Length > 0)
if (!string.IsNullOrWhiteSpace(payment.Identifier) && payment.Identifier.Length > 0)
return BadRequest<string>(MessageKind.PsP_CannotCreate_Bank_Already_Exists);
await EnsureAccessTokenIsValidAsync(token);
Expand Down

0 comments on commit 9eab1c0

Please sign in to comment.