rexlin 4 years ago
parent ca13143060
commit 4de60e68f0
  1. 7
      ECR_N5_DLL_TestUI/MainWindow.xaml
  2. 85
      ECR_N5_DLL_TestUI/MainWindow.xaml.cs
  3. 3
      n5coredll/LogUtil.cs
  4. 92
      n5coredll/N5Core.cs
  5. 12
      n5coredll/RequestResult.cs
  6. 29
      n5coredll/RetrievalResult.cs
  7. 8
      n5coredll/SaleResult.cs
  8. 30
      n5coredll/SettleResult.cs

@ -81,7 +81,12 @@
<ComboBox x:Name="sale_currencyComboBox" SelectedIndex="0" HorizontalAlignment="Left" Margin="413,180,0,0" VerticalAlignment="Top" Width="164" Height="21" Visibility="Hidden" Grid.Column="1">
<ComboBoxItem Content="HKD"/>
<ComboBoxItem Content="MOP"/>
<ComboBoxItem Content="CNY"/>
<ComboBoxItem Content="RMB"/>
</ComboBox>
<Label x:Name="lbl_retrievalType" Content="Type : " HorizontalAlignment="Left" Margin="270,175,0,0" VerticalAlignment="Top" Height="26" Width="70" Visibility="Hidden" Grid.Column="1"/>
<ComboBox x:Name="retrievalTypeComboBox" SelectedIndex="0" HorizontalAlignment="Left" Margin="413,180,0,0" VerticalAlignment="Top" Width="164" Height="21" Visibility="Hidden" Grid.Column="1">
<ComboBoxItem Content="EPS_TXN"/>
<ComboBoxItem Content="EPS_RECAP"/>
</ComboBox>
<Label x:Name="sale_lbl_cashbackAmtTextBox" Content="Cashback Amount : " HorizontalAlignment="Left" Margin="54,176,0,0" VerticalAlignment="Top" Width="140" Height="26" Visibility="Hidden"/>
<TextBox x:Name="sale_cashbackAmtTextBox" HorizontalAlignment="Left" Height="23" Margin="197,176,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="199" Visibility="Hidden" Grid.ColumnSpan="2"/>

@ -46,6 +46,7 @@ namespace ECR_N5_DLL_TestUI
public string qrValueTextBoxValue = null;
public string ecrTxnIdTextBoxValue = null;
public string traceNoTextBoxValue = null;
public string retrievalTypeTextBoxValue = null;
public string panTextBoxValue = null;
public string authCodeTextBoxValue = null;
public string batchIdTextBoxValue = null;
@ -83,7 +84,13 @@ namespace ECR_N5_DLL_TestUI
{
InitializeComponent();
}
private string timeout = "300000";
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
{
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
private string timeout = "200000";
private void requestSaleThead()
{
if (panTextBoxValue!=null && panTextBoxValue!= "" && expDateTextBoxValue!=null && expDateTextBoxValue!="")
@ -103,7 +110,7 @@ namespace ECR_N5_DLL_TestUI
}
private void requestRetrievalThead()
{
jsonResultByThead = n5Core.requestRetrieval(ecrTxnIdTextBoxValue, traceNoTextBoxValue ,180000);
jsonResultByThead = n5Core.requestRetrieval(ecrTxnIdTextBoxValue, traceNoTextBoxValue , retrievalTypeTextBoxValue, 180000);
this.requestStrByThead = this.retrievalRequestMsg;
showResult();
}
@ -185,6 +192,8 @@ namespace ECR_N5_DLL_TestUI
print_traceNoTextBox.Visibility = Visibility.Hidden;
print_lbl_paymentAppId.Visibility = Visibility.Hidden;
print_paymentAppIdComboBox.Visibility = Visibility.Hidden;
retrievalTypeComboBox.Visibility = Visibility.Hidden;
lbl_retrievalType.Visibility = Visibility.Hidden;
sale_lbl_txnAmtTextBox.Visibility = Visibility.Visible;
sale_txnAmtTextBox.Visibility = Visibility.Visible;
@ -229,6 +238,8 @@ namespace ECR_N5_DLL_TestUI
retrieval_traceNoTextBox.Visibility = Visibility.Visible;
retrieval_lbl_paymentAppId.Visibility = Visibility.Visible;
retrieval_paymentAppIdComboBox.Visibility = Visibility.Visible;
retrievalTypeComboBox.Visibility = Visibility.Visible;
lbl_retrievalType.Visibility = Visibility.Visible;
}
else if (func.Equals("PRINT"))
{
@ -252,7 +263,8 @@ namespace ECR_N5_DLL_TestUI
retrieval_paymentAppIdComboBox.Visibility = Visibility.Hidden;
settle_lbl_paymentAppId.Visibility = Visibility.Hidden;
settle_paymentAppIdComboBox.Visibility = Visibility.Hidden;
retrievalTypeComboBox.Visibility = Visibility.Hidden;
lbl_retrievalType.Visibility = Visibility.Hidden;
print_lbl_isnTextBox.Visibility = Visibility.Visible;
print_traceNoTextBox.Visibility = Visibility.Visible;
print_lbl_paymentAppId.Visibility = Visibility.Visible;
@ -278,6 +290,8 @@ namespace ECR_N5_DLL_TestUI
retrieval_traceNoTextBox.Visibility = Visibility.Hidden;
retrieval_lbl_paymentAppId.Visibility = Visibility.Hidden;
retrieval_paymentAppIdComboBox.Visibility = Visibility.Hidden;
retrievalTypeComboBox.Visibility = Visibility.Hidden;
lbl_retrievalType.Visibility = Visibility.Hidden;
print_lbl_isnTextBox.Visibility = Visibility.Hidden;
print_traceNoTextBox.Visibility = Visibility.Hidden;
@ -307,7 +321,8 @@ namespace ECR_N5_DLL_TestUI
retrieval_traceNoTextBox.Visibility = Visibility.Hidden;
retrieval_lbl_paymentAppId.Visibility = Visibility.Hidden;
retrieval_paymentAppIdComboBox.Visibility = Visibility.Hidden;
retrievalTypeComboBox.Visibility = Visibility.Hidden;
lbl_retrievalType.Visibility = Visibility.Hidden;
print_lbl_isnTextBox.Visibility = Visibility.Hidden;
print_traceNoTextBox.Visibility = Visibility.Hidden;
print_lbl_paymentAppId.Visibility = Visibility.Hidden;
@ -370,6 +385,14 @@ namespace ECR_N5_DLL_TestUI
this.sale_paymentAppIdComboBox.Focus();
return;
}
else if (this.sale_ecrRefNoTextBox.Text != null && sale_ecrRefNoTextBox.Text.Length > 12)
{
this.requestStrByThead = "ECR Reference number is 1-12 letters or numbers.";
this.jsonResultByThead = "ECR Reference number is 1-12 letters or numbers.";
showResult();
this.sale_paymentAppIdComboBox.Focus();
return;
}
else
{
txnAmtTextBoxValue = this.sale_txnAmtTextBox.Text;
@ -396,26 +419,17 @@ namespace ECR_N5_DLL_TestUI
}
else if ("RETRIEVAL".Equals(this.thisEvent))
{
if (this.retrieval_traceNoTextBox.Text == null || "".Equals(this.retrieval_traceNoTextBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.retrieval_traceNoTextBox.Focus();
return;
}
else
{
ecrTxnIdTextBoxValue = "";
traceNoTextBoxValue = this.retrieval_traceNoTextBox.Text;
this.requestStrByThead = " EVENT_NAME : " + currEventName + "\n PAYMENT_APP_ID = " + "EPS" + "\n TRACE_NO = " + traceNoTextBoxValue;
showResult();
ecrTxnIdTextBoxValue = "";
traceNoTextBoxValue = this.retrieval_traceNoTextBox.Text;
retrievalTypeTextBoxValue = this.retrievalTypeComboBox.Text;
this.requestStrByThead = " EVENT_NAME : " + currEventName + "\n PAYMENT_APP_ID = " + "EPS" + "\n TRACE_NO = " + traceNoTextBoxValue + "\n RETRIEVAL_TYPE = " + retrievalTypeTextBoxValue; ;
showResult();
//jsonResultByThead = n5Core.requestRetrieval(ecrTxnIdTextBoxValue, 180000);
this.retrievalRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestRetrievalThead);
th.Start();
//jsonResultByThead = n5Core.requestRetrieval(ecrTxnIdTextBoxValue, 180000);
this.retrievalRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestRetrievalThead);
th.Start();
}
}
else if ("SETTLE".Equals(this.thisEvent))
{
@ -438,24 +452,13 @@ namespace ECR_N5_DLL_TestUI
}
else if ("PRINT".Equals(this.thisEvent))
{
if (this.print_traceNoTextBox.Text == null || "".Equals(this.print_traceNoTextBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.print_traceNoTextBox.Focus();
return;
}
else
{
traceNoTextBoxValue = this.retrieval_traceNoTextBox.Text;
this.requestStrByThead = " EVENT_NAME : " + currEventName + "\n PAYMENT_APP_ID = " + "EPS" + "\n TRACE_NO = " + traceNoTextBoxValue;
showResult();
//jsonResultByThead = n5Core.sendReprintRequest();
this.reprintRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestReprintThead);
th.Start();
}
traceNoTextBoxValue = this.print_traceNoTextBox.Text;
this.requestStrByThead = " EVENT_NAME : " + currEventName + "\n PAYMENT_APP_ID = " + "EPS" + "\n TRACE_NO = " + traceNoTextBoxValue;
showResult();
//jsonResultByThead = n5Core.sendReprintRequest();
this.reprintRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestReprintThead);
th.Start();
}
else
{

@ -38,7 +38,8 @@ namespace n5coredll
{
try
{
String path = mLogPath + getCurLogFile();
//String path = mLogPath + getCurLogFile();
String path = System.IO.Path.GetTempPath() + "\\myN5TestWin.log";
//path = @"C:\Users\rexli\AppData\Local\Temp\test.log";
if (!File.Exists(path))
{

@ -34,7 +34,7 @@ namespace n5coredll
private static String STATUS_SUCC = "00";
private static String STATUS_NO_TXN = "13";
private static String ERR_STATUS_BUSY = "98";
private static String ERR_STATUS_BUSY = "104";
private static String ERR_STATUS_PARAM = "100";
private static String ERR_STATUS_SYSTEM = "101";
private static String ERR_STATUS_OPENCOM = "102";
@ -166,6 +166,12 @@ namespace n5coredll
if (ifBusy)
return RequestResult.createRespErrJson("SALE_RESP", ERR_STATUS_BUSY);
ifBusy = true;
if ("ECR timeout".Equals(sendInnerLinkTestRequest())){
return RequestResult.createRespErrJson("SALE_RESP", ERR_STATUS_OPENCOM);
}
SaleResult saleResult = null;
decimal txnAmt = decimal.Parse(dtxnAmt);
decimal tipAmt = decimal.Parse(dtipAmt);
@ -266,6 +272,7 @@ namespace n5coredll
closeSerialPort();
if (currResultJsonStr != null && !"".Equals(currResultJsonStr))
{
LogUtil.getInstance().addRepeatLog("Received result:" + currResultJsonStr);
ifBusy = false;
currResultJsonStr = SaleResult.rebuildSaleRespMsg(currResultJsonStr);
return currResultJsonStr;
@ -300,6 +307,73 @@ namespace n5coredll
{
closeSerialPort();
ifBusy = false;
LogUtil.getInstance().addRepeatLog("Received result:" + currResultJsonStr);
return RequestResult.createRespErrJson("ECHO_RESP", ERR_STATUS_PARAM);
//return "Request failed: params error";
}
Console.WriteLine("currReqByteArr = " + currReqByteArr);
Console.WriteLine("currReqByteArr.Length = " + currReqByteArr.Length);
this.sendReqMsg();
}
else
{
closeSerialPort();
ifBusy = false;
return RequestResult.createRespErrJson("ECHO_RESP", ERR_STATUS_OPENCOM);
}
int sleepTime = linkTimeout / 1000;
DateTime startTime = DateTime.Now;
Boolean ifEnd = false;
while (!ifEnd)
{
DateTime nowTime = DateTime.Now;
TimeSpan sp = nowTime - startTime;
if (sp.TotalSeconds > sleepTime)
ifEnd = true;
else
{
if (!isSending && !isGetACK)
this.resendReqMsg();
if (isReadyBack)
{
closeSerialPort();
if (currResultJsonStr != null && !"".Equals(currResultJsonStr))
{
ifBusy = false;
return currResultJsonStr;
}
}
}
}
ifBusy = false;
Console.WriteLine("Timeout return : " + DateTime.Now.ToString());
closeSerialPort();
return RequestResult.createRespErrJson("ECHO_RESP", ERR_STATUS_TIMEOUT);
}
private string sendInnerLinkTestRequest()
{
sendTime = 0;
isSending = false;
mRecvTimes = 0;
isReadyBack = false;
currReqByteArr = null;
currResultJsonStr = null;
RequestResult reqResult = null;
isGetACK = false;
if (openSerialPort())
{
currReqByteArr = this.packReqMsg(RequestResult.toJsonForLinkTest());
if (currReqByteArr == null || currReqByteArr.Length == 0)
{
closeSerialPort();
ifBusy = false;
LogUtil.getInstance().addRepeatLog("Received result:" + currResultJsonStr);
return RequestResult.createRespErrJson("ECHO_RESP", ERR_STATUS_PARAM);
//return "Request failed: params error";
}
@ -403,6 +477,7 @@ namespace n5coredll
closeSerialPort();
if (currResultJsonStr != null && !"".Equals(currResultJsonStr))
{
LogUtil.getInstance().addRepeatLog("Received result:" + currResultJsonStr);
currResultJsonStr = SettleResult.rebuildSettleRespMsg(currResultJsonStr);
ifBusy = false;
return currResultJsonStr;
@ -416,16 +491,11 @@ namespace n5coredll
return RequestResult.createRespErrJson("SETTLE_RESP", ERR_STATUS_TIMEOUT);
}
public string requestRetrieval(string txnId, string traceNo, int pTimeOut)
public string requestRetrieval(string txnId, string traceNo, string type, int pTimeOut)
{
if (ifBusy)
return RequestResult.createRespErrJson("SETTLE_RESP", ERR_STATUS_BUSY);
RetrievalResult retrievalResult = null;
if (txnId == null)
{
Console.WriteLine("parameter error");
closeSerialPort();
//return "Request failed: params error";
return RequestResult.createRespErrJson("RETRIEVAL_RESP", ERR_STATUS_PARAM);
}
sendTime = 0;
isSending = false;
@ -437,7 +507,7 @@ namespace n5coredll
if (openSerialPort())
{
string reqRetrievalStr = RetrievalResult.toJsonForRetrieval(txnId, traceNo);
string reqRetrievalStr = RetrievalResult.toJsonForRetrieval(txnId, traceNo, type);
Console.WriteLine("reqRetrievalStr = " + reqRetrievalStr);
if (reqRetrievalStr == null || "".Equals(reqRetrievalStr))
{
@ -450,6 +520,7 @@ namespace n5coredll
{
Console.WriteLine("currReqByteArr is null. ");
closeSerialPort();
LogUtil.getInstance().addRepeatLog("Received result:" + currResultJsonStr);
return RequestResult.createRespErrJson("RETRIEVAL_RESP", ERR_STATUS_PARAM);
}
@ -648,6 +719,7 @@ namespace n5coredll
{
closeSerialPort();
ifBusy = false;
LogUtil.getInstance().addRepeatLog("Received result:" + currResultJsonStr);
return RequestResult.createRespErrJson("PRINT_RESP", ERR_STATUS_PARAM);
//return "Request failed: params error";
}

@ -50,7 +50,8 @@ namespace n5coredll
result = "{\"EVENT_NAME\":\"PRINT\",\"PAYMENT_APP_ID\":\"EPS\",\"TXN_ID\":\"" + txnId + "\",\"IS_REPRINT\":" + reprintStr + "}";
else if (traceNo != "" && txnId == "")
result = "{\"EVENT_NAME\":\"PRINT\",\"PAYMENT_APP_ID\":\"EPS\",\"TRACE_NO\":\"" + traceNo + "\",\"IS_REPRINT\":" + reprintStr + "}";
else
result = "{\"EVENT_NAME\":\"PRINT\",\"PAYMENT_APP_ID\":\"EPS\",\"IS_REPRINT\":" + reprintStr + "}";
return result;
}
@ -115,7 +116,14 @@ namespace n5coredll
public static String createRespErrJson(String eventName, String status)
{
return "{\"EVENT_NAME\":\"" +eventName + "\",\"STATUS\":\"" + status + "\"}";
if (status.Equals("102"))
return "ECR Comm Error";
if (status.Equals("103"))
return "ECR timeout";
if (status.Equals("104"))
return "Comm Busy";
else
return "{\"EVENT_NAME\":\"" +eventName + "\",\"STATUS\":\"" + status + "\"}";
}
}

@ -370,13 +370,13 @@ namespace n5coredll
this.setStatus(pStatus);
}
public static string toJsonForRetrieval(string txnId, string traceNo) {
public static string toJsonForRetrieval(string txnId, string traceNo, string type) {
if (txnId == null) {
Console.WriteLine("txnId is null ");
return null;
}
string cardSaleMsg = "{\"EVENT_NAME\":\"RETRIEVAL\",\"TXN_ID\":\"" + txnId + "\",\"PAYMENT_APP_ID\":\"EPS\",\"TRACE_NO\":\"" + traceNo + "\"}";
string cardSaleMsg = "{\"EVENT_NAME\":\"RETRIEVAL\",\"TXN_ID\":\"" + txnId + "\",\"PAYMENT_APP_ID\":\"EPS\",\"TRACE_NO\":\"" + traceNo + "\",\"RETRIEVAL_TYPE\":\"" + type + "\"}";
return cardSaleMsg;
}
@ -552,11 +552,15 @@ namespace n5coredll
StringBuilder sb = new StringBuilder("");
sb.Append("{");
sb.Append("\"EVENT_NAME\":\"" + tmp.GetValue("EVENT_NAME") + "\",");
sb.Append("\"TXN_TYPE\":\"" + tmp.GetValue("TXN_TYPE") + "\",");
sb.Append("\"TXN_ID\":\"" + tmp.GetValue("TXN_ID") + "\",");
if (tmp.GetValue("TXN_TYPE") != null)
sb.Append("\"TXN_TYPE\":\"" + tmp.GetValue("TXN_TYPE") + "\",");
if (tmp.GetValue("TXN_ID") != null)
sb.Append("\"TXN_ID\":\"" + tmp.GetValue("TXN_ID") + "\",");
sb.Append("\"STATUS\":\"" + tmp.GetValue("STATUS") + "\",");
sb.Append("\"TXN_STATUS\":\"" + tmp.GetValue("TXN_STATUS") + "\",");
sb.Append("\"TXN_AMT\":" + tmp.GetValue("TXN_AMT") + ",");
if (tmp.GetValue("TXN_STATUS") != null)
sb.Append("\"TXN_STATUS\":\"" + tmp.GetValue("TXN_STATUS") + "\",");
if (tmp.GetValue("TXN_AMT") != null)
sb.Append("\"TXN_AMT\":" + tmp.GetValue("TXN_AMT") + ",");
if (tmp.GetValue("CASHBACK_AMT") != null)
sb.Append("\"CASHBACK_AMT\":" + tmp.GetValue("CASHBACK_AMT") + ",");
if (tmp.GetValue("PAYMENT_TYPE") != null)
@ -566,6 +570,8 @@ namespace n5coredll
sb.Append("\"RESP_CODE\":\"" + tmp.GetValue("RESP_CODE") + "\",");
if (tmp.GetValue("RESPONSE_TEXT") != null)
sb.Append("\"RESPONSE_TEXT\":\"" + tmp.GetValue("RESPONSE_TEXT") + "\",");
else
sb.Append("\"RESPONSE_TEXT\":\"\",");
if (tmp.GetValue("TRACE_NO") != null)
sb.Append("\"TRACE_NO\":\"" + tmp.GetValue("TRACE_NO") + "\",");
if (tmp.GetValue("TXN_DATE") != null)
@ -578,10 +584,10 @@ namespace n5coredll
sb.Append("\"TID\":\"" + tmp.GetValue("TID") + "\",");
if (tmp.GetValue("PAN") != null)
sb.Append("\"PAN\":\"" + tmp.GetValue("PAN") + "\",");
if (tmp.GetValue("ENTRYMODE") != null)
sb.Append("\"ENTRYMODE\":\"" + tmp.GetValue("PAN") + "\",");
if (tmp.GetValue("ENTRY_MODE") != null)
sb.Append("\"ENTRYMODE\":\"" + tmp.GetValue("ENTRY_MODE") + "\",");
if (tmp.GetValue("AC_INDICATOR") != null)
sb.Append("\"AC_INDICATOR\":\"" + tmp.GetValue("PAN") + "\",");
sb.Append("\"AC_INDICATOR\":\"" + tmp.GetValue("AC_INDICATOR") + "\",");
if (tmp.GetValue("AID") != null)
sb.Append("\"AID\":\"" + tmp.GetValue("AID") + "\",");
if (tmp.GetValue("TC") != null)
@ -596,6 +602,11 @@ namespace n5coredll
sb.Append("\"ACCOUNT_NO\":\"" + tmp.GetValue("ACCOUNT_NO") + "\",");
if (tmp.GetValue("BANK_ADDITIONAL_RESPONSE") != null)
sb.Append("\"BANK_ADDITIONAL_RESPONSE\":\"" + tmp.GetValue("BANK_ADDITIONAL_RESPONSE") + "\"");
if (tmp.GetValue("HOST_COUNT") != null)
sb.Append("\"HOST_COUNT\":" + tmp.GetValue("HOST_COUNT") + ",");
if (tmp.GetValue("HOST_AMT") != null)
sb.Append("\"HOST_AMT\":" + tmp.GetValue("HOST_AMT") + ",");
sb.Append("}");
return sb.ToString();

@ -549,6 +549,8 @@ namespace n5coredll
sb.Append("\"RESP_CODE\":\"" + tmp.GetValue("RESP_CODE") + "\",");
if (tmp.GetValue("RESPONSE_TEXT") != null)
sb.Append("\"RESPONSE_TEXT\":\"" + tmp.GetValue("RESPONSE_TEXT") + "\",");
else
sb.Append("\"RESPONSE_TEXT\":\"\",");
if (tmp.GetValue("TRACE_NO") != null)
sb.Append("\"TRACE_NO\":\"" + tmp.GetValue("TRACE_NO") + "\",");
if (tmp.GetValue("TXN_DATE") != null)
@ -561,10 +563,10 @@ namespace n5coredll
sb.Append("\"TID\":\"" + tmp.GetValue("TID") + "\",");
if (tmp.GetValue("PAN") != null)
sb.Append("\"PAN\":\"" + tmp.GetValue("PAN") + "\",");
if (tmp.GetValue("ENTRYMODE") != null)
sb.Append("\"ENTRYMODE\":\"" + tmp.GetValue("PAN") + "\",");
if (tmp.GetValue("ENTRY_MODE") != null)
sb.Append("\"ENTRYMODE\":\"" + tmp.GetValue("ENTRY_MODE") + "\",");
if (tmp.GetValue("AC_INDICATOR") != null)
sb.Append("\"AC_INDICATOR\":\"" + tmp.GetValue("PAN") + "\",");
sb.Append("\"AC_INDICATOR\":\"" + tmp.GetValue("AC_INDICATOR") + "\",");
if (tmp.GetValue("AID") != null)
sb.Append("\"AID\":\"" + tmp.GetValue("AID") + "\",");
if (tmp.GetValue("TC") != null)

@ -428,7 +428,10 @@ namespace n5coredll
sb.Append("\"EVENT_NAME\":\"" + jsonObj.GetValue("EVENT_NAME") + "\",");
sb.Append("\"STATUS\":\"" + jsonObj.GetValue("STATUS") + "\",");
sb.Append("\"RESP_CODE\":\"" + jsonObj.GetValue("RESP_CODE") + "\",");
sb.Append("\"RESPONSE_TEXT\":\"" + jsonObj.GetValue("RESPONSE_TEXT") + "\",");
if (jsonObj.GetValue("RESPONSE_TEXT") != null)
sb.Append("\"RESPONSE_TEXT\":\"" + jsonObj.GetValue("RESPONSE_TEXT") + "\",");
else
sb.Append("\"RESPONSE_TEXT\":");
sb.Append("\"TXN_DATE\":\"" + jsonObj.GetValue("TXN_DATE") + "\",");
sb.Append("\"TXN_TIME\":\"" + jsonObj.GetValue("TXN_TIME") + "\",");
sb.Append("\"MID\":\"" + jsonObj.GetValue("MID") + "\",");
@ -448,12 +451,27 @@ namespace n5coredll
sb.Append("{");
sb.Append("\\\"BANKIN_VALUE_DATE\\\":\\\"" + tempo.GetValue("BANKIN_VALUE_DATE") + "\\\",");
sb.Append("\\\"EPS_TOTAL_COUNT\\\":\\\"" + tempo.GetValue("EPS_TOTAL_COUNT") + "\\\",");
if (tempo.GetValue("CASHBACK_COUNT") != null && tempo.GetValue("PURCHASE_COUNT") != null)
if (tempo.GetValue("CASHBACK_COUNT") != null)
{
sb.Append("\\\"EPS_TOTAL_AMT\\\":\\\"" + tempo.GetValue("EPS_TOTAL_AMT") + "\\\",");
sb.Append("\\\"CASHBACK_COUNT\\\":\\\"" + tempo.GetValue("CASHBACK_COUNT") + "\\\",");
sb.Append("\\\"CASHBACK_AMT\\\":\\\"" + tempo.GetValue("CASHBACK_AMT") + "\\\",");
sb.Append("\\\"PURCHASE_COUNT\\\":\\\"" + tempo.GetValue("PURCHASE_COUNT") + "\\\"");
if (tempo.GetValue("EPS_TOTAL_AMT") != null) {
sb.Append("\\\"EPS_TOTAL_AMT\\\":\\\"" + tempo.GetValue("EPS_TOTAL_AMT") + "\\\",");
}
if (tempo.GetValue("CASHBACK_COUNT") != null)
{
sb.Append("\\\"CASHBACK_COUNT\\\":\\\"" + tempo.GetValue("CASHBACK_COUNT") + "\\\",");
}
if (tempo.GetValue("CASHBACK_AMT") != null)
{
sb.Append("\\\"CASHBACK_AMT\\\":\\\"" + tempo.GetValue("CASHBACK_AMT") + "\\\",");
}
if (tempo.GetValue("PURCHASE_COUNT") != null)
{
sb.Append("\\\"PURCHASE_COUNT\\\":\\\"" + tempo.GetValue("PURCHASE_COUNT") + "\\\"");
}
if (tempo.GetValue("PURCHASE_AMT") != null)
{
sb.Append("\\\"PURCHASE_AMT\\\":\\\"" + tempo.GetValue("PURCHASE_AMT") + "\\\"");
}
}
else
{

Loading…
Cancel
Save