using Common.Helper; using Common.KFTC; using Common.Model; using Common.Model.AutoRefund; using Common.Model.KFTCRegistration; using Common.Model.KftcSendMoney; using Common.Model.SendMoney; using log4net; using System; using System.Collections.Generic; using System.Data; namespace Repository.KFTCRepository { public class KftcProcessRepository : IKftcProcessRepository { private readonly Dao _dao; private static readonly ILog Log = LogManager.GetLogger(typeof(KftcProcessRepository)); public KftcProcessRepository() { _dao = new Dao(); } public DataRow GetCustomerData(string customerId) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag = 's-refresh'"; sql += ",@customerId = " + _dao.FilterString(customerId); Log.Debug("Query : " + sql); return _dao.ExecuteDataRow(sql); } public DataTable GetAccountList(string customerId) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag = 's'"; sql += ",@customerId = " + _dao.FilterString(customerId); return _dao.ExecuteDataTable(sql); } public DataTable GetAllAccountList(string customerId) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag = 's-send'"; sql += ",@customerId = " + _dao.FilterString(customerId); return _dao.ExecuteDataTable(sql); } public DataTable GetGMECustomerList(string customerId) { var sql = "select * from dbo.FNAGetCustomerInfo(" + _dao.FilterString(customerId) + ")"; return _dao.ExecuteDataTable(sql); } public DbResult LogRequestKFTC(string user, string methodName, string requestXml, string processId = "") { if (String.IsNullOrEmpty(requestXml)) requestXml = ""; var sql = String.Format("EXEC PROC_KFTC_LOGS @flag='i', @CUSTOMERID='{0}', @methodName='{1}',@requestXml=N'{2}',@processId='{3}'", user, methodName, requestXml.Replace("'", ""), processId); return _dao.ParseDbResult(sql); } public DbResult LogRequest(string user, string providerName, string methodName, string controlNo, string requestXml, string processId = "") { if (String.IsNullOrEmpty(requestXml)) requestXml = ""; var sql = String.Format("EXEC proc_tpApiLogs @flag='i', @user='{0}', @providerName='{1}', @methodName='{2}',@controlNo='{3}',@requestXml='{4}',@processId='{5}'", user, providerName, methodName, controlNo, requestXml.Replace("'", ""), processId); return _dao.ParseDbResult(sql); } public DbResult LogResponse(string rowId, string responseXml, string tpErrorCode, string tpErrorMsg) { try { if (String.IsNullOrEmpty(responseXml)) responseXml = ""; var sql = String.Format( "EXEC proc_tpApiLogs @flag='u', @rowId='{0}',@responseXml='{1}', @errorCode='{2}', @errorMessage='{3}'", rowId, responseXml.Replace("'", ""), tpErrorCode, tpErrorMsg); return _dao.ParseDbResult(sql); } catch (Exception) { return new DbResult(); } } public DbResult LogResponseKFTC(string rowId, string responseXml, string tpErrorCode, string tpErrorMsg) { try { if (String.IsNullOrEmpty(responseXml)) responseXml = ""; var sql = String.Format( "EXEC PROC_KFTC_LOGS @flag='u', @rowId='{0}',@responseXml=N'{1}', @errorCode='{2}', @errorMessage=N'{3}'", rowId, responseXml.Replace("'", ""), tpErrorCode, tpErrorMsg); return _dao.ParseDbResult(sql); } catch (Exception) { return new DbResult(); } } public DbResult DeleteAccount(AccountDetails delAccount) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag = 'DELETE_ACC'"; sql += ",@customerId = " + _dao.FilterString(delAccount.CustomerId); sql += ",@fintechUseNo = " + _dao.FilterString(delAccount.FintechUseNo); sql += ",@accountNum = " + _dao.FilterString(delAccount.AccountNum); return _dao.ParseDbResult(sql); } public DbResult DeleteAccount(string customerId, string fintechNo) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag = 'DELETE'"; sql += ",@customerId = " + _dao.FilterString(customerId); sql += ",@fintechUseNo = " + _dao.FilterString(fintechNo); return _dao.ParseDbResult(sql); } public DbResult GetOPTNumber(string customerId, string user, string amount, string kftcId) { var sql = "EXEC PROC_OTP_SEND_TXN @FLAG = " + _dao.FilterString("SEND"); sql += ", @CUSTOMERID = " + _dao.FilterString(customerId); sql += ", @CUSTOMEREMAIL = " + _dao.FilterString(user); sql += ", @AMT = " + _dao.FilterString(amount); sql += ", @KFTCID = " + _dao.FilterString(kftcId); return _dao.ParseDbResult(sql); } public DataTable GetKftcLanguage(string customerId) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag = 'kftc-Lanaguage'"; sql += ",@customerId = " + _dao.FilterString(customerId); return _dao.ExecuteDataTable(sql); } public DataTable GetKftcBankList() { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag = 'kftc-Banklist'"; return _dao.ExecuteDataTable(sql); } #region KFTC AUTO DEBIT SERVICE public KftcSendMoneyRequest GetCustomerKFTCInfo(string customerId, string kftcLogId) { var sql = "EXEC mobile_proc_KTFC @flag='CUSTOMERINFO' "; sql += ", @customerId = " + _dao.FilterString(customerId); sql += ", @kftcLogId = " + _dao.FilterString(kftcLogId); Log.DebugFormat("GetCustomerKFTCInfo | SQL:{0}", sql); var dt = _dao.ExecuteDataTable(sql); return Mapper.DataTableToClass(dt)[0]; } public DbResult SaveKFTCTranData(Response.withdraw respObj, string customerId) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag = 'I-TRAN'"; sql += ",@customerId = " + _dao.FilterString(customerId); sql += ",@fintechUseNo = " + _dao.FilterString(respObj.fintech_use_num); sql += ",@apiTranId = " + _dao.FilterString(respObj.api_tran_id); sql += ",@apiTranDtm = " + _dao.FilterString(respObj.api_tran_dtm); sql += ",@rspCode = " + _dao.FilterString(respObj.rsp_code); sql += ",@dpsBankCodeStd = " + _dao.FilterString(respObj.dps_bank_code_std); sql += ",@dpsAccountNumMasked = " + _dao.FilterString(respObj.dps_account_num_masked); sql += ",@dpsPrintContent = N" + _dao.FilterString(respObj.dps_print_content); sql += ",@bankTranId = " + _dao.FilterString(respObj.bank_tran_id); sql += ",@bankTranDate = " + _dao.FilterString(respObj.bank_tran_date); sql += ",@bankCodeTran = " + _dao.FilterString(respObj.bank_code_tran); sql += ",@bankRspCode = " + _dao.FilterString(respObj.bank_rsp_code); sql += ",@bankCodeStd = " + _dao.FilterString(respObj.bank_code_std); sql += ",@accountNumMasked = " + _dao.FilterString(respObj.account_num_masked); sql += ",@printContent = N" + _dao.FilterString(respObj.print_content); sql += ",@accountName = N" + _dao.FilterString(respObj.account_holder_name); sql += ",@tranAmt = " + _dao.FilterString(respObj.tran_amt); sql += ",@remittance_check = " + _dao.FilterString(respObj.remittance_check); return _dao.ParseDbResult(sql); } public DbResult LogFailTransactionForAutoDebit(string rowId, string errorCode, string errorMsg, string refundAmt) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag = 'U-TRAN'"; sql += ", @rowId = " + _dao.FilterString(rowId); sql += ", @errorCode = " + _dao.FilterString(errorCode); sql += ", @errorMsg = " + _dao.FilterString(errorMsg); sql += ", @tranAmt = " + _dao.FilterString(refundAmt); return _dao.ParseDbResult(sql); } public DbResult SendAutoRefund(KJAutoRefundModel kj) { var sql = "EXEC PROC_KJAUTOREFUND @flag = " + _dao.FilterString(kj.flag); sql += ", @pCustomerId = " + _dao.FilterString(kj.customerId); sql += ", @pCustomerSummary = " + _dao.FilterStringUnicode(kj.customerSummary); sql += ", @pAmount = " + _dao.FilterString(kj.amount); sql += ", @pAction = " + _dao.FilterString(kj.action); sql += ", @pActionDate = " + _dao.FilterString(kj.actionDate); sql += ", @pActionBy = " + _dao.FilterString(kj.actionBy); sql += ", @pRowId = " + _dao.FilterString(kj.rowId); sql += ", @pBankCode = " + _dao.FilterString(kj.bankCode); sql += ", @pBankAccountNo = " + _dao.FilterString(kj.bankAccountNo); sql += ", @pSource = " + _dao.FilterString("M"); return _dao.ParseDbResult(sql); } #endregion KFTC AUTO DEBIT SERVICE public DataRow GetGMEMaster() { var sql = "EXEC mobile_proc_KTFC @flag = 'GME-INFO'"; sql += ", @CUSTOMERID = ''"; return _dao.ExecuteDataRow(sql); } public DataRow GetCustomerMaster(string customerId) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag = 'CUSTOMER-MASTER'"; sql += ",@customerId = " + _dao.FilterString(customerId); return _dao.ExecuteDataRow(sql); } public DataRow GetRealNameCheck(string customerId) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag='CHK-REAL-NAME'"; sql += ",@customerId = " + _dao.FilterString(customerId); return _dao.ExecuteDataRow(sql); } public DbResult SetRealNameData(string customerId, string idType, string idNumber) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag='SAVE-REAL-NAME'"; sql += ",@customerId = " + _dao.FilterString(customerId); sql += ",@accHolderInfoType = " + _dao.FilterString(idType); sql += ",@accHolderInfo = " + _dao.FilterString(idNumber); return _dao.ParseDbResult(sql); } /* 2019.09 Dana */ public DataTable GetRecentHistories(RecentHistoryModel model) { var sql = "EXEC dbo.PROC_KFTC_DOMESTIC_TRAN_HISTORY @flag = 'RECENTLIST'"; sql += ", @customerId = " + _dao.FilterString(model.customerId); sql += ", @fromDate = " + _dao.FilterString(model.fromDate); sql += ", @toDate = " + _dao.FilterString(model.toDate); return _dao.ExecuteDataTable(sql); } public DbResult GetRecipientMobileNo(CheckRealNameModel model) { var sql = "EXEC dbo.PROC_KFTC_DOMESTIC_TRAN_HISTORY @flag = 'RecipientMobileNo'"; sql += ", @customerId = " + _dao.FilterString(model.CustomerId); sql += ", @bankCode = " + _dao.FilterString(model.BankCode); sql += ", @accountNumber = " + _dao.FilterString(model.AccountNumber); return _dao.ParseDbResult(sql); } public DbResult GetKFTCServiceFee(string serviceType, string partnerName) { var sql = "select '0' errorCode,valueType,value from serviceValueMaster "; sql += "where partnerName = " + _dao.FilterString(partnerName); sql += "and serviceType = " + _dao.FilterString(serviceType); return _dao.ParseDbResult(sql); } public DbResult requestKFTCDomesticHistory(DomesticHistoryModel model) { var sql = "EXEC dbo.PROC_KFTC_DOMESTIC_HISTORY @flag = 'INSERT'"; sql += ", @customerId = " + _dao.FilterString(model.customerId); sql += ", @transferType = " + _dao.FilterString(model.transferType); //withdraw, deposit, refund sql += ", @reqNameCheckOption = " + _dao.FilterString(model.reqNameCheckOption); sql += ", @processId = " + _dao.FilterString(model.processId); sql += ", @reqCnt = " + _dao.FilterString(model.reqCnt); sql += ", @reqTranNo = " + _dao.FilterString(model.reqTranNo); sql += ", @reqMobileNo = " + _dao.FilterStringUnicode(model.reqMobileNo); sql += ", @accountType = " + _dao.FilterStringUnicode(model.accountType); sql += ", @reqWdPrintContent = " + _dao.FilterStringUnicode(model.reqWdPrintContent); sql += ", @reqAmt = " + _dao.FilterString(model.reqAmt); sql += ", @serviceFee = " + _dao.FilterString(model.serviceFee); sql += ", @reqTranAmt = " + _dao.FilterString(model.reqTranAmt); sql += ", @reqBankCodeStd = " + _dao.FilterString(model.reqBankCodeStd); sql += ", @reqAccountNum = " + _dao.FilterString(model.reqAccountNum); sql += ", @reqAccountHolderName = " + _dao.FilterStringUnicode(model.reqAccountHolderName); sql += ", @reqPrintContent = " + _dao.FilterStringUnicode(model.reqPrintContent); sql += ", @reqFintechUseNum = " + _dao.FilterStringUnicode(model.reqFintechUseNum); return _dao.ParseDbResult(sql); } public DbResult requestKFTCDomesticHistory2(DomeRimitRequestModel model, string processId, string transferType) { var gme = GetGMEMaster(); var sql = "EXEC dbo.PROC_KFTC_DOMESTIC_HISTORY @flag = 'INSERT'"; sql += ", @customerId = " + _dao.FilterString(model.CustomerId); sql += ", @transferType = " + _dao.FilterString(transferType); //withdraw, deposit, refund sql += ", @reqNameCheckOption = " + _dao.FilterString("off"); sql += ", @processId = " + _dao.FilterString(processId); sql += ", @reqCnt = " + _dao.FilterString("1"); sql += ", @reqTranNo = " + _dao.FilterString("1"); sql += ", @reqMobileNo = " + _dao.FilterStringUnicode(model.RecipientPhone); sql += ", @accountType = " + _dao.FilterStringUnicode(model.type); //wallet 또는 autodebit if (model.type == "wallet") // wallet to bank { //고객의 이름, 가상계좌번호 var GMEcustomerDetail = GetGMECustomerList(model.CustomerId); if (transferType == "walletWithdraw") { sql += ", @reqWdPrintContent = " + _dao.FilterStringUnicode(model.RecipientName); sql += ", @reqPrintContent = " + _dao.FilterStringUnicode(model.RecipientName); sql += ", @reqAmt = " + _dao.FilterString(model.SentAmount); sql += ", @serviceFee = " + _dao.FilterString(model.ServiceFee); sql += ", @reqTranAmt = " + _dao.FilterString((Convert.ToDecimal(model.SentAmount) + Convert.ToDecimal(model.ServiceFee)).ToString()); } else if (transferType == "deposit") { sql += ", @reqWdPrintContent = " + _dao.FilterStringUnicode(model.RecipientName); sql += ", @reqBankCodeStd = " + _dao.FilterString(model.RecipientBankCode); sql += ", @reqAccountNum = " + _dao.FilterString(model.RecipientAccountNo); sql += ", @reqAccountHolderName = " + _dao.FilterStringUnicode(model.RecipientName); sql += ", @reqPrintContent = " + _dao.FilterStringUnicode(GMEcustomerDetail.Rows[0]["fullName"].ToString()); sql += ", @reqAmt = " + _dao.FilterString(model.SentAmount); sql += ", @serviceFee = " + _dao.FilterString("0"); sql += ", @reqTranAmt = " + _dao.FilterString(model.SentAmount); // sql += ", @reqFintechUseNum = " + _dao.FilterString(gme["accessToken"].ToString()); } else if (transferType == "refund") { sql += ", @reqWdPrintContent = " + _dao.FilterStringUnicode(GMEcustomerDetail.Rows[0]["fullName"].ToString()); sql += ", @reqAccountNum = " + _dao.FilterString(GMEcustomerDetail.Rows[0]["walletAccountNo"].ToString()); sql += ", @reqAccountHolderName = " + _dao.FilterStringUnicode(GMEcustomerDetail.Rows[0]["fullName"].ToString()); sql += ", @reqPrintContent = " + _dao.FilterStringUnicode("이체실패_환불"); sql += ", @reqAmt = " + _dao.FilterString(model.SentAmount); sql += ", @serviceFee = " + _dao.FilterString(model.ServiceFee); sql += ", @reqTranAmt = " + _dao.FilterString((Convert.ToDecimal(model.SentAmount) + Convert.ToDecimal(model.ServiceFee)).ToString()); // sql += ", @reqFintechUseNum = " + _dao.FilterString(gme["accessToken"].ToString()); } } else if (model.type == "autodebit") // bank to bank { var customerDetail = GetAccountList(model.CustomerId); if (transferType == "withdraw") { sql += ", @reqWdPrintContent = " + _dao.FilterStringUnicode(model.RecipientName); sql += ", @reqPrintContent = " + _dao.FilterStringUnicode(model.RecipientName); sql += ", @reqAmt = " + _dao.FilterString(model.SentAmount); sql += ", @serviceFee = " + _dao.FilterString(model.ServiceFee); sql += ", @reqTranAmt = " + _dao.FilterString((Convert.ToDecimal(model.SentAmount) + Convert.ToDecimal(model.ServiceFee)).ToString()); sql += ", @reqFintechUseNum = " + _dao.FilterString(model.FintechUseNo); } else if (transferType == "deposit") { sql += ", @reqWdPrintContent = " + _dao.FilterStringUnicode(model.RecipientName); sql += ", @reqBankCodeStd = " + _dao.FilterString(model.RecipientBankCode); sql += ", @reqAccountNum = " + _dao.FilterString(model.RecipientAccountNo); sql += ", @reqAccountHolderName = " + _dao.FilterStringUnicode(model.RecipientName); sql += ", @reqPrintContent = " + _dao.FilterStringUnicode(customerDetail.Rows[0]["accountName"].ToString()); sql += ", @reqAmt = " + _dao.FilterString(model.SentAmount); sql += ", @serviceFee = " + _dao.FilterString("0"); sql += ", @reqTranAmt = " + _dao.FilterString(model.SentAmount); // sql += ", @reqFintechUseNum = " + _dao.FilterString(gme["accessToken"].ToString()); } else if (transferType == "refund") { sql += ", @reqWdPrintContent = " + _dao.FilterStringUnicode(customerDetail.Rows[0]["accountName"].ToString()); sql += ", @reqBankCodeStd = " + _dao.FilterString(customerDetail.Rows[0]["bankCodeStd"].ToString()); sql += ", @reqAccountNum = " + _dao.FilterString(customerDetail.Rows[0]["accountNum"].ToString()); sql += ", @reqAccountHolderName = " + _dao.FilterStringUnicode(customerDetail.Rows[0]["accountName"].ToString()); sql += ", @reqPrintContent = " + _dao.FilterStringUnicode("이체실패_환불"); sql += ", @reqAmt = " + _dao.FilterString(model.SentAmount); sql += ", @serviceFee = " + _dao.FilterString(model.ServiceFee); sql += ", @reqTranAmt = " + _dao.FilterString((Convert.ToDecimal(model.SentAmount) + Convert.ToDecimal(model.ServiceFee)).ToString()); // sql += ", @reqFintechUseNum = " + _dao.FilterString(gme["accessToken"].ToString()); } } return _dao.ParseDbResult(sql); } public DbResult responseKFTCDomesticHistory_withdraw(Response.withdraw response, DomesticRemitModel model) { var sql = "EXEC dbo.PROC_KFTC_DOMESTIC_HISTORY @flag = 'UPDATE'"; sql += ", @transferType = " + _dao.FilterString("withdraw"); sql += ", @reqNameCheckOption = " + _dao.FilterString("off"); sql += ", @customerId = " + _dao.FilterString(model.CustomerId); sql += ", @processId = " + _dao.FilterString(model.processId); if (response == null) { sql += ", @resRspMessage = " + _dao.FilterStringUnicode("FAILED TO KFTC OPEN-FLATFORM (transfer/withdraw) QUERY!"); return _dao.ParseDbResult(sql); } sql += ", @resApiTranId = " + _dao.FilterString(response.api_tran_id); sql += ", @resApiTranDtime = " + _dao.FilterString(response.api_tran_dtm); sql += ", @resRspCode = " + _dao.FilterString(response.rsp_code); sql += ", @resRspMessage = " + _dao.FilterStringUnicode(response.rsp_message); sql += ", @resWdBankCodeStd = " + _dao.FilterString(response.dps_bank_code_std); sql += ", @resWdBankCodeSub = " + _dao.FilterString(response.dps_bank_code_sub); sql += ", @resWdBankName = " + _dao.FilterStringUnicode(response.dps_bank_name); sql += ", @resWdAccountNumMasked = " + _dao.FilterString(response.dps_account_num_masked); sql += ", @resWdPrintContent = " + _dao.FilterStringUnicode(response.dps_print_content); sql += ", @resWdAccountHolderName = " + _dao.FilterStringUnicode(response.dps_account_holder_name); sql += ", @resCnt = " + _dao.FilterString("1"); sql += ", @resTranNo = " + _dao.FilterString("1"); sql += ", @resBankTranId = " + _dao.FilterString(response.bank_tran_id); sql += ", @resBankTranDate = " + _dao.FilterString(response.bank_tran_date); sql += ", @resBankCodeTran = " + _dao.FilterString(response.bank_code_tran); sql += ", @resBankRspCode = " + _dao.FilterString(response.bank_rsp_code); sql += ", @resBankRspMessage = " + _dao.FilterStringUnicode(response.bank_rsp_message); sql += ", @resBankCodeStd = " + _dao.FilterString(response.bank_code_std); sql += ", @resBankCodeSub = " + _dao.FilterString(response.bank_code_sub); sql += ", @resBankName = " + _dao.FilterStringUnicode(response.bank_name); sql += ", @resAccountNumMasked = " + _dao.FilterString(response.account_num_masked); sql += ", @resPrintContent = " + _dao.FilterStringUnicode(response.print_content); sql += ", @resAccountHolderName = " + _dao.FilterStringUnicode(response.account_holder_name); sql += ", @resTranAmt = " + _dao.FilterString(response.tran_amt); return _dao.ParseDbResult(sql); } public DbResult responseKFTCDomesticHistory_DepositRefund(Response.deposit response, DomesticRemitModel model) { var sql = "EXEC dbo.PROC_KFTC_DOMESTIC_HISTORY @flag = 'UPDATE'"; sql += ", @transferType = " + _dao.FilterString(model.transferType); sql += ", @reqNameCheckOption = " + _dao.FilterString("off"); sql += ", @customerId = " + _dao.FilterString(model.CustomerId); sql += ", @processId = " + _dao.FilterString(model.processId); if (response == null) { sql += ", @resRspMessage = " + _dao.FilterStringUnicode("FAILED TO KFTC OPEN-FLATFORM (transfer/deposit2) QUERY!"); return _dao.ParseDbResult(sql); } sql += ", @resApiTranId = " + _dao.FilterString(response.api_tran_id); sql += ", @resApiTranDtime = " + _dao.FilterString(response.api_tran_dtm); sql += ", @resRspCode = " + _dao.FilterString(response.rsp_code); sql += ", @resRspMessage = " + _dao.FilterStringUnicode(response.rsp_message); sql += ", @resWdBankCodeStd = " + _dao.FilterString(response.wd_bank_code_std); sql += ", @resWdBankCodeSub = " + _dao.FilterString(response.wd_bank_code_sub); sql += ", @resWdBankName = " + _dao.FilterStringUnicode(response.wd_bank_name); sql += ", @resWdAccountNumMasked = " + _dao.FilterString(response.wd_account_num_masked); sql += ", @resWdPrintContent = " + _dao.FilterStringUnicode(response.wd_print_content); sql += ", @resWdAccountHolderName = " + _dao.FilterStringUnicode(response.wd_account_holder_name); sql += ", @resCnt = " + _dao.FilterString("1"); sql += ", @resTranNo = " + _dao.FilterString("1"); if (response.res_list != null) { sql += ", @resBankTranId = " + _dao.FilterString(response.res_list[0].bank_tran_id); sql += ", @resBankTranDate = " + _dao.FilterString(response.res_list[0].bank_tran_date); sql += ", @resBankCodeTran = " + _dao.FilterString(response.res_list[0].bank_code_tran); sql += ", @resBankRspCode = " + _dao.FilterString(response.res_list[0].bank_rsp_code); sql += ", @resBankRspMessage = " + _dao.FilterStringUnicode(response.res_list[0].bank_rsp_message); sql += ", @resBankCodeStd = " + _dao.FilterString(response.res_list[0].bank_code_std); sql += ", @resBankCodeSub = " + _dao.FilterString(response.res_list[0].bank_code_sub); sql += ", @resBankName = " + _dao.FilterStringUnicode(response.res_list[0].bank_name); sql += ", @resAccountNumMasked = " + _dao.FilterString(response.res_list[0].account_num_masked); sql += ", @resPrintContent = " + _dao.FilterStringUnicode(response.res_list[0].dps_print_content); sql += ", @resAccountHolderName = " + _dao.FilterStringUnicode(response.res_list[0].account_holder_name); sql += ", @resTranAmt = " + _dao.FilterString(response.res_list[0].tran_amt); } return _dao.ParseDbResult(sql); } public DbResult startPushFromDomestit(string processId) { var sql = "EXEC dbo.proc_online_PushFromDomestic"; sql += " @tranId = " + _dao.FilterString(processId); return _dao.ParseDbResult(sql); } public DbResult CheckLoginPassword(string user, string txnPassword, string paymentType, string customerId) { string sql = ""; if (paymentType.ToLower() == "wallet") { sql = "EXEC proc_online_customer_login"; sql += " @flag='checkpass'"; sql += ", @customerEmail =" + _dao.FilterString(user); sql += ", @password =" + _dao.FilterString(txnPassword); } else if (paymentType.ToLower() == "autodebit") { sql = "EXEC PROC_OTP_SEND_TXN"; sql += " @FLAG ='VERIFY'"; sql += ", @OTP_NUMBER =" + _dao.FilterString(txnPassword); sql += ", @CUSTOMERID =" + _dao.FilterString(customerId); } return _dao.ParseDbResult(sql); } public List GetWalletAccountList(string customer) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag = 's-send',@customerId =" + _dao.FilterString(customer); Log.DebugFormat("GetPaymentAccountsByCustomer | SQL:{0}", sql); var dt = _dao.ExecuteDataTable(sql); List _accountDetails = new List(); try { if (dt == null || dt.Rows.Count == 0) { return _accountDetails; } foreach (DataRow item in dt.Rows) { var accName = ""; if (item["isApproved"].ToString() == "N") { accName = item["walletName"].ToString() + item["autoDebit"].ToString() + " (Unapproved)"; } else { accName = item["walletName"].ToString() + item["autoDebit"].ToString(); } accName += "(" + item["accountNumMasked"].ToString() + ")"; AccountDetails _account = new AccountDetails(); _account.KftcAccountId = item["RowId"].ToString(); _account.FintechUseNo = item["fintechUseNo"].ToString(); _account.Type = item["type"].ToString(); _account.WalletName = item["walletName"].ToString(); _account.BankName = item["walletName"].ToString(); if (item["type"].ToString() != "wallet") { _account.AccountNumMasked = item["accountNumMasked"].ToString(); } _accountDetails.Add(_account); } return _accountDetails; } catch (Exception ex) { Log.Error("Exception tracked : " + ex.Message, ex); return _accountDetails; } } public DbResult GetUserEmail(string customerId) { var sql = "select '0' errorCode,customerId,email from customerMaster "; sql += "where customerId = " + _dao.FilterString(customerId); return _dao.ParseDbResult(sql); } /* 2019.10.10 KFTC 계좌 서비스승인 정보조회 Dana*/ public DataRow GetAccountKFTCInfo(string customerId, string kftcLogId) { var sql = "EXEC mobile_proc_KTFC @flag='ACCOUNTINFO' "; sql += ", @customerId = " + _dao.FilterString(customerId); sql += ", @kftcLogId = " + _dao.FilterString(kftcLogId); Log.DebugFormat("GetCustomerKFTCInfo | SQL:{0}", sql); return _dao.ExecuteDataRow(sql); } public DataRow GetKFTCAccountInfo(string customerId, string fintechUseNo) { var sql = "SELECT * from dbo.FNAGetKFTCAccountInfo(" + _dao.FilterString(customerId) + "," + _dao.FilterString(fintechUseNo) + ")"; return _dao.ExecuteDataRow(sql); } public DataRow GetCustomerData_V4(string customerId) { var sql = "EXEC KFTC_LOG_CUSTOMER_INFO @flag = 's-refresh-v4'"; sql += ",@customerId = " + _dao.FilterString(customerId); Log.Debug("Query : " + sql); return _dao.ExecuteDataRow(sql); } public DbResult GetCustomerIdEmail(string email) { var sql = "select '0' errorCode,customerId,email from customerMaster "; sql += "where email = " + _dao.FilterString(email); return _dao.ParseDbResult(sql); } } }