public async Task <SendDataLoginResponse> SendDataLoginAsync(SendDataLoginRequest sendDataLoginRequest) { ValidateRequestObject(sendDataLoginRequest); ValidateString(sendDataLoginRequest.Code, "Code"); ValidateString(sendDataLoginRequest.SessionID, "SessionId"); CanSendDataLoginClearSale(); SendDataLoginResponse sendDataLoginResponse = await _clearSaleProxy.SendDataLoginAsync(sendDataLoginRequest); return(sendDataLoginResponse); }
public async Task <SendDataLoginResponse> SendDataLoginAsync(SendDataLoginRequest sendDataLoginRequest) { //--- obter o token await GetToken(); //--- converter o objeto para json string sendDataLoginRequestJson = JsonConvert.SerializeObject(sendDataLoginRequest); //--- post BaseResponse sendDataLoginResponseJson = await HttpPostAsync($"{_urlApiAccountClearSale}/Login", sendDataLoginRequestJson, AuthenticationResponse, "SendDataLoginAsync"); //--- deserializa o json para o o objeto de retorno SendDataLoginResponse sendDataLoginResponse = JsonConvert.DeserializeObject <SendDataLoginResponse> (sendDataLoginResponseJson.Contents); //--- retorna return(sendDataLoginResponse); }
public async Task <ActionResult> SendDataLoginAsync([FromBody] SendDataLoginRequest sendDataLoginRequest) { SendDataLoginResponse sendDataLoginResponse = await _clearSaleService.SendDataLoginAsync(sendDataLoginRequest); return(this.Ok(sendDataLoginResponse)); }