public async Task <EkycTxModel> GeteKycLink(EkycTxModel ekycTxModel) { TransactionKeyRequestModel txKeyReq = new TransactionKeyRequestModel() { TransactionKey = ekycTxModel.TransactionKey }; try { var client = clientFactory.CreateClient(); StringContent content = new StringContent(JsonConvert.SerializeObject(txKeyReq), Encoding.UTF8, "application/json"); client.DefaultRequestHeaders.Add("Token", ekycTxModel.AccessToken); using var response = await client.PostAsync("http://172.20.6.226:8080/ekyc-app/api/open-camera", content); string apiResponse = await response.Content.ReadAsStringAsync(); var resModel = JsonConvert.DeserializeObject <BaseResponseModel>(apiResponse); ekycTxModel.Url = resModel.Data; } catch (Exception ex) { Debug.WriteLine(ex.Message); } return(ekycTxModel); }
public async Task <EkycResResultModel> GetFaceMatchingResult(EkycTxModel ekycTxModel) { var tranReqCamera = new TransactionKeyRequestModel(); tranReqCamera.TransactionKey = ekycTxModel.TransactionKey; EkycResResultModel responseModel = new EkycResResultModel(); try { var client = clientFactory.CreateClient(); StringContent content = new StringContent(JsonConvert.SerializeObject(tranReqCamera), Encoding.UTF8, "application/json"); client.DefaultRequestHeaders.Add("Token", ekycTxModel.AccessToken); using var response = await client.PostAsync("http://172.20.6.226:8080/ekyc-app/api/ekyc-result", content); string apiResponse = await response.Content.ReadAsStringAsync(); var resModel = JsonConvert.DeserializeObject <EkycResResultModel>(apiResponse); } catch (Exception ex) { Debug.WriteLine(ex); } return(responseModel); }