public static DTO.BIM.SelectBankByIdRequest ParseSelectBankRequest(SelectBankRequest request) { if(request !=null && request.Bank !=null) { return new DTO.BIM.SelectBankByIdRequest() { bank_id = request.Bank.Id }; } return null; }
public Task<SelectBankResponse> SelectBank(SelectBankRequest request) { try { var accessToken = request != null && request.Credentials != null ? request.Credentials.AccessToken : null; var bimRequest = ECashToApiConverter.ParseSelectBankRequest(request); var bimService = RestService.For<IBIMService>(Constants.CLIENT_URI); var bankResponse = bimService.SelectBankByIdAsync(accessToken, bimRequest).Result; var response = ApiToECashConverter.ParseSelectBank(bankResponse); return Task.FromResult(response); } catch (Exception e) { return Task.FromResult<SelectBankResponse>(new SelectBankResponse() { Result = CommonFunction.ParseException(e) }); } }