public Task<Enrollment> SelectBankAccount(SelectBankAccountRequest request) { try { var accessToken = request != null && request.Credentials != null ? request.Credentials.AccessToken : null; var bimRequest = ECashToApiConverter.ParseSelectAccountRequest(request); var bimService = RestService.For<IBIMService>(Constants.CLIENT_URI); var accountResponse = bimService.SelectBankByGUIDAsync(accessToken, bimRequest).Result; var response = ApiToECashConverter.ParseEnrollment(accountResponse); return Task.FromResult(response); } catch (Exception e) { return Task.FromResult<Enrollment>(new Enrollment() { Result = CommonFunction.ParseException(e) }); } }
public static DTO.BIM.SelectBankByGUIDRequest ParseSelectAccountRequest(SelectBankAccountRequest request) { return new DTO.BIM.SelectBankByGUIDRequest() { bankaccount_guid = request !=null && request.Account !=null ? request.Account.Guid : null }; }