private void Approved(Models.ResponseModel.Response model)
 {
     setTransaction(content.TRANSACTION.PosID, content.TRANSACTION.ReferansID);
     setProcess("1", "Approved", model.Transaction.Identification.TransactionID.ToString(), model.Transaction.Identification.TransactionID.ToString());
     setDetail(content.ACCOUNT.Number.ToString().Substring(0, 4) + "************", content.CONTACT.Ip);
     setError(null, null);
 }
        private void Convert(Models.ResponseModel.Response model)
        {
            byte switch_on = model.Transaction.Processing.Status.code;

            switch (switch_on)
            {
            case 00: Approved(model); break; //SUCCESS*

            case 40: Decline(model); break;  //NEUTRAL---------

            case 59: Wait(model); break;     //WAITING_BANK*

            case 60: Decline(model); break;  //REJECTED_BANK*

            case 64: Wait(model); break;     //WAITING_RISK*

            case 65: Decline(model); break;  //REJECTED_RISK*

            case 70: Error(model); break;    //REJECTED_VALIDATION*

            case 80: Wait(model); break;     //WAITING*

            case 90: Approved(model); break; //NEW*

            default: Error(model); break;
            }
        }
 private void Error(Models.ResponseModel.Response model)
 {
     setTransaction(content.TRANSACTION.PosID, content.TRANSACTION.ReferansID);
     setProcess("-1", "Error", null, null);
     setDetail(content.ACCOUNT.Number.ToString().Substring(0, 4) + "************", content.CONTACT.Ip);
     setError(model.Transaction.Processing.Status.code.ToString(),
              string.Format(
                  "SV:{0} ResC:{1} ResV:{2} RetC:{3} RetV:{4}",
                  model.Transaction.Processing.Status.Value,
                  model.Transaction.Processing.Reason.code,
                  model.Transaction.Processing.Reason.Value,
                  model.Transaction.Processing.Return.code,
                  model.Transaction.Processing.Return.Value
                  ));
 }
 private void Decline(Models.ResponseModel.Response model)
 {
     setTransaction(content.TRANSACTION.PosID, content.TRANSACTION.ReferansID);
     setProcess("0", "Declined", null, null);
     setDetail(content.ACCOUNT.Number.ToString().Substring(0, 4) + "************", content.CONTACT.Ip);
     setError(model.Transaction.Processing.code,
              string.Format(
                  "{0} {1} {2} {3} {4}",
                  model.Transaction.Processing.Status.Value,
                  model.Transaction.Processing.Reason.code,
                  model.Transaction.Processing.Reason.Value,
                  model.Transaction.Processing.Return.code,
                  model.Transaction.Processing.Return.Value
                  )
              );
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 private Models.ResponseModel.Response DeserializeData(string data)
 {
     Models.ResponseModel.Response result = (Models.ResponseModel.Response)data.DeserializeObject <Models.ResponseModel.Response>();
     return(result);
 }