private void ProcessRequest(CallbackCCG callbackCCG)
 {
     try
     {
         Console.WriteLine("Processing request #{0}", callbackCCG.ID);
         HttpClient          httpClient = new HttpClient();
         HttpResponseMessage response   = httpClient.PostAsync(Constants.Uri, new StringContent(string.Format(payloadTemplate, callbackCCG.TPCGID, callbackCCG.MSISDN), Encoding.UTF8, "text/xml")).Result;
         if (null != response)
         {
             string responseText = response.Content.ReadAsStringAsync().Result;
             if (responseText.Contains("<result>DBILL:Ok, Accepted</result>"))
             {
                 BillingService.Instance.LogCallbackCCG(callbackCCG);
                 BillingService.Instance.DeleteCallbackCCG(callbackCCG.ID);
             }
             else
             {
                 LogService.Instance.LogWarning(MethodBase.GetCurrentMethod(), "The response indicated a failure", new { callbackCCG, responseText });
             }
         }
         else
         {
             LogService.Instance.LogWarning(MethodBase.GetCurrentMethod(), "The response turned out null", new { callbackCCG });
         }
     }
     catch (Exception e)
     {
         LogService.Instance.LogError(MethodBase.GetCurrentMethod(), e);
     }
 }
示例#2
0
 public bool LogCallbackCCG(CallbackCCG callbackCCG)
 {
     try
     {
         return(BillingRepository.Instance.LogCallbackCCG(callbackCCG));
     }
     catch (Exception e)
     {
         LogService.Instance.LogError(MethodBase.GetCurrentMethod(), e, new { callbackCCG });
         return(false);
     }
 }
 public bool LogCallbackCCG(CallbackCCG callbackCCG)
 {
     try
     {
         return(0 != dbConnection.Execute("usp_CallbackCCGLogs_Insert", new { callbackCCG.MSISDN, callbackCCG.Result, callbackCCG.Reason, callbackCCG.ProductId, callbackCCG.TransID, callbackCCG.TPCGID, callbackCCG.Songname }, commandType: CommandType.StoredProcedure));
     }
     catch (Exception e)
     {
         LogService.Instance.LogError(MethodBase.GetCurrentMethod(), e, new { callbackCCG });
         return(false);
     }
 }