841 lines
40 KiB
C#
841 lines
40 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
|
|
using NP.Model;
|
|
using System.Security.Claims;
|
|
using System.Collections;
|
|
using System.Text;
|
|
using Newtonsoft.Json.Linq;
|
|
using Newtonsoft.Json;
|
|
using OkCert3Com;
|
|
|
|
namespace NP.FO.Controllers
|
|
{
|
|
public class AccountController : FOOpenBaseController
|
|
{
|
|
public ActionResult FindMe(VMUser vm)
|
|
{
|
|
vm.User = new Users() { };
|
|
if (vm.userno > 0)
|
|
{
|
|
//인증링크 클릭 확인
|
|
vm.User = Dao.Get<Users>("users.pwuser", new Hashtable() { { "userno", vm.userno }, { "pwcallno", vm.pwcallno } }).FirstOrDefault();
|
|
if (vm.User == null || vm.User.pwcallno == null)
|
|
{
|
|
vm.User = new Users() { };
|
|
vm.userno = -1;
|
|
}
|
|
}
|
|
return View(vm);
|
|
}
|
|
public ActionResult Index(VMUser vm){
|
|
if (Request.IsAjaxRequest()){
|
|
return JsonError<String>(Base.ENUM.JSONCode.Error, "403:" + Request.Url.AbsolutePath, "0112");
|
|
}
|
|
else
|
|
{
|
|
//ViewBag.gossl = 0;
|
|
//if ("Y".Equals(GetConfig("usessl")) && !Request.IsSecureConnection)
|
|
//{
|
|
// //return Redirect("https://" + Request.Url.Host + Request.Url.PathAndQuery);
|
|
// ViewBag.gossl = 1;
|
|
//}
|
|
|
|
vm.Assign = new Assign();
|
|
//서브도메인 확인 하여 고객사 설정
|
|
var sd = Request.Url.Host.Split('.')[0];
|
|
if (GetConfig("isdevtest") != "1" && Request.Url.Host != "222.122.63.91" && Request.Url.Host != "ynicte.nptc.kr" && Request.Url.Host != "phd.nptc.kr" && MainSubDomain.ToUpper() != sd.ToUpper())
|
|
{
|
|
ViewBag.Files = vm.Files;
|
|
ViewBag.Assign = vm.Assign = Dao.Get<Assign>("users.assignsite", new Hashtable() { { "subdomain", sd } }).First();
|
|
ViewBag.SiteTitle = vm.Assign.asname;
|
|
}
|
|
ViewBag.SavedId = CookieGet("savedid", "");
|
|
|
|
return View(vm);
|
|
}
|
|
}
|
|
private ActionResult RedirectToLocal(string returnUrl){
|
|
if (Url.IsLocalUrl(returnUrl)){return Redirect(returnUrl);}
|
|
else {return RedirectToAction(nameof(HomeController.Index), "Home");}
|
|
}
|
|
public ActionResult Join(VMUser vm)
|
|
{
|
|
//if ("Y".Equals(GetConfig("usessl")) && !Request.IsSecureConnection)
|
|
//{
|
|
// return Redirect("https://" + Request.Url.Host + Request.Url.PathAndQuery);
|
|
//}
|
|
//else
|
|
//{
|
|
if(vm.User == null)
|
|
{
|
|
vm.User = new Users() { };
|
|
}
|
|
ViewBag.JoinOK = false;
|
|
if (GetInt(Request["intval"]) == 1)
|
|
{
|
|
ViewBag.JoinOK = true;
|
|
}
|
|
return View(vm);
|
|
//}
|
|
}
|
|
public ActionResult CallOrder(){return View();}
|
|
|
|
public ActionResult Logout(){
|
|
CookieClear(null, true);
|
|
return Redirect("/Account/Index");
|
|
}
|
|
public ActionResult Error(NP.Model.JsonRtn vm)
|
|
{
|
|
vm.err = (string)TempData["err"] ?? "";
|
|
vm.msg = vm.msg ?? "503";
|
|
Exception exception = Server.GetLastError();
|
|
Response.Clear();
|
|
ViewBag.ErrorMsg = "";
|
|
HttpException httpException = exception as HttpException;
|
|
if (httpException != null)
|
|
{
|
|
NP.Base.Logger.Error("ApplicationError" + vm.msg, exception);
|
|
}
|
|
Server.ClearError();
|
|
if (Request.IsAjaxRequest())
|
|
{
|
|
//public static bool IsAjaxRequest(this HttpRequest request)
|
|
//{
|
|
// if (request == null)
|
|
// {
|
|
// throw new ArgumentNullException("request");
|
|
// }
|
|
//
|
|
// return (request["X-Requested-With"] == "XMLHttpRequest") || ((request.Headers != null) && (request.Headers["X-Requested-With"] == "XMLHttpRequest"));
|
|
//}
|
|
return JsonError<Exception>(Base.ENUM.JSONCode.Error, vm.msg + ":" + Request.Url.AbsolutePath + (exception ?? new Exception()).Message, exception);
|
|
}
|
|
return View("Error", vm);
|
|
}
|
|
[AllowAnonymous]
|
|
public ActionResult BanEmail(VMUser vm, int et, int no = 0)
|
|
{
|
|
try
|
|
{
|
|
switch (et)
|
|
{
|
|
case 0:
|
|
//뉴스레터수신거부
|
|
if (no != 0)
|
|
{
|
|
Dao.Save("common.emailban", new Hashtable() { { "SendNo", no }, { "Email", vm.em }, { "uno", 1 }, { "uip", GetUserIP() } });
|
|
}
|
|
else
|
|
{
|
|
Dao.Save("common.emailban", new Hashtable() { { "Email", vm.em }, { "uno", 1 }, { "uip", GetUserIP() } });
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SetError("/account/banemail:" + vm.em + ":" + ex.Message + ex.StackTrace);
|
|
}
|
|
return View(vm);
|
|
}
|
|
public ActionResult Error403(NP.Model.JsonRtn vm){vm.msg = "403";return Error(vm);}
|
|
public ActionResult Error404(NP.Model.JsonRtn vm){vm.msg = "404" + (Request.IsLocal ? Request.Url.Query : "");return Error(vm);}
|
|
public ActionResult Error500(NP.Model.JsonRtn vm){vm.msg = "500";return Error(vm);}
|
|
//public JsonResult JsonError<T>(NP.Base.ENUM.JSONCode cd, String m, T t){return Json(new NP.Model.JsonRtn() { Code = (int)cd, Msg = m, Obj = t }, JsonRequestBehavior.AllowGet);}
|
|
|
|
|
|
/// <summary>
|
|
/// pc가상계좌입금통보
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public String PayVBankMoney()
|
|
{
|
|
try
|
|
{
|
|
String TEMP_IP = GetUserIP();
|
|
String PG_IP = TEMP_IP.Substring(0, 10);
|
|
if (PG_IP == "203.238.37" || PG_IP == "39.115.212" || PG_IP == "183.109.71" )//PG에서 보냈는지 IP로 체크
|
|
{
|
|
String NO_TID = Request["NO_TID"];//거래번호
|
|
String NO_OID = Request["NO_OID"];//상점 주문번호
|
|
String ID_MERCHANT = Request["ID_MERCHANT"]; //상점 아이디
|
|
String CD_BANK = Request["CD_BANK"]; //거래 발생 기관 코드
|
|
String CD_DEAL = Request["CD_DEAL"]; //취급 기관 코드
|
|
String DT_TRANS = Request["DT_TRANS"]; //거래 일자
|
|
String TM_TRANS = Request["TM_TRANS"]; //거래 시간
|
|
String NO_MSGSEQ = Request["NO_MSGSEQ"]; //전문 일련 번호
|
|
String CD_JOINORG = Request["CD_JOINORG"]; //제휴 기관 코드
|
|
String NO_TRANSEQ = Request["NO_TRANSEQ"]; //거래 일련 번호
|
|
String NO_VACCT = Request["NO_VACCT"]; //가상계좌번호
|
|
String AMT_INPUT = Request["AMT_INPUT"]; //입금금액
|
|
String AMT_CHECK = Request["AMT_CHECK"]; //미결제 타점권 금액
|
|
String CL_CLOSE = Request["CL_CLOSE"]; //마감 구분코드
|
|
String TYPE_MSG = Request["TYPE_MSG"]; //거래 구분 코드
|
|
String NM_INPUTBANK = Request["NM_INPUTBANK"]; //입금 금융기관명
|
|
String NM_INPUT = Request["NM_INPUT"]; //입금 의뢰인
|
|
String DT_INPUTSTD = Request["DT_INPUTSTD"]; //입금 기준 일자
|
|
String DT_CALCULSTD = Request["DT_CALCULSTD"]; //정산 기준 일자
|
|
String DT_TRANSBASE = Request["DT_TRANSBASE"]; //거래 기준 일자
|
|
|
|
|
|
String CL_KOR = Request["CL_KOR"]; //한글 구분 코드
|
|
String NO_MSGMANAGE = Request["NO_MSGMANAGE"]; //전문 관리 번호
|
|
|
|
String FLG_CLOSE = Request["FLG_CLOSE"]; //마감 전화
|
|
String DT_CSHR = Request["DT_CSHR"]; //현금영수증 발급일자 // 가상계좌채번시 현금영수증 자동발급신청시에만 전달
|
|
String TM_CSHR = Request["TM_CSHR"]; //현금영수증 발급시간
|
|
String NO_CSHR_APPL = Request["NO_CSHR_APPL"]; //현금영수증 발급번호
|
|
String NO_CSHR_TID = Request["NO_CSHR_TID"]; //현금영수증 발급TID
|
|
|
|
|
|
System.Text.Encoding encKr = System.Text.Encoding.GetEncoding("euc-kr");
|
|
System.Text.EncodingInfo[] encods = System.Text.Encoding.GetEncodings();
|
|
System.Text.Encoding destEnc = System.Text.Encoding.UTF8;
|
|
|
|
try
|
|
{
|
|
String path = GetConfig("pgroot") + @"\log\result.log";
|
|
if (!System.IO.File.Exists(path))
|
|
{
|
|
System.IO.File.Create(path);
|
|
}
|
|
using (System.IO.StreamWriter sw = System.IO.File.AppendText(path))
|
|
{
|
|
sw.WriteLine("************************************************");
|
|
sw.WriteLine("ID_MERCHANT : " + ID_MERCHANT);
|
|
sw.WriteLine("NO_TID : " + NO_TID);
|
|
sw.WriteLine("NO_OID : " + NO_OID);
|
|
sw.WriteLine("NO_VACCT : " + NO_VACCT);
|
|
sw.WriteLine("AMT_INPUT : " + AMT_INPUT);
|
|
sw.WriteLine("NM_INPUTBANK : " + NM_INPUTBANK);
|
|
sw.WriteLine("NM_INPUT : " + NM_INPUT);
|
|
byte[] requestBuffer;
|
|
try
|
|
{
|
|
requestBuffer = Request.BinaryRead(Request.TotalBytes);
|
|
String rp = HttpUtility.UrlDecode(requestBuffer, System.Text.Encoding.GetEncoding("euc-kr"));
|
|
sw.WriteLine("****************2");
|
|
sw.WriteLine("decodestring: " + rp);
|
|
sw.WriteLine("****************2");
|
|
String[] rps = rp.Split('&');
|
|
NM_INPUTBANK = rps.Where(w => w.Split('=')[0].ToLower() == "nm_inputbank").First().Split('=')[1];
|
|
NM_INPUT = rps.Where(w => w.Split('=')[0].ToLower() == "nm_input").First().Split('=')[1];
|
|
requestBuffer = null;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
requestBuffer = null;
|
|
sw.WriteLine(ex.Message + ex.StackTrace);
|
|
}
|
|
//sw.WriteLine("NM_INPUTBANK : " + Encoding.UTF8.GetString(Encoding.Convert(Encoding.GetEncoding("euc-kr"), Encoding.UTF8, Encoding.GetEncoding("euc-kr").GetBytes(NM_INPUTBANK))));
|
|
//sw.WriteLine("NM_INPUT : " + Encoding.UTF8.GetString(Encoding.Convert(Encoding.GetEncoding("euc-kr"),Encoding.UTF8,Encoding.GetEncoding("euc-kr").GetBytes(NM_INPUT))));
|
|
sw.WriteLine("PAYTIEM : " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
|
|
sw.WriteLine("************************************************");
|
|
sw.WriteLine("");
|
|
sw.Flush();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SetError(ex.StackTrace);
|
|
}
|
|
var payvbankin = new PayVBankIn()
|
|
{
|
|
payno = GetLong(NO_OID.Substring(2)),
|
|
uno = 1,
|
|
uip = GetUserIP(),
|
|
pgkey = NO_TID,
|
|
inbankcode = CD_BANK,
|
|
indeal = CD_DEAL,
|
|
inymd = DT_TRANS,
|
|
inhms = TM_TRANS,
|
|
msgseq = NO_MSGSEQ,
|
|
transseq = NO_TRANSEQ,
|
|
vacct = NO_VACCT,
|
|
inamt = GetInt(AMT_INPUT),
|
|
checkamt = GetInt(AMT_CHECK),
|
|
isclose = CL_CLOSE,
|
|
typemsg = TYPE_MSG,
|
|
frombank = NM_INPUTBANK,
|
|
fromname = NM_INPUT,
|
|
//frombank = Encoding.UTF8.GetString(Encoding.Convert(Encoding.GetEncoding("euc-kr"), Encoding.UTF8, Encoding.GetEncoding("euc-kr").GetBytes(NM_INPUTBANK))),
|
|
//fromname = Encoding.UTF8.GetString(Encoding.Convert(Encoding.GetEncoding("euc-kr"), Encoding.UTF8, Encoding.GetEncoding("euc-kr").GetBytes(NM_INPUT))),
|
|
fromymd = DT_INPUTSTD,
|
|
calcymd = DT_CALCULSTD,
|
|
tranymd = DT_TRANSBASE,
|
|
//transcode = AAAA,
|
|
korcode = CL_KOR,
|
|
cshrymd = DT_CSHR,
|
|
cshrhms = TM_CSHR,
|
|
cshrcode = NO_CSHR_APPL,
|
|
cshrpgkey = NO_CSHR_TID
|
|
};
|
|
if (Dao.Save("pay.paylect.vbankin", payvbankin) < 3)
|
|
{
|
|
//상품구매완료 처리 (최소 3건 업데이트 (payvbankin, pay)
|
|
return "FAIL";
|
|
}
|
|
return "OK";
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SetError("가상계좌입금오류: " + ex.Message + ex.StackTrace);
|
|
}
|
|
return "FAIL";
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 모바일가상계좌입금통보
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public String PayVBankMoneyMobile()
|
|
{
|
|
try
|
|
{
|
|
String TEMP_IP = GetUserIP();
|
|
//String PG_IP = TEMP_IP.Substring(0, 10);
|
|
if ((TEMP_IP == "118.129.210.25" || TEMP_IP == "203.238.37.15" || TEMP_IP == "183.109.71.153") && Request["P_TYPE"] == "VBANK" && Request["P_STATUS"] == "02")//PG에서 보냈는지 IP로 체크
|
|
{
|
|
//P_TID=INIMX_VBNKINIpayTest20190821162423335068
|
|
//P_MID =INIpayTest
|
|
//P_AUTH_DT=20190821163218
|
|
//P_STATUS=02
|
|
//P_TYPE=VBANK
|
|
//P_OID=te230
|
|
//P_FN_CD1=03
|
|
//P_FN_CD2=
|
|
//P_FN_NM=기업은행
|
|
//P_AMT=100
|
|
//P_UNAME=npuser1name
|
|
//P_RMESG1=P_VACCT_NO=07502280297143|P_EXP_DT=20190827
|
|
//P_RMESG2=
|
|
//P_NOTI=MOBILE|/OffDetail?cmno=87|230
|
|
//P_AUTH_NO=
|
|
//P_CSHR_AMT=
|
|
//P_CSHR_SUP_AMT=
|
|
//P_CSHR_TAX=
|
|
//P_CSHR_SRVC_AMT=
|
|
//P_CSHR_TYPE=
|
|
//P_CSHR_DT=20190821163218
|
|
//P_CSHR_AUTH_NO=266477600
|
|
//P_HASH=diUGxXN1CUumXZX1GBcB5sS7SNQOqAq1BfGIALI82qmMLLHAkq0y18MTuuS18rqVJQhhWLHEDAcifsXZ3U9urQ==Jakarta Commons - HttpClient / 3.0.1
|
|
|
|
String NO_TID = Request["P_TID"];//거래번호
|
|
String NO_OID = Request["P_OID"];//상점 주문번호
|
|
String ID_MERCHANT = Request["P_MID"]; //상점 아이디
|
|
String CD_BANK = Request["P_FN_CD1"]; //거래 발생 기관 코드
|
|
String P_FN_NM = Request["P_FN_NM"]; //금융사명
|
|
String CD_DEAL = "";// Request["aaaaaaaaCD_DEAL"]; //취급 기관 코드
|
|
String DT_TRANS = "";//Request["aaaaaaaaDT_TRANS"]; //거래 일자
|
|
String TM_TRANS = "";//equest["aaaaaaaaTM_TRANS"]; //거래 시간
|
|
String NO_MSGSEQ = "";// Request["aaaaaaaaNO_MSGSEQ"]; //전문 일련 번호
|
|
String CD_JOINORG = "";// Request["aaaaaaaaCD_JOINORG"]; //제휴 기관 코드
|
|
String NO_TRANSEQ = "";// Request["aaaaaaaaNO_TRANSEQ"]; //거래 일련 번호
|
|
String NO_VACCT = "";// Request["aaaaaaaaNO_VACCT"]; //가상계좌번호
|
|
String AMT_INPUT = Request["P_AMT"]; //입금금액
|
|
String AMT_CHECK = "";// Request["aaaaaaaaAMT_CHECK"]; //미결제 타점권 금액
|
|
String CL_CLOSE = "";// Request["aaaaaaaaCL_CLOSE"]; //마감 구분코드
|
|
String TYPE_MSG = "";// Request["aaaaaaaaTYPE_MSG"]; //거래 구분 코드
|
|
String NM_INPUTBANK = Request["P_FN_NM"]; //입금 금융기관명
|
|
String NM_INPUT = Request["P_UNAME"]; //입금 의뢰인
|
|
String DT_INPUTSTD = "";//Request["aaaaaaaaDT_INPUTSTD"]; //입금 기준 일자
|
|
String DT_CALCULSTD = "";//Request["aaaaaaaaDT_CALCULSTD"]; //정산 기준 일자
|
|
String DT_TRANSBASE = "";// Request["aaaaaaaaDT_TRANSBASE"]; //거래 기준 일자
|
|
String CL_KOR = "";// Request["aaaaaaaaCL_KOR"]; //한글 구분 코드
|
|
String NO_MSGMANAGE = "";// Request["aaaaaaaaNO_MSGMANAGE"]; //전문 관리 번호
|
|
String FLG_CLOSE = "";// Request["aaaaaaaaFLG_CLOSE"]; //마감 전화
|
|
String DT_CSHR = Request["P_CSHR_DT"]; //현금영수증 발급일자 // 가상계좌채번시 현금영수증 자동발급신청시에만 전달
|
|
String TM_CSHR = "";// Request["aaaaaaaaTM_CSHR"]; //현금영수증 발급시간
|
|
String NO_CSHR_APPL = Request["P_CSHR_AUTH_NO"]; //현금영수증 발급번호
|
|
String NO_CSHR_TID = Request["P_CSHR_AUTH_NO"]; //현금영수증 발급TID
|
|
String NO_CSHR_AMT = Request["P_CSHR_AMT"]; //현금영수증 발행금액
|
|
|
|
System.Text.Encoding encKr = System.Text.Encoding.GetEncoding("euc-kr");
|
|
System.Text.EncodingInfo[] encods = System.Text.Encoding.GetEncodings();
|
|
System.Text.Encoding destEnc = System.Text.Encoding.UTF8;
|
|
|
|
try
|
|
{
|
|
String path = GetConfig("pgroot") + @"\log\resultmobile.log";
|
|
if (!System.IO.File.Exists(path))
|
|
{
|
|
System.IO.File.Create(path);
|
|
}
|
|
using (System.IO.StreamWriter sw = System.IO.File.AppendText(path))
|
|
{
|
|
sw.WriteLine("************************************************");
|
|
sw.WriteLine("ID_MERCHANT : " + ID_MERCHANT);
|
|
sw.WriteLine("NO_TID : " + NO_TID);
|
|
sw.WriteLine("NO_OID : " + NO_OID);
|
|
sw.WriteLine("NO_VACCT : " + NO_VACCT);
|
|
sw.WriteLine("AMT_INPUT : " + AMT_INPUT);
|
|
sw.WriteLine("NM_INPUTBANK : " + NM_INPUTBANK);
|
|
sw.WriteLine("NM_INPUT : " + NM_INPUT);
|
|
sw.WriteLine("************************************************");
|
|
sw.WriteLine("");
|
|
sw.Flush();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SetError(ex.StackTrace);
|
|
}
|
|
var payvbankin = new PayVBankIn()
|
|
{
|
|
payno = GetLong(NO_OID.Substring(2)),
|
|
uno = 1,
|
|
uip = GetUserIP(),
|
|
pgkey = NO_TID,
|
|
inbankcode = CD_BANK,
|
|
indeal = CD_DEAL,
|
|
inymd = DT_TRANS,
|
|
inhms = TM_TRANS,
|
|
msgseq = NO_MSGSEQ,
|
|
transseq = NO_TRANSEQ,
|
|
vacct = NO_VACCT,
|
|
inamt = GetInt(AMT_INPUT),
|
|
checkamt = GetInt(AMT_CHECK),
|
|
isclose = CL_CLOSE,
|
|
typemsg = TYPE_MSG,
|
|
frombank = NM_INPUTBANK,
|
|
fromname = NM_INPUT,
|
|
fromymd = DT_INPUTSTD,
|
|
calcymd = DT_CALCULSTD,
|
|
tranymd = DT_TRANSBASE,
|
|
//transcode = AAAA,
|
|
korcode = CL_KOR,
|
|
cshrymd = DT_CSHR,
|
|
cshrhms = TM_CSHR,
|
|
cshrcode = NO_CSHR_APPL,
|
|
cshrpgkey = NO_CSHR_TID,
|
|
cshramt = NO_CSHR_AMT
|
|
};
|
|
if (Dao.Save("pay.paylect.vbankin", payvbankin) < 3)
|
|
{
|
|
//상품구매완료 처리 (최소 3건 업데이트 (payvbankin, pay)
|
|
return "FAIL";
|
|
}
|
|
return "OK";
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SetError("가상계좌입금오류: " + ex.StackTrace);
|
|
}
|
|
return "FAIL";
|
|
}
|
|
public ActionResult AdminEE(int un, int eek, int at, int an)
|
|
{
|
|
var u = Dao.Get<Users>("users.eecall2", new Hashtable() { { "userno", un }, { "eek", eek },{ "uno", an },{ "uip", GetUserIP()} }).FirstOrDefault();
|
|
if (u != null && u.usertype == 1)
|
|
{
|
|
u = GoLogin(u.userid, "rhksflwkfhrmdls999");
|
|
return Redirect("/");
|
|
}
|
|
return RedirectToAction("Index");
|
|
}
|
|
|
|
public ActionResult JoinTSel()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult JoinIdVeri()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 본인인증 요청(mobile(가입이전,휴대폰인증),ipin)
|
|
/// </summary>
|
|
/// <param name="sel"></param>
|
|
/// <returns></returns>
|
|
public ActionResult CertOk3Req(String sel)
|
|
{
|
|
String CP_CD = "V47690000000";
|
|
String SITE_NAME = "YNICTE";
|
|
String REQ_SITE_NM = "YNICTE";
|
|
String REQ_URL = "";
|
|
String RETURN_MSG = "";
|
|
String SITE_URL = GetConfig("fronturl");
|
|
String RQST_CAUS_CD = "00";
|
|
String target = "PROD";
|
|
String param = null;
|
|
String RSLT_CD = null;
|
|
String RSLT_MSG = null;
|
|
String MDL_TKN = null;
|
|
String TX_SEQ_No = null;
|
|
String RETURN_URL = "";
|
|
String RTN_URL = "";
|
|
String CHNL_CD = "";
|
|
String license = "";
|
|
String svcName = "";
|
|
ViewBag.sel = sel;
|
|
ViewBag.tcUrl = "";
|
|
ViewBag.PopupUrl = "";
|
|
|
|
//return url 설정
|
|
RETURN_URL = GetConfig("fronturl") + "/Account/CertOk3" + sel;
|
|
RTN_URL = GetConfig("fronturl") + "/Account/CertOk3" + sel;
|
|
//모바일팝업
|
|
if (sel == "MOBI" || sel == "MCHK")
|
|
{
|
|
license = "C:\\Windows\\SysWOW64\\" + CP_CD + "_IDS_01_" + target + "_AES_license.dat";
|
|
svcName = "IDS_HS_POPUP_START";
|
|
ViewBag.tcUrl = "kcb.oknm.online.safehscert.popup.cmd.P931_CertChoiceCmd";
|
|
ViewBag.PopupUrl = "https://safe.ok-name.co.kr/CommonSvl";
|
|
}
|
|
else if (sel == "IPIN")
|
|
{
|
|
license = "C:\\Windows\\SysWOW64\\" + CP_CD + "_TIS_01_" + target + "_AES_license.dat";
|
|
svcName = "TIS_IPIN_POPUP_START";
|
|
ViewBag.tcUrl = "kcb.tis.ti.cmd.LoginRPCert3Cmd";
|
|
ViewBag.PopupUrl = "https://ipin.ok-name.co.kr/CommonSvl";
|
|
}
|
|
|
|
|
|
JObject reqJson = new JObject();
|
|
reqJson.Add("RETURN_URL", RETURN_URL);
|
|
reqJson.Add("REQ_SITE_NM", REQ_SITE_NM);
|
|
reqJson.Add("REQ_URL", REQ_URL);
|
|
reqJson.Add("RTN_URL", RTN_URL);
|
|
reqJson.Add("SITE_NAME", SITE_NAME);
|
|
reqJson.Add("SITE_URL", SITE_URL);
|
|
reqJson.Add("CHNL_CD", CHNL_CD);
|
|
reqJson.Add("RQST_CAUS_CD", RQST_CAUS_CD);
|
|
reqJson.Add("RETURN_MSG", RETURN_MSG);
|
|
|
|
param = JsonConvert.SerializeObject(reqJson);
|
|
reqJson.RemoveAll();
|
|
reqJson = null;
|
|
|
|
//OkCert3 실행1
|
|
OkCert3 myObject = new OkCert3Com.OkCert3() { };
|
|
//객체생성실패
|
|
if (myObject == null)
|
|
{
|
|
ViewBag.result = null;
|
|
}
|
|
else
|
|
{
|
|
//모듈호출, 결과
|
|
dynamic ret = myObject.callOkCert3(target, CP_CD, svcName, param, license, out object mOut);
|
|
ViewBag.ret = ret;
|
|
|
|
if (ret != 0)
|
|
{
|
|
ViewBag.result = null;
|
|
}
|
|
else
|
|
{
|
|
JObject outputobj = JObject.FromObject(JsonConvert.DeserializeObject(mOut.ToString()));
|
|
RSLT_CD = outputobj["RSLT_CD"].ToString();
|
|
RSLT_MSG = outputobj["RSLT_MSG"].ToString();
|
|
MDL_TKN = outputobj["MDL_TKN"].ToString();
|
|
TX_SEQ_No = outputobj["TX_SEQ_NO"].ToString();
|
|
}
|
|
}
|
|
ViewBag.result = CP_CD + ":" + RSLT_CD + ":" + RSLT_MSG + ":" + MDL_TKN + ":" + TX_SEQ_No;
|
|
return View();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 휴대폰인증 결과
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ActionResult CertOk3MOBI()
|
|
{
|
|
String MDL_TKN = Request["MDL_TKN"];
|
|
String CP_CD = "V47690000000";
|
|
String target = "PROD";
|
|
String svcName = "IDS_HS_POPUP_RESULT";
|
|
String license = "C:\\Windows\\SysWOW64\\" + CP_CD + "_IDS_01_" + target + "_AES_license.dat";
|
|
String TX_SEQ_NO = null;
|
|
String RSLT_CD = null;
|
|
String RSLT_MSG = null;
|
|
|
|
String RSLT_NAME = null;
|
|
String RSLT_BIRTHDAY = null;
|
|
String RSLT_SEX_CD = null;
|
|
String RSLT_NTV_FRNR_CD = null;
|
|
String DI = null;
|
|
String CI = null;
|
|
String CI_UPDATE = null;
|
|
String TEL_COM_CD = null;
|
|
String TEL_NO = null;
|
|
String RETURN_MSG = null;
|
|
|
|
JObject reqJson = new JObject();
|
|
JObject outputobj = new JObject();
|
|
reqJson.Add("MDL_TKN", MDL_TKN);
|
|
|
|
String param = JsonConvert.SerializeObject(reqJson);
|
|
reqJson.RemoveAll();
|
|
reqJson = null;
|
|
|
|
OkCert3 myObject = new OkCert3Com.OkCert3() { };
|
|
if (myObject == null)
|
|
{
|
|
RETURN_MSG = null;
|
|
}
|
|
else
|
|
{
|
|
dynamic ret = myObject.callOkCert3(target, CP_CD, svcName, param, license, out object mOut);
|
|
ViewBag.ret = ret;
|
|
myObject = null;
|
|
|
|
outputobj = JObject.FromObject(JsonConvert.DeserializeObject(mOut.ToString()));
|
|
TX_SEQ_NO = outputobj["TX_SEQ_NO"].ToString();
|
|
RSLT_CD = outputobj["RSLT_CD"].ToString();
|
|
RSLT_MSG = outputobj["RSLT_MSG"].ToString();
|
|
RETURN_MSG = outputobj["RETURN_MSG"].ToString();
|
|
|
|
if (RSLT_CD == "B000")
|
|
{
|
|
RSLT_NAME = outputobj["RSLT_NAME"].ToString();
|
|
RSLT_BIRTHDAY = outputobj["RSLT_BIRTHDAY"].ToString();
|
|
RSLT_SEX_CD = outputobj["RSLT_SEX_CD"].ToString();
|
|
RSLT_NTV_FRNR_CD = outputobj["RSLT_NTV_FRNR_CD"].ToString();
|
|
DI = outputobj["DI"].ToString();
|
|
CI = outputobj["CI"].ToString();
|
|
CI_UPDATE = outputobj["CI_UPDATE"].ToString();
|
|
TEL_COM_CD = outputobj["TEL_COM_CD"].ToString();
|
|
TEL_NO = outputobj["TEL_NO"].ToString();
|
|
//Users users = new Users()
|
|
//{
|
|
// username = RSLT_NAME,
|
|
// birthday = RSLT_BIRTHDAY,
|
|
// di=DI,
|
|
// mobile = TEL_NO,
|
|
// jointype=0
|
|
//};
|
|
TEL_NO = string.IsNullOrEmpty(TEL_NO) || TEL_NO.Replace("-", "").Length < 10 ? (TEL_NO ?? "") : TEL_NO.Replace("-", "").Length == 10 ? string.Format("{0}-{1}-{2}", TEL_NO.Replace("-", "").Substring(0, 3), TEL_NO.Replace("-", "").Substring(3, 3), TEL_NO.Replace("-", "").Substring(6)) : string.Format("{0}-{1}-{2}", TEL_NO.Replace("-", "").Substring(0, 3), TEL_NO.Replace("-", "").Substring(3, 4), TEL_NO.Replace("-", "").Substring(7));
|
|
if (!string.IsNullOrEmpty(TEL_NO))
|
|
{
|
|
IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO } });
|
|
if (chk.Count() > 0)
|
|
{
|
|
RSLT_CD = "U000";
|
|
RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다.";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
RSLT_CD = "U001";
|
|
RSLT_MSG = "휴대폰 번호 오류";
|
|
}
|
|
}
|
|
outputobj = null;
|
|
mOut = null;
|
|
ViewBag.result = CP_CD + ":" + TX_SEQ_NO + ":" + RSLT_CD + ":" + RSLT_MSG + ":"
|
|
+ RSLT_NAME + ":" + RSLT_BIRTHDAY + ":" + RSLT_SEX_CD + ":" + RSLT_NTV_FRNR_CD + ":"
|
|
+ DI + ":" + CI + ":" + CI_UPDATE + ":" + TEL_COM_CD + ":"
|
|
+ TEL_NO + ":" + RETURN_MSG;
|
|
Dao.Save("sys.kcblog.in", new System.Collections.Hashtable() { { "cp_cd", CP_CD }, { "mobile", TEL_NO }, { "logmsg", "RSLT_CD:" + RSLT_CD + "&RSLT_MSG:" + RSLT_MSG } });
|
|
}
|
|
return View();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 휴대폰인증 결과
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ActionResult CertOk3MCHK()
|
|
{
|
|
String MDL_TKN = Request["MDL_TKN"];
|
|
String CP_CD = "V47690000000";
|
|
String target = "PROD";
|
|
String svcName = "IDS_HS_POPUP_RESULT";
|
|
String license = "C:\\Windows\\SysWOW64\\" + CP_CD + "_IDS_01_" + target + "_AES_license.dat";
|
|
String TX_SEQ_NO = null;
|
|
String RSLT_CD = null;
|
|
String RSLT_MSG = null;
|
|
|
|
String RSLT_NAME = null;
|
|
String RSLT_BIRTHDAY = null;
|
|
String RSLT_SEX_CD = null;
|
|
String RSLT_NTV_FRNR_CD = null;
|
|
String DI = null;
|
|
String CI = null;
|
|
String CI_UPDATE = null;
|
|
String TEL_COM_CD = null;
|
|
String TEL_NO = null;
|
|
String RETURN_MSG = null;
|
|
|
|
JObject reqJson = new JObject();
|
|
JObject outputobj = new JObject();
|
|
reqJson.Add("MDL_TKN", MDL_TKN);
|
|
|
|
String param = JsonConvert.SerializeObject(reqJson);
|
|
reqJson.RemoveAll();
|
|
reqJson = null;
|
|
|
|
OkCert3 myObject = new OkCert3Com.OkCert3() { };
|
|
if (myObject == null)
|
|
{
|
|
RETURN_MSG = null;
|
|
}
|
|
else
|
|
{
|
|
dynamic ret = myObject.callOkCert3(target, CP_CD, svcName, param, license, out object mOut);
|
|
ViewBag.ret = ret;
|
|
myObject = null;
|
|
|
|
outputobj = JObject.FromObject(JsonConvert.DeserializeObject(mOut.ToString()));
|
|
TX_SEQ_NO = outputobj["TX_SEQ_NO"].ToString();
|
|
RSLT_CD = outputobj["RSLT_CD"].ToString();
|
|
RSLT_MSG = outputobj["RSLT_MSG"].ToString();
|
|
RETURN_MSG = outputobj["RETURN_MSG"].ToString();
|
|
|
|
if (RSLT_CD == "B000")
|
|
{
|
|
RSLT_NAME = outputobj["RSLT_NAME"].ToString();
|
|
RSLT_BIRTHDAY = outputobj["RSLT_BIRTHDAY"].ToString();
|
|
RSLT_SEX_CD = outputobj["RSLT_SEX_CD"].ToString();
|
|
RSLT_NTV_FRNR_CD = outputobj["RSLT_NTV_FRNR_CD"].ToString();
|
|
DI = outputobj["DI"].ToString();
|
|
CI = outputobj["CI"].ToString();
|
|
CI_UPDATE = outputobj["CI_UPDATE"].ToString();
|
|
TEL_COM_CD = outputobj["TEL_COM_CD"].ToString();
|
|
TEL_NO = outputobj["TEL_NO"].ToString();
|
|
//Users users = new Users()
|
|
//{
|
|
// username = RSLT_NAME,
|
|
// birthday = RSLT_BIRTHDAY,
|
|
// di=DI,
|
|
// mobile = TEL_NO,
|
|
// jointype=0
|
|
//};
|
|
TEL_NO = string.IsNullOrEmpty(TEL_NO) || TEL_NO.Replace("-", "").Length < 10 ? (TEL_NO ?? "") : TEL_NO.Replace("-", "").Length == 10 ? string.Format("{0}-{1}-{2}", TEL_NO.Replace("-", "").Substring(0, 3), TEL_NO.Replace("-", "").Substring(3, 3), TEL_NO.Replace("-", "").Substring(6)) : string.Format("{0}-{1}-{2}", TEL_NO.Replace("-", "").Substring(0, 3), TEL_NO.Replace("-", "").Substring(3, 4), TEL_NO.Replace("-", "").Substring(7));
|
|
if (!string.IsNullOrEmpty(TEL_NO))
|
|
{
|
|
//정보수정시 본인제외 체크를 위해 usernonot추가
|
|
IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO },{ "usernonot",SUserInfo.UserNo} });
|
|
if (chk.Count() > 0)
|
|
{
|
|
RSLT_CD = "U000";
|
|
RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다.";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
RSLT_CD = "U001";
|
|
RSLT_MSG = "휴대폰 번호 오류";
|
|
}
|
|
}
|
|
outputobj = null;
|
|
mOut = null;
|
|
ViewBag.result = CP_CD + ":" + TX_SEQ_NO + ":" + RSLT_CD + ":" + RSLT_MSG + ":"
|
|
+ RSLT_NAME + ":" + RSLT_BIRTHDAY + ":" + RSLT_SEX_CD + ":" + RSLT_NTV_FRNR_CD + ":"
|
|
+ DI + ":" + CI + ":" + CI_UPDATE + ":" + TEL_COM_CD + ":"
|
|
+ TEL_NO + ":" + RETURN_MSG;
|
|
Dao.Save("sys.kcblog.in", new System.Collections.Hashtable() { { "cp_cd", CP_CD }, { "mobile", TEL_NO }, { "logmsg", "RSLT_CD:" + RSLT_CD + "&RSLT_MSG:" + RSLT_MSG } });
|
|
}
|
|
return View();
|
|
}
|
|
|
|
/// <summary>
|
|
/// IPIN인증 결과
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ActionResult CertOk3IPIN()
|
|
{
|
|
String MDL_TKN = Request["MDL_TKN"];
|
|
String CP_CD = "V47690000000";
|
|
String target = "PROD";
|
|
String svcName = "TIS_IPIN_POPUP_RESULT";
|
|
String license = "C:\\Windows\\SysWOW64\\" + CP_CD + "_TIS_01_" + target + "_AES_license.dat";
|
|
String TX_SEQ_NO = null;
|
|
String RSLT_CD = null;
|
|
String RSLT_MSG = null;
|
|
|
|
String RSLT_NAME = null;
|
|
String RSLT_BIRTHDAY = null;
|
|
String RSLT_SEX_CD = null;
|
|
String RSLT_NTV_FRNR_CD = null;
|
|
String DI = null;
|
|
String CI = null;
|
|
String CI_UPDATE = null;
|
|
String VSSN = null;
|
|
String RETURN_MSG = null;
|
|
|
|
JObject reqJson = new JObject();
|
|
JObject outputobj = new JObject();
|
|
reqJson.Add("MDL_TKN", MDL_TKN);
|
|
|
|
String param = JsonConvert.SerializeObject(reqJson);
|
|
reqJson.RemoveAll();
|
|
reqJson = null;
|
|
|
|
OkCert3 myObject = new OkCert3Com.OkCert3() { };
|
|
if (myObject == null)
|
|
{
|
|
RETURN_MSG = null;
|
|
}
|
|
else
|
|
{
|
|
dynamic ret = myObject.callOkCert3(target, CP_CD, svcName, param, license, out object mOut);
|
|
ViewBag.ret = ret;
|
|
myObject = null;
|
|
|
|
outputobj = JObject.FromObject(JsonConvert.DeserializeObject(mOut.ToString()));
|
|
TX_SEQ_NO = outputobj["TX_SEQ_NO"].ToString();
|
|
RSLT_CD = outputobj["RSLT_CD"].ToString();
|
|
RSLT_MSG = outputobj["RSLT_MSG"].ToString();
|
|
RETURN_MSG = outputobj["RETURN_MSG"].ToString();
|
|
|
|
if (RSLT_CD == "T000")
|
|
{
|
|
RSLT_NAME = outputobj["RSLT_NAME"].ToString();
|
|
RSLT_BIRTHDAY = outputobj["RSLT_BIRTHDAY"].ToString();
|
|
RSLT_SEX_CD = outputobj["RSLT_SEX_CD"].ToString();
|
|
RSLT_NTV_FRNR_CD = outputobj["RSLT_NTV_FRNR_CD"].ToString();
|
|
DI = outputobj["DI"].ToString();
|
|
CI = outputobj["CI"].ToString();
|
|
CI_UPDATE = outputobj["CI_UPDATE"].ToString();
|
|
VSSN = outputobj["VSSN"].ToString();
|
|
//Users users = new Users()
|
|
//{
|
|
// username = RSLT_NAME,
|
|
// birthday = RSLT_BIRTHDAY,
|
|
// di = DI,
|
|
// ci = CI,
|
|
// vssn = VSSN,
|
|
// jointype = 0
|
|
//};
|
|
if (!string.IsNullOrEmpty(VSSN))
|
|
{
|
|
IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "vssn", VSSN } });
|
|
if (chk.Count() > 0)
|
|
{
|
|
RSLT_CD = "U000";
|
|
RSLT_MSG = "이미 해당 ipin으로 등록된 회원이 존재합니다.";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
RSLT_CD = "U001";
|
|
RSLT_MSG = "ipin 번호 오류";
|
|
}
|
|
}
|
|
outputobj = null;
|
|
mOut = null;
|
|
ViewBag.result = CP_CD + ":" + TX_SEQ_NO + ":" + RSLT_CD + ":" + RSLT_MSG + ":"
|
|
+ RSLT_NAME + ":" + RSLT_BIRTHDAY + ":" + RSLT_SEX_CD + ":" + RSLT_NTV_FRNR_CD + ":"
|
|
+ DI + ":" + CI + ":" + CI_UPDATE + ":" + VSSN + ":"
|
|
+ RETURN_MSG;
|
|
//vm.stringval = "CP_CD:" + CP_CD + "&RSLT_CD:" + RSLT_CD + "&RSLT_MSG:" + RSLT_MSG;
|
|
Dao.Save("sys.kcblog.in", new System.Collections.Hashtable() { {"cp_cd",CP_CD },{"vssn", VSSN}, { "logmsg", "RSLT_CD:" + RSLT_CD + "&RSLT_MSG:" + RSLT_MSG } });
|
|
}
|
|
return View();
|
|
}
|
|
}
|
|
} |