This commit is contained in:
hodong13 2020-11-24 08:34:18 +00:00
parent eac0ca56cc
commit 097d8eabf3
19 changed files with 884 additions and 645 deletions

View File

@ -817,7 +817,7 @@ create table paydata (
,cardquota varchar(2) ,cardquota varchar(2)
,cardquotatype tinyint not null ,cardquotatype tinyint not null
,cardeventcode varchar(30) ,cardeventcode varchar(30)
,cardnum varchar(50) ,cardnum varbinary(200)
,iscardpoint tinyint not null ,iscardpoint tinyint not null
,cardcode varchar (10) ,cardcode varchar (10)
,cardbankcode varchar (10) ,cardbankcode varchar (10)

View File

@ -1588,10 +1588,11 @@
</isNotEmpty> </isNotEmpty>
</select> </select>
<select id="cm.cms.forpay" parameterClass="hashtable" resultClass="cm"> <select id="cm.cms.forpay" parameterClass="hashtable" resultClass="cm">
select c.cmno,case when b.isjoin=1 then c.infee else c.outfee end fee,b.isjoin select c.cmno,case when b.isjoin=1 then c.infee else c.infee end fee,b.isjoin,d.lectno lectnocheck
from users a from users a
left outer join assign b on b.asno=a.asno left outer join assign b on b.asno=a.asno
inner join cm c on c.cmno=#cmno# inner join cm c on c.cmno=#cmno#
left outer join lect d on d.userno=a.userno and d.cmno=c.cmno and d.status in (1,2,3,4,6) and d.ischanged=0
where a.userno=#userno# where a.userno=#userno#
</select> </select>
<select id="cm.cms.forpaypc" parameterClass="hashtable" resultClass="cm"> <select id="cm.cms.forpaypc" parameterClass="hashtable" resultClass="cm">

View File

@ -34,8 +34,8 @@
<selectKey type="post" property="payno" resultClass="long">SELECT LAST_INSERT_ID()</selectKey> <selectKey type="post" property="payno" resultClass="long">SELECT LAST_INSERT_ID()</selectKey>
</insert> </insert>
<insert id="pay.payitem.in" parameterClass="payitem"> <insert id="pay.payitem.in" parameterClass="payitem">
insert into payitem (payno,ptype,pcno,itemno,userno,pstatus,rstatus,pcnt,orgamt,discamt,payamt,payamtcash,payamtcard,refundamt,refundtime,refundtimereal,refundinfo,isrebate,<include refid="sql.inc"></include>) insert into payitem (payno,ptype,pcno,itemno,userno,pstatus,rstatus,pcnt,orgamt,discamt,payamt,payamtcash,payamtcard,refundamt,refundtime,refundtimereal,refundinfo,isrebate,rbank,rbankaccnum,tbankuser,<include refid="sql.inc"></include>)
values(#payno#,#ptype#,#pcno#,#itemno#,#userno#,#pstatus#,#rstatus#,#pcnt#,#orgamt#,#discamt#,#payamt#,#payamtcash#,#payamtcard#,#refundamt#,#refundtime#,#refundtimereal#,#refundinfo#,#isrebate#,<include refid="sql.inv"></include>); values(#payno#,#ptype#,#pcno#,#itemno#,#userno#,#pstatus#,#rstatus#,#pcnt#,#orgamt#,#discamt#,#payamt#,#payamtcash#,#payamtcard#,#refundamt#,#refundtime#,#refundtimereal#,#refundinfo#,#isrebate#,#rbank#,#rbankaccnum#,#tbankuser#,<include refid="sql.inv"></include>);
<selectKey type="post" property="pino" resultClass="long">SELECT LAST_INSERT_ID()</selectKey> <selectKey type="post" property="pino" resultClass="long">SELECT LAST_INSERT_ID()</selectKey>
</insert> </insert>
<insert id="pay.lect.in" parameterClass="payitem"> <insert id="pay.lect.in" parameterClass="payitem">
@ -289,8 +289,10 @@
where a.payno=#payno# and a.userno=#userno# and a.pstatus=21; where a.payno=#payno# and a.userno=#userno# and a.pstatus=21;
</update> </update>
<select id="pay.pay" parameterClass="hashtable" resultClass="pay"> <select id="pay.pay" parameterClass="hashtable" resultClass="pay">
select a.payno,a.ptype,a.isgroup,a.isexam,a.userno,a.pstatus,a.payamt,a.rstatus,a.refundamt,a.ispg select a.payno,a.ptype,a.isgroup,a.isexam,a.userno,a.pstatus,a.payamt,a.rstatus,a.refundamt,a.ispg,a.paylimit
,b.isready
from pay a from pay a
left outer join pplog b on b.pplno=a.pplno
<dynamic prepend="where"> <dynamic prepend="where">
<isNotNull property="payno" prepend="and">a.payno=#payno#</isNotNull> <isNotNull property="payno" prepend="and">a.payno=#payno#</isNotNull>
<isNotNull property="userno" prepend="and">a.userno=#userno#</isNotNull> <isNotNull property="userno" prepend="and">a.userno=#userno#</isNotNull>
@ -320,17 +322,18 @@
,ispc,isjoin,fgno,apoint,mpoint ,ispc,isjoin,fgno,apoint,mpoint
,fpoint,spoint,dpoint,tpoint,ischanged ,fpoint,spoint,dpoint,tpoint,ischanged
,stime,etime,sip,eip,ispcs ,stime,etime,sip,eip,ispcs
,ispce,fgno2,<include refid="sql.inc"></include>) ,ispce,fgno2,cmisno,<include refid="sql.inc"></include>)
select a.itemno,a.payno,a.pino,case when b.isgroup=1 then a.userno else b.userno end select a.itemno,a.payno,a.pino,case when b.isgroup=1 then a.userno else b.userno end
,case when b.ptype=3 then 2 else 1 end,null,null,0,a.isrebate ,case when b.ptype=3 then 2 else 1 end,null,null,0,a.isrebate
,0,ifnull(d.isjoin, 0),null,null,null ,0,ifnull(d.isjoin, 0),null,null,null
,null,null,null,null,0 ,null,null,null,null,0
,null,null,null,null,null ,null,null,null,null,null
,null,a.fgno,<include refid="sql.inv"></include> ,null,a.fgno,e.cmisno,<include refid="sql.inv"></include>
from payitem a from payitem a
inner join pay b on b.payno=a.payno inner join pay b on b.payno=a.payno
inner join users c on c.userno=b.userno inner join users c on c.userno=b.userno
left outer join assign d on d.asno=c.asno left outer join assign d on d.asno=c.asno
left outer join pplog e on e.pplno=b.pplno
where a.payno=#payno# and a.ptype=0; where a.payno=#payno# and a.ptype=0;
update lect a update lect a
@ -339,7 +342,7 @@
set a.status=case when b.pstatus=22 then 2 else 1 end,a.uno=#uno#,a.uip=#uip# set a.status=case when b.pstatus=22 then 2 else 1 end,a.uno=#uno#,a.uip=#uip#
where a.payno=#payno# and a.status=4; where a.payno=#payno# and a.status=4;
update examuser a <!--update examuser a
inner join pay b on b.isexam=1 and b.payno=#payno# and b.pstatus in (22,1) inner join pay b on b.isexam=1 and b.payno=#payno# and b.pstatus in (22,1)
inner join payitem c on c.payno=b.payno and c.ptype=3 and c.itemno=a.exno and c.pstatus=b.pstatus inner join payitem c on c.payno=b.payno and c.ptype=3 and c.itemno=a.exno and c.pstatus=b.pstatus
set a.payno=b.payno,a.pstatus=case when b.pstatus=22 then 2 else 1 end,a.uno=#uno#,a.uip=#uip# set a.payno=b.payno,a.pstatus=case when b.pstatus=22 then 2 else 1 end,a.uno=#uno#,a.uip=#uip#
@ -349,7 +352,7 @@
inner join pay b on b.isexam=2 and b.payno=#payno# and b.pstatus in (22,1) inner join pay b on b.isexam=2 and b.payno=#payno# and b.pstatus in (22,1)
inner join payitem c on c.payno=b.payno and c.ptype=case when a.ptype=9 then 2 else a.ptype end and c.itemno=a.itemno and c.pstatus=b.pstatus inner join payitem c on c.payno=b.payno and c.ptype=case when a.ptype=9 then 2 else a.ptype end and c.itemno=a.itemno and c.pstatus=b.pstatus
set a.status=3,c.cartno=a.pcno,a.uno=#uno#,a.uip=#uip# set a.status=3,c.cartno=a.pcno,a.uno=#uno#,a.uip=#uip#
where a.userno=#userno# and a.status=1 and a.ispay=1; where a.userno=#userno# and a.status=1 and a.ispay=1;-->
</update> </update>
<update id="pay.pay.fail" parameterClass="hashtable"> <update id="pay.pay.fail" parameterClass="hashtable">
update pay set pstatus=#pstatus# where payno=#payno#; update pay set pstatus=#pstatus# where payno=#payno#;
@ -379,11 +382,11 @@
,a.status=1 ,a.status=1
where a.payno=#payno#; where a.payno=#payno#;
update examuser a <!--update examuser a
inner join pay b on b.isexam=1 and b.payno=a.payno and b.pstatus=1 <!--and b.pgkey=#pgkey#--> inner join pay b on b.isexam=1 and b.payno=a.payno and b.pstatus=1 --><!--and b.pgkey=#pgkey#--><!--
set a.udt=now(),a.uno=#uno#,a.uip=#uip# set a.udt=now(),a.uno=#uno#,a.uip=#uip#
,a.pstatus=1 ,a.pstatus=1
where a.payno=#payno#; where a.payno=#payno#;-->
</update> </update>
<select id="pay.payitems" parameterClass="long" resultClass="payitemresult"> <select id="pay.payitems" parameterClass="long" resultClass="payitemresult">
@ -395,7 +398,7 @@
,CAST(AES_DECRYPT(UNHEX(ad.email), <include refid="sql.digest"></include>) AS char) email ,CAST(AES_DECRYPT(UNHEX(ad.email), <include refid="sql.digest"></include>) AS char) email
,ad.post,ad.address1,ad.address2 ,ad.post,ad.address1,ad.address2
,a.ptype ptype2,a.payamt,a.pcnt,a.isrebate ,a.ptype ptype2,a.payamt,a.pcnt,a.isrebate,a.itemno
,b.cmno,b.cshape,b.sstime,b.setime ,b.cmno,b.cshape,b.sstime,b.setime
,b1.rsno ,b1.rsno
,b2.username,cc.cname ccpositionname,b2.isassignuser ,b2.username,cc.cname ccpositionname,b2.isassignuser
@ -478,14 +481,17 @@
select a.payno,a.isgroup,a.pstatus ppstatus,a.rstatus prstatus select a.payno,a.isgroup,a.pstatus ppstatus,a.rstatus prstatus
,b.pino,b.ptype,b.pcno,b.itemno,b.userno,b.pstatus,b.rstatus,b.isrebate ,b.pino,b.ptype,b.pcno,b.itemno,b.userno,b.pstatus,b.rstatus,b.isrebate
,c.cname,c.classno,c.rstime,c.retime,c.sstime,c.setime,c.cshape,c.isrefund ,c.cname,c.classno,c.rstime,c.retime,c.sstime,c.setime,c.cshape,c.isrefund
,cc.cname studyplacename
,d.tyear,d.tseq ,d.tyear,d.tseq
,u.username ,u.username
,ua.asname ,ua.asname
,uc.cname ccpositionname ,uc.cname ccpositionname
,CAST(AES_DECRYPT(UNHEX(u.email), <include refid="sql.digest"></include>) AS char) email ,CAST(AES_DECRYPT(UNHEX(u.email), <include refid="sql.digest"></include>) AS char) email
,case when max(e.rfdno) &gt; 0 then 1 else 0 end rfdstatus ,case when max(e.rfdno) &gt; 0 then 1 else 0 end rfdstatus
,lect.cmisno
,cmis.estart cmiestart,cmis.eend cmieend
from pay a from pay a
inner join payitem b on b.payno=a.payno and b.ptype in (0,1,4) and b.pstatus in (1,21,22,51) inner join payitem b on b.payno=a.payno and b.ptype in (0,1,4) and b.pstatus in (1,21,22,51,55)
inner join cm c on c.cmno=b.itemno and c.rstime &lt; now() and c.sstime &gt; now() inner join cm c on c.cmno=b.itemno and c.rstime &lt; now() and c.sstime &gt; now()
inner join term d on d.tmno=c.tmno inner join term d on d.tmno=c.tmno
inner join users u on u.userno=b.userno inner join users u on u.userno=b.userno
@ -493,21 +499,27 @@
left outer join comcode uc on uc.ccode=u.ccposition left outer join comcode uc on uc.ccode=u.ccposition
left outer join payrfditem e0 on e0.pino=b.pino left outer join payrfditem e0 on e0.pino=b.pino
left outer join payrfd e on e.rfdno=e0.rfdno and e.payno=a.payno and e.rstatus=0 left outer join payrfd e on e.rfdno=e0.rfdno and e.payno=a.payno and e.rstatus=0
where a.userno=#userno# and a.pstatus in (1,21,22,51) left outer join comcode cc on cc.ccode=c.studyplace
left outer join lect lect on lect.pino=b.pino and lect.ischanged=0
left outer join cminningscd cmis on cmis.cmisno=lect.cmisno
where a.userno=#userno# and a.pstatus in (1,21,22,51,55)
group by a.payno,a.isgroup,a.pstatus,a.rstatus group by a.payno,a.isgroup,a.pstatus,a.rstatus
,b.pino,b.ptype,b.pcno,b.itemno,b.userno,b.pstatus,b.rstatus,b.isrebate ,b.pino,b.ptype,b.pcno,b.itemno,b.userno,b.pstatus,b.rstatus,b.isrebate
,c.cname,c.classno,c.rstime,c.retime,c.sstime,c.setime,c.cshape ,c.cname,c.classno,c.rstime,c.retime,c.sstime,c.setime,c.cshape
,cc.cname
,d.tyear,d.tseq ,d.tyear,d.tseq
,u.username ,u.username
,ua.asname ,ua.asname
,uc.cname ,uc.cname
,u.email ,u.email
,lect.cmisno
,cmis.estart,cmis.eend
order by c.retime,a.payno,b.pino order by c.retime,a.payno,b.pino
</select> </select>
<update id="pay.paycancel" parameterClass="hashtable"> <update id="pay.paycancel" parameterClass="hashtable">
update pay set <include refid="sql.up"></include> update pay set <include refid="sql.up"></include>
,pstatus=case when pstatus=22 then 43 else 41 end ,pstatus=case when pstatus=22 then 43 else 41 end
where payno=#payno# and userno=#userno# and pstatus in (51,21,22); where payno=#payno# and userno=#userno# and pstatus in (51,55,21,22);
update payitem a update payitem a
inner join pay b on b.payno=a.payno and b.userno=#userno# and b.pstatus in (41,43) inner join pay b on b.payno=a.payno and b.userno=#userno# and b.pstatus in (41,43)
@ -648,7 +660,7 @@
left outer join exam c3 on a.ptype=3 and c3.exno=a.itemno left outer join exam c3 on a.ptype=3 and c3.exno=a.itemno
left outer join users u on u.userno=a.userno left outer join users u on u.userno=a.userno
left outer join assign ua on ua.asno=u.asno left outer join assign ua on ua.asno=u.asno
left outer join comcode uc on uc.ccode=u.ccposition left outer join comcode uc on uc.ccode=u.ccpositionc
left outer join cmrs rs on rs.cmno=c0.cmno and rs.rstype=1 and rs.isdel=0 left outer join cmrs rs on rs.cmno=c0.cmno and rs.rstype=1 and rs.isdel=0
left outer join lect t on a.ptype in (0,1,4) and t.cmno=c0.cmno and t.payno=a.payno and t.pino=a.pino and t.userno=a.userno left outer join lect t on a.ptype in (0,1,4) and t.cmno=c0.cmno and t.payno=a.payno and t.pino=a.pino and t.userno=a.userno
where a.payno=#payno# where a.payno=#payno#
@ -850,7 +862,7 @@
</update> </update>
<select id="pay.pplogs" parameterClass="hashtable" resultClass="pplog"> <select id="pay.pplogs" parameterClass="hashtable" resultClass="pplog">
select a.pplno,a.isready,a.cmno,a.cmisno,a.isrebate,a.rbankname,a.rbankacc,a.rbankowner select a.pplno,a.isready,a.cmno,a.cmisno,a.isrebate,a.rbankname,a.rbankacc,a.rbankowner
,b.payno ,b.payno,b.pstatus
from pplog a from pplog a
left outer join pay b on b.pplno=a.pplno left outer join pay b on b.pplno=a.pplno
<dynamic prepend="where"> <dynamic prepend="where">
@ -863,7 +875,12 @@
,b.itemno ,b.itemno
from pay a from pay a
inner join payitem b on b.payno=a.payno inner join payitem b on b.payno=a.payno
where a.payno=#payno# and a.userno=#userno# and a.ptype &gt; 0 and a.pstatus in (1,22,55) where a.payno=#payno# and a.userno=#userno# and a.pstatus in (1,22,55)
</select>
<select id="pay.lectready" parameterClass="int" resultClass="int">
select count(a.userno)
from lect a
where a.cmno=#cmno# and a.isready=1 and a.status=6
</select> </select>
</statements> </statements>
</sqlMap> </sqlMap>

View File

@ -12,6 +12,8 @@ using Newtonsoft.Json.Linq;
using Newtonsoft.Json; using Newtonsoft.Json;
using OkCert3Com; using OkCert3Com;
using XPayClientNet;
namespace NP.FO.Controllers namespace NP.FO.Controllers
{ {
public class AccountController : FOOpenBaseController public class AccountController : FOOpenBaseController
@ -842,5 +844,154 @@ namespace NP.FO.Controllers
{ {
return View(); return View();
} }
public String XPayVBankMoney()
{
var x = new Xpay();
x.LGD_RESPCODE = Request.Params.Get("LGD_RESPCODE");
x.LGD_RESPMSG = Request.Params.Get("LGD_RESPMSG");
x.LGD_MID = Request.Params.Get("LGD_MID");
x.LGD_OID = Request.Params.Get("LGD_OID");
x.LGD_AMOUNT = Request.Params.Get("LGD_AMOUNT");
x.LGD_TID = Request.Params.Get("LGD_TID");
x.LGD_PAYTYPE = Request.Params.Get("LGD_PAYTYPE");
x.LGD_PAYDATE = Request.Params.Get("LGD_PAYDATE");
x.LGD_HASHDATA = Request.Params.Get("LGD_HASHDATA");
x.LGD_FINANCECODE = Request.Params.Get("LGD_FINANCECODE");
x.LGD_FINANCENAME = Request.Params.Get("LGD_FINANCENAME");
x.LGD_ESCROWYN = Request.Params.Get("LGD_ESCROWYN");
x.LGD_TIMESTAMP = Request.Params.Get("LGD_TIMESTAMP");
x.LGD_ACCOUNTNUM = Request.Params.Get("LGD_ACCOUNTNUM");
x.LGD_CASTAMOUNT = Request.Params.Get("LGD_CASTAMOUNT");
x.LGD_CASCAMOUNT = Request.Params.Get("LGD_CASCAMOUNT");
x.LGD_CASFLAG = Request.Params.Get("LGD_CASFLAG");
x.LGD_CASSEQNO = Request.Params.Get("LGD_CASSEQNO");
x.LGD_CASHRECEIPTNUM = Request.Params.Get("LGD_CASHRECEIPTNUM");
x.LGD_CASHRECEIPTSELFYN = Request.Params.Get("LGD_CASHRECEIPTSELFYN");
x.LGD_CASHRECEIPTKIND = Request.Params.Get("LGD_CASHRECEIPTKIND");
x.LGD_PAYER = Request.Params.Get("LGD_PAYER");
x.LGD_BUYER = Request.Params.Get("LGD_BUYER");
x.LGD_PRODUCTINFO = Request.Params.Get("LGD_PRODUCTINFO");
x.LGD_BUYERID = Request.Params.Get("LGD_BUYERID");
x.LGD_BUYERADDRESS = Request.Params.Get("LGD_BUYERADDRESS");
x.LGD_BUYERPHONE = Request.Params.Get("LGD_BUYERPHONE");
x.LGD_BUYEREMAIL = Request.Params.Get("LGD_BUYEREMAIL");
x.LGD_BUYERSSN = Request.Params.Get("LGD_BUYERSSN");
x.LGD_PRODUCTCODE = Request.Params.Get("LGD_PRODUCTCODE");
x.LGD_RECEIVER = Request.Params.Get("LGD_RECEIVER");
x.LGD_RECEIVERPHONE = Request.Params.Get("LGD_RECEIVERPHONE");
x.LGD_DELIVERYINFO = Request.Params.Get("LGD_DELIVERYINFO");
x.CST_PLATFORM = GetConfig("CST_PLATFORM");
/*
' *************************************************
' * 2. MD5 ( ) - BEGIN
' *
' * MD5 .
' *************************************************
' * (1) XpayClient의 xpay
' * (2) XPayClient ( )
' CST_PLATFORM: - test, service lgdacom.conf의 test_url(test) url(srvice)
' - test, service
' * (3) Init_TX: mall.conf, lgdacom.conf TXID
' * MD5
' * LG유플러스에서 (MertKey) (lgdacom/conf/mall.conf) .
' */
//* LGD_HASHDATA2 추출 /////////////////////
x.configPath = GetConfig("lgdacomConfigPath");
// (1) XpayClient의 사용을 위한 xpay 객체 생성
XPayClient xpay = new XPayClient();
// (2) Init: XPayClient 초기화(환경설정 파일 로드)
// configPath: 설정파일
// CST_PLATFORM: - test, service 값에 따라 lgdacom.conf의 test_url(test) 또는 url(srvice) 사용
// - test, service 값에 따라 테스트용 또는 서비스용 아이디 생성
xpay.Init(x.configPath, x.CST_PLATFORM);
try
{
// (3) Init_TX: 메모리에 mall.conf, lgdacom.conf 할당 및 트랜잭션의 고유한 키 TXID 생성
xpay.Init_TX(x.LGD_MID);
x.LGD_HASHDATA2 = xpay.GetHashDataCas(x.LGD_MID, x.LGD_OID, x.LGD_AMOUNT, x.LGD_RESPCODE, x.LGD_TIMESTAMP);
}
catch (Exception err)
{
SetError("가상계좌입금오류(LGD_HASHDATA2 추출 오류): " + err.StackTrace);
return "FAIL";
}
/*
*
*
* OK :
* :
*
* : 'OK' .
*/
String resultMSG = "결제결과 상점 DB처리(LGD_CASNOTEURL) 결과값을 입력해 주시기 바랍니다.";
if (x.LGD_HASHDATA2.Equals(x.LGD_HASHDATA))
{ //해쉬값 검증이 성공이면
if (("0000".Equals(x.LGD_RESPCODE)))
{ //결제가 성공이면
if ("R".Equals(x.LGD_CASFLAG))
{
return "OK";
}
else if ("I".Equals(x.LGD_CASFLAG))
{
/*
* (DB)
* "OK"
*/
//if( 무통장 입금 성공 상점처리결과 성공 )
var payvbankin = new PayVBankIn()
{
payno = GetLong(x.LGD_OID.Substring(2)),
uno = 1,
uip = GetUserIP(),
pgkey = x.LGD_TID,
inbankcode = x.LGD_FINANCECODE,
vacct = x.LGD_ACCOUNTNUM,
inamt = GetInt(x.LGD_CASTAMOUNT),
fromname = x.LGD_PAYER,
fromymd = x.LGD_PAYDATE
};
if (Dao.Save("pay.paylect.vbankin", payvbankin) < 3)
{
//상품구매완료 처리 (최소 3건 업데이트 (payvbankin, pay)
return "FAIL";
}
return "OK";
}
else if ("C".Equals(x.LGD_CASFLAG))
{
/*
* (DB)
* "OK"
*/
//if( 무통장 입금취소 성공 상점처리결과 성공 )
return "OK";
}
}
else
{ //결제가 실패이면
/*
* (DB)
* "OK"
*/
//if( 결제실패 상점처리결과 성공 )
return "FAIL";
}
}
else
{ //해쉬값이 검증이 실패이면
/*
* hashdata검증 .
*/
SetError("가상계좌입금오류(결제결과 상점 DB처리(LGD_CASNOTEURL) 해쉬값 검증이 실패): " + x.LGD_OID);
}
return "FAIL";
}
} }
} }

View File

@ -843,7 +843,7 @@ namespace NP.FO.Controllers
{ {
return Redirect("/"); return Redirect("/");
} }
if (vm.PPLog.payno > 0) if (vm.PPLog.payno > 0 && vm.PPLog.pstatus > 0)
{ {
//새로고침? //새로고침?
return RedirectPermanent("/Course/ApplyComplete?payno=" + vm.PPLog.payno); return RedirectPermanent("/Course/ApplyComplete?payno=" + vm.PPLog.payno);
@ -855,12 +855,16 @@ namespace NP.FO.Controllers
var uip = GetUserIP(); var uip = GetUserIP();
payitems.Add(new PayItem() payitems.Add(new PayItem()
{ {
itemno = vm.cmno, itemno = vm.PPLog.cmno,
userno = SUserInfo.UserNo, userno = SUserInfo.UserNo,
status = 6, status = 6,
pstatus = 55, pstatus = 55,
pcnt = 1, pcnt = 1,
payamt = 0, payamt = 0,
isrebate = vm.PPLog.isrebate ?? 0,
rbank = vm.PPLog.rbankname,
rbankaccnum = vm.PPLog.rbankacc,
tbankuser = vm.PPLog.rbankowner,
isready = 1, isready = 1,
cmisno = vm.PPLog.cmisno, cmisno = vm.PPLog.cmisno,
uno = SUserInfo.UserNo, uno = SUserInfo.UserNo,
@ -868,12 +872,16 @@ namespace NP.FO.Controllers
}); });
//정가확인 //정가확인
var cms = Dao.Get<CM>("cm.cms.forpay", new Hashtable() { { "userno", SUserInfo.UserNo }, { "cmno", vm.PPLog.cmno } }); var cms = Dao.Get<CM>("cm.cms.forpay", new Hashtable() { { "userno", SUserInfo.UserNo }, { "cmno", vm.PPLog.cmno } });
if (cms.First().lectnocheck > 0)
{
return RedirectPermanent("/?isalreadyreq=1");
}
var pi = payitems.First(); var pi = payitems.First();
pi.orgamt = cms.Where(w => w.cmno == pi.itemno).First().fee; pi.orgamt = cms.Where(w => w.cmno == pi.itemno).First().fee;
var pay = new Pay() var pay = new Pay()
{ {
pplno = vm.pplno, pplno = vm.pplno,
ptype = 7, ptype = 0,
userno = SUserInfo.UserNo, userno = SUserInfo.UserNo,
pstatus = 55, pstatus = 55,
rstatus = 0, rstatus = 0,
@ -895,10 +903,11 @@ namespace NP.FO.Controllers
} }
vm.CM = Dao.Get<CM>("cm.cms", new System.Collections.Hashtable() { { "cmno", vm.PPLog.cmno } }).First(); vm.CM = Dao.Get<CM>("cm.cms", new System.Collections.Hashtable() { { "cmno", vm.PPLog.cmno } }).First();
vm.User = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).First(); vm.User = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).First();
vm.viewname4 = "/Course/OnPayReturn";
return View(vm); return View(vm);
} }
public ActionResult ApplyComplete(VMCourse vm) public ActionResult ApplyComplete(VMPay vm)
{ {
if (vm.payno < 1) if (vm.payno < 1)
{ {
@ -906,7 +915,12 @@ namespace NP.FO.Controllers
} }
vm.PayItem = Dao.Get<PayItem>("pay.payresult", new Hashtable() { { "payno", vm.payno }, { "userno", SUserInfo.UserNo } }).First(); vm.PayItem = Dao.Get<PayItem>("pay.payresult", new Hashtable() { { "payno", vm.payno }, { "userno", SUserInfo.UserNo } }).First();
vm.CM = Dao.Get<CM>("cm.cms", new System.Collections.Hashtable() { { "cmno", vm.PayItem.itemno } }).FirstOrDefault(); vm.CM = Dao.Get<CM>("cm.cms", new System.Collections.Hashtable() { { "cmno", vm.PayItem.itemno } }).FirstOrDefault();
vm.Pay = Dao.Get<Pay>("pay.pay", new System.Collections.Hashtable() { { "payno", vm.payno }, { "userno", SUserInfo.UserNo } }).FirstOrDefault();
if (vm.Pay.isready == 1)
{
vm.Pay.ccount = Dao.Get<int?>("pay.lectready", vm.CM.cmno).FirstOrDefault() ?? 1;
}
vm.Pay.payresult = "1:결제완료";
return View(vm); return View(vm);
} }
public ActionResult XpayREQ(VMPay vm) public ActionResult XpayREQ(VMPay vm)
@ -937,11 +951,21 @@ namespace NP.FO.Controllers
vm.payParams.Add("LGD_CASNOTEURL", GetConfig("LGD_CASNOTEURL")); vm.payParams.Add("LGD_CASNOTEURL", GetConfig("LGD_CASNOTEURL"));
vm.payParams.Add("LGD_AUTOFILLYN_BUYER", GetConfig("LGD_AUTOFILLYN_BUYER")); vm.payParams.Add("LGD_AUTOFILLYN_BUYER", GetConfig("LGD_AUTOFILLYN_BUYER"));
vm.payParams.Add("LGD_ESCROW_USEYN", GetConfig("LGD_ESCROW_USEYN")); vm.payParams.Add("LGD_ESCROW_USEYN", GetConfig("LGD_ESCROW_USEYN"));
vm.payParams.Add("LGD_CASHRECEIPTYN", GetConfig("LGD_CASHRECEIPTYN"));
vm.payParams.Add("LGD_DOMAIN_URL", "xpayvvip"); vm.payParams.Add("LGD_DOMAIN_URL", "xpayvvip");
vm.payParams.Add("LGD_CUSTOM_PROCESSTYPE", "TWOTR"); vm.payParams.Add("LGD_CUSTOM_PROCESSTYPE", "TWOTR");
//vm.payParams.Add("LGD_CASHRECEIPTYN", GetConfig("LGD_CASHRECEIPTYN"));
vm.payParams.Add("LGD_CASHRECEIPTYN", "N");
if (Request["ptype"] == "3") if (Request["ptype"] == "3")
{ {
if (Request["iscashrct"] == "1")
{
vm.payParams["LGD_CASHRECEIPTYN"] = "Y";
vm.payParams.Add("LGD_DEFAULTCASHRECEIPTUSE", "1");
vm.payParams.Add("LGD_CASHRECEIPTUSE", "1");
vm.payParams.Add("LGD_CASHRECEIPTNUM", "1");
vm.payParams.Add("LGD_CASHCARDNUM", Request["cashrcthp"]);
}
vm.payParams.Add("LGD_CLOSEDATE", Request["LGD_CLOSEDATE"]); vm.payParams.Add("LGD_CLOSEDATE", Request["LGD_CLOSEDATE"]);
} }
String OSTYPE = Request["LGD_OSTYPE_CHECK"]; String OSTYPE = Request["LGD_OSTYPE_CHECK"];
@ -1049,6 +1073,7 @@ namespace NP.FO.Controllers
//nptech 추가 파라미터 //nptech 추가 파라미터
vm.payParams.Add("items", Request["items"]); vm.payParams.Add("items", Request["items"]);
vm.payParams.Add("pplno", Request["pplno"]);
vm.payParams.Add("rsMsg", ""); vm.payParams.Add("rsMsg", "");
Session.Add("PAYREQ_MAP", vm.payParams); Session.Add("PAYREQ_MAP", vm.payParams);

View File

@ -6,6 +6,10 @@ using System.Web.Mvc;
using NP.Model; using NP.Model;
using NP.Base.Auth; using NP.Base.Auth;
using XPayClientNet;
using System.Security.Cryptography;
using System.Text;
namespace NP.FO.Controllers namespace NP.FO.Controllers
{ {
public class FOBaseController : NP.Base.BaseController public class FOBaseController : NP.Base.BaseController
@ -43,6 +47,10 @@ namespace NP.FO.Controllers
} }
//여기서 로그 남겨? //여기서 로그 남겨?
base.OnActionExecuting(filterContext); base.OnActionExecuting(filterContext);
if (Request.Cookies["yicte"] != null && !string.IsNullOrEmpty(Request.Cookies["yicte"].Value))
{
Response.Cookies["yicte"].Value = Request.Cookies["yicte"].Value + ";SameSite=None; Secure";
}
var cm = new Model.MenuPage() { }; var cm = new Model.MenuPage() { };
//if (Request.Url.AbsolutePath.ToUpper().StartsWith("/DIVISION/A")) //if (Request.Url.AbsolutePath.ToUpper().StartsWith("/DIVISION/A"))
//{ //{
@ -451,129 +459,110 @@ namespace NP.FO.Controllers
//} //}
protected ActionResult PayReturn(VMPay vm) protected ActionResult PayReturn(VMPay vm)
{ {
if (vm.payno > 0 && vm.absptype == 6) if (vm.payno > 0 && (vm.absptype == 6 || vm.absptype == 7))
{ {
//0원강좌 결제 //0원강좌 결제
vm.Pay = new Pay() { payno = vm.payno, ptype = vm.absptype, oid2 = "free" + vm.payno }; vm.Pay = new Pay() { payno = vm.payno, ptype = vm.absptype, oid2 = (vm.absptype == 6 ? "free" : string.Empty) + vm.payno };
vm.PayItemResults = Dao.Get<PayItemResult>("pay.payitems", vm.Pay.payno); vm.PayItemResults = Dao.Get<PayItemResult>("pay.payitems", vm.Pay.payno);
} }
else else
{ {
if (string.IsNullOrEmpty(Request["P_NOTI"])) vm.Pay = new Pay();
{ /*
ViewBag.OffCode = OffCode; * .
System.Collections.Specialized.NameValueCollection parameters = Request.Params; * .
System.Collections.IEnumerator enumerator = parameters.GetEnumerator(); * ) [Window ] C:\inetpub\wwwroot\lgdacom ==> ( )
System.Text.StringBuilder sb = new System.Text.StringBuilder("paramMap : "); */
while (enumerator.MoveNext()) String configPath = GetConfig("lgdacomConfigPath"); //토스페이먼츠에서 제공한 환경파일 위치를 지정해 주세요.
{
string key = enumerator.Current.ToString(); /*
sb.Append(string.Format("{0}={1}&", key, HttpUtility.UrlEncode(parameters[key]))); * [ (STEP2-2)]
} *
//##################### * "5.1. XPay 결제 요청 페이지 개발" "단계 5. 최종 결제 요청 및 요청 결과 처리"
// 인증이 성공일 경우만 *
//##################### * LGD_PAYKEY(Key) .( POST를 )
vm.Pay = new Pay() { payno = GetLong(parameters["orderNumber"].Substring(2)), uno = SUserInfo.UserNo, uip = GetUserIP() }; */
if ("0000".Equals(parameters["resultCode"]))
{ /*
var pginfo = GetConfig("pginfo").Split('|'); *************************************************
//############################################ * 1. ( ) - BEGIN
// 1.전문 필드 값 설정(***가맹점 개발수정***) * (, .)
//############################################ *************************************************
String mid = parameters.Get("mid"); // 가맹점 ID 수신 받은 데이터로 설정 */
Int64 oid = GetLong(parameters["orderNumber"].Substring(2));//주문번호 np + payno String CST_PLATFORM = Request.Params.Get("CST_PLATFORM");
String signKey = pginfo[2]; // 가맹점에 제공된 키(이니라이트키) (가맹점 수정후 고정) !!!절대!! 전문 데이터로 설정금지 String CST_MID = Request.Params.Get("CST_MID");
string timeTemp = "" + DateTime.UtcNow.Subtract(DateTime.MinValue.AddYears(1969)).TotalMilliseconds; String LGD_MID = (("test".Equals(CST_PLATFORM.Trim())) ? "t" : "") + CST_MID;
string[] artime = timeTemp.Split('.'); String LGD_PAYKEY = Request.Params.Get("LGD_PAYKEY");
String timestamp = artime[0]; String LGD_CLOSEDATE = Request.Params.Get("LGD_CLOSEDATE");
String charset = "UTF-8"; // 리턴형식[UTF-8,EUC-KR](가맹점 수정후 고정) //String DB_AMOUNT = ""; //반드시 위변조가 불가능한 곳(DB나 세션)에서 금액을 가져오십시요.
String format = "JSON"; // 리턴형식[XML,JSON,NVP](가맹점 수정후 고정)
String authToken = parameters.Get("authToken"); // 취소 요청 tid에 따라서 유동적(가맹점 수정후 고정) // (1) XpayClient의 사용을 위한 xpay 객체 생성
String authUrl = parameters.Get("authUrl"); // 승인요청 API url(수신 받은 값으로 설정, 임의 세팅 금지) XPayClient xpay = new XPayClient();
String netCancel = parameters.Get("netCancelUrl"); // 망취소 API url(수신 받은 값으로 설정, 임의 세팅 금지)
String mKey = ComputeHash(signKey); // 가맹점 확인을 위한 signKey를 해시값으로 변경 (SHA-256방식 사용) // (2) Init: XPayClient 초기화(환경설정 파일 로드)
String merchantData = parameters.Get("merchantData"); // 가맹점 관리데이터 수신 // configPath: 설정파일
//##################### // CST_PLATFORM: - test, service 값에 따라 lgdacom.conf의 test_url(test) 또는 url(srvice) 사용
// 2.signature 생성 // - test, service 값에 따라 테스트용 또는 서비스용 아이디 생성
//##################### xpay.Init(configPath, CST_PLATFORM);
String signParam = "authToken=" + @authToken + "&timestamp=" + timestamp;
String signature = ComputeHash(signParam);
//#####################
// 3.API 요청 전문 생성
//#####################
System.Collections.Generic.Dictionary<String, String> authMap = new System.Collections.Generic.Dictionary<String, String>();
authMap.Add("mid", mid); // 필수
authMap.Add("authToken", HttpUtility.UrlEncode(authToken)); // 필수 - 반드시 urlencode 해서 전달.
authMap.Add("timestamp", timestamp); // 필수
authMap.Add("signature", signature); // 필수
authMap.Add("charset", charset); // default=UTF-8
authMap.Add("format", format); // default=XML
authMap.Add("mkey", mKey); // default=XML
String cancelMsg = "결제오류|" + oid;
vm.Pay.payno = oid; //이거 확인 MOID?
try try
{ {
//##################### // (3) Init_TX: 메모리에 mall.conf, lgdacom.conf 할당 및 트랜잭션의 고유한 키 TXID 생성
// 4.API 통신 시작 xpay.Init_TX(LGD_MID);
//##################### xpay.Set("LGD_TXNAME", "PaymentByKey");
String authResultString = ""; xpay.Set("LGD_PAYKEY", LGD_PAYKEY);
authResultString = processHTTP(authMap, authUrl);
//############################################################
//5.API 통신결과 처리(***가맹점 개발수정***)
//############################################################
String strReplace = authResultString.Replace(",", "&").Replace(":", "=").Replace("\"", "").Replace(" ", "").Replace("\n", "").Replace("}", "").Replace("{", "");
System.Collections.Generic.Dictionary<string, string> resultMap = parseStringToMap(strReplace); //문자열을 MAP형식으로 파싱
/************************* 결제보안 추가 START ****************************/
Dictionary<String, String> secureMap = new Dictionary<String, String>();
if (resultMap["resultCode"] == "R201")
{
vm.Pay.payresult = "1:결제완료";
//기결제 건(새로고침)
vm.Pay.oid2 = pginfo[4] + vm.Pay.payno;
vm.PayItemResults = Dao.Get<PayItemResult>("pay.payitems", vm.Pay.payno);
return View("PayReturn", vm);
}
secureMap.Add("mid", mid); //mid
secureMap.Add("tstamp", timestamp); //timestemp
secureMap.Add("MOID", resultMap["MOID"]); //MOID
secureMap.Add("TotPrice", resultMap["TotPrice"]); //TotPrice
vm.Pay.pgkey = (resultMap.ContainsKey("tid") ? resultMap["tid"] : "null");
vm.Pay.ptype = "Card".Equals(resultMap.ContainsKey("payMethod") ? resultMap["payMethod"] : "") ? 1 : "DirectBank".Equals(resultMap.ContainsKey("payMethod") ? resultMap["payMethod"] : "") ? 2 : 3;
vm.Pay.payamt = GetInt(resultMap.ContainsKey("TotPrice") ? resultMap["TotPrice"] : "0");
vm.Pay.payno = GetLong((resultMap.ContainsKey("MOID") ? resultMap["MOID"] : "np0").Substring(2));
//(resultMap.ContainsKey("applDate") ? resultMap["applDate"] : "null") //승인날짜
//(resultMap.ContainsKey("applTime") ? resultMap["applTime"] : "null")//승인시간
// signature 데이터 생성 //금액을 체크하시기 원하는 경우 아래 주석을 풀어서 이용하십시요.
String secureSignature = makeSignatureAuth(secureMap); //xpay.Set("LGD_AMOUNTCHECKYN", "Y");
/************************* 결제보안 추가 END ****************************/ //xpay.Set("LGD_AMOUNT", DB_AMOUNT);
if ("0000".Equals((resultMap.ContainsKey("resultCode") ? resultMap["resultCode"] : "null")) && secureSignature.Equals(resultMap["authSignature"])) //결제보안 추가
}
catch (Exception err)
{ {
/***************************************************************************** SetError("환경파일의 경로가 잘못 되었습니다. configPath의 경로를 확인해 주시기 바랍니다." + "|" + err.StackTrace);
* DB에 . vm.Pay.payresult = "0:호출실패";
[중요!] DB에 vm.Pay.cancelresult = "환경파일의 경로가 잘못 되었습니다. configPath의 경로를 확인해 주시기 바랍니다.";
. }
******************************************************************************/ /*
vm.Pay = Dao.Get<Pay>("pay.pay", new System.Collections.Hashtable() { { "payno", oid }, { "userno", SUserInfo.UserNo }, { "pstatus21", 0 } }).FirstOrDefault(); *************************************************
* 1. ( ) - END
*************************************************
*/
/*
* 2.
*
* .
*/
// (4) TX: lgdacom.conf에 설정된 URL로 소켓 통신하여 최종 인증요청, 결과값으로 true, false 리턴
if (xpay.TX())
{
Int64 payno = GetLong(xpay.Response("LGD_OID", 0).Substring(2));
//1)결제결과 화면처리(성공,실패 결과 처리를 하시기 바랍니다.
vm.Pay = new Pay() { payno = payno, uno = SUserInfo.UserNo, uip = GetUserIP() };
String cancelMsg = "결제오류|" + payno;
// (5) DB에 인증요청 결과 처리
if ("0000".Equals(xpay.m_szResCode))
{
try
{
//통신상의 문제가 없을시
//최종결제요청 결과 성공 DB처리(LGD_RESPCODE 값에 따라 결제가 성공인지, 실패인지 DB처리)
vm.Pay = Dao.Get<Pay>("pay.pay", new System.Collections.Hashtable() { { "payno", payno }, { "userno", SUserInfo.UserNo }, { "pstatus21", 0 } }).FirstOrDefault();
if (vm.Pay == null) if (vm.Pay == null)
{ {
vm.Pay = new Pay() { payno = oid, uno = SUserInfo.UserNo, uip = GetUserIP() }; vm.Pay = new Pay() { payno = payno, uno = SUserInfo.UserNo, uip = GetUserIP() };
vm.Pay.payresult = "0:결제상품 오류(E1)"; vm.Pay.payresult = "0:결제상품 오류(E1)";
cancelMsg += "|결제상품 오류(E1)"; cancelMsg += "|결제상품 오류(E1)";
vm.Pay = new Pay() { payno = oid, uno = SUserInfo.UserNo, uip = GetUserIP() }; vm.Pay = new Pay() { payno = payno, uno = SUserInfo.UserNo, uip = GetUserIP() };
throw new Exception("결제상품 오류(E1)"); throw new Exception("결제상품 오류(E1)");
} }
else else
{ {
vm.Pay.uno = SUserInfo.UserNo; vm.Pay.uno = SUserInfo.UserNo;
vm.Pay.uip = GetUserIP(); vm.Pay.uip = GetUserIP();
//if (vm.Pay.ptypecode != (resultMap.ContainsKey("payMethod") ? resultMap["payMethod"] : "x")) if (vm.Pay.payamt != GetInt((xpay.Response("LGD_AMOUNT", 0) ?? "").Replace(",", "")))
//{
// vm.Pay.payresult = "0:결제방식 오류(E2)";
// cancelMsg += "|결제방식 오류(E2)";
// throw new Exception("결제방식 오류(E2)");
//}
if (vm.Pay.payamt != GetInt((resultMap["TotPrice"] ?? "").Replace(",", "")))
{ {
vm.Pay.payresult = "0:결제금액 오류(E3)"; vm.Pay.payresult = "0:결제금액 오류(E3)";
cancelMsg += "|결제금액 오류(E3)"; cancelMsg += "|결제금액 오류(E3)";
@ -583,58 +572,37 @@ namespace NP.FO.Controllers
{ {
if (vm.Pay.ptype == 3) if (vm.Pay.ptype == 3)
{ //가상계좌 { //가상계좌
vm.Pay.vactnum = resultMap.ContainsKey("VACT_Num") ? resultMap["VACT_Num"] : null; vm.Pay.vactnum = xpay.Response("LGD_ACCOUNTNUM", 0);
vm.Pay.vactbankcode = resultMap.ContainsKey("VACT_BankCode") ? resultMap["VACT_BankCode"] : null; vm.Pay.vactbankcode = xpay.Response("LGD_FINANCECODE", 0);
vm.Pay.vactbankname = resultMap.ContainsKey("vactBankName") ? resultMap["vactBankName"] : null; vm.Pay.vactbankname = xpay.Response("LGD_FINANCENAME", 0);
vm.Pay.vactname = resultMap.ContainsKey("VACT_Name") ? resultMap["VACT_Name"] : null; vm.Pay.vactname = xpay.Response("LGD_SAOWNER", 0);
vm.Pay.vactinname = resultMap.ContainsKey("VACT_InputName") ? resultMap["VACT_InputName"] : null; vm.Pay.vactinname = xpay.Response("LGD_PAYER", 0);
//resultMap.ContainsKey("VACT_Date") ? resultMap["VACT_Date"] : "null" 송금일자 확인, 송금 전인데? //vm.Pay.paylimit = Convert.ToDateTime(xpay.Response("LGD_CLOSEDATE", 0));
//resultMap.ContainsKey("VACT_Time") ? resultMap["VACT_Date"] : "null" 송금시간 확인, 송금 전인데?
} }
else if (vm.Pay.ptype == 2) else if (vm.Pay.ptype == 2)
{ //실시간계좌이체 { //실시간계좌이체
vm.Pay.vactbankcode = resultMap.ContainsKey("ACCT_BankCode") ? resultMap["ACCT_BankCode"] : null; vm.Pay.vactbankcode = xpay.Response("LGD_FINANCECODE", 0);
vm.Pay.cshrrcode = resultMap.ContainsKey("CSHR_ResultCode") ? resultMap["CSHR_ResultCode"] : null; vm.Pay.cshrtype = xpay.Response("LGD_CASHRECEIPTKIND", 0);
vm.Pay.cshrtype = resultMap.ContainsKey("CSHR_Type") ? resultMap["CSHR_Type"] : null; vm.Pay.cshrauthno = xpay.Response("LGD_CASHRECEIPTNUM", 0);
} }
else else
{//카드 {//카드
vm.Pay.cardquota = resultMap.ContainsKey("CARD_Quota") ? resultMap["CARD_Quota"] : null; vm.Pay.cardquota = xpay.Response("LGD_CARDINSTALLMONTH", 0);
int quota = Convert.ToInt16((resultMap.ContainsKey("CARD_Quota") ? resultMap["CARD_Quota"] : "01")); if (!"00".Equals(xpay.Response("LGD_CARDINSTALLMONTH", 0)) && "1".Equals(xpay.Response("LGD_CARDNOINTYN", 0)))
if ("1".Equals((resultMap.ContainsKey("CARD_Interest") ? resultMap["CARD_Interest"] : "null"))
|| "1".Equals((resultMap.ContainsKey("EventCode") ? resultMap["EventCode"] : "null")))
{ {
vm.Pay.cardquotatype = 1; vm.Pay.cardquotatype = 1;
} }
vm.Pay.cardeventcode = resultMap.ContainsKey("EventCode") ? resultMap["EventCode"] : null; vm.Pay.cardnum = xpay.Response("LGD_CARDNUM", 0);
vm.Pay.cardnum = resultMap.ContainsKey("CARD_Num") ? resultMap["CARD_Num"] : null; vm.Pay.iscardpoint = vm.Pay.cardquota.Count() == 4 ? 1 : 0; // 포인트 사용 시 할부개월 + 포인트별로 숫자 두개가 붙음, 즉 4개면 포인트 사용했다는 뜻
vm.Pay.iscardpoint = "1".Equals((resultMap.ContainsKey("point") ? resultMap["point"] : "null")) ? 1 : 0; vm.Pay.cardcode = xpay.Response("LGD_FINANCECODE", 0);
vm.Pay.cardcode = resultMap.ContainsKey("CARD_Code") ? resultMap["CARD_Code"] : null; vm.Pay.cardbankcode = xpay.Response("LGD_CARDACQUIRER", 0);
vm.Pay.cardbankcode = resultMap.ContainsKey("CARD_BankCode") ? resultMap["CARD_BankCode"] : null; vm.Pay.cardprtccode = xpay.Response("LGD_PCANCELFLAG", 0);
vm.Pay.cardprtccode = resultMap.ContainsKey("CARD_PRTC_CODE") ? resultMap["CARD_PRTC_CODE"] : null; vm.Pay.checkflag = xpay.Response("LGD_CARDGUBUN2", 0);
vm.Pay.checkflag = resultMap.ContainsKey("CARD_CheckFlag") ? resultMap["CARD_CheckFlag"] : null;
if ((resultMap.ContainsKey("OCB_Num") ? resultMap["OCB_Num"] : "null") != null && (resultMap.ContainsKey("OCB_Num") ? resultMap["OCB_Num"] : "null") != "")
{
vm.Pay.ocbnum = resultMap.ContainsKey("OCB_Num") ? resultMap["OCB_Num"] : null;
vm.Pay.ocbappno = resultMap.ContainsKey("OCB_SaveApplNum") ? resultMap["OCB_SaveApplNum"] : null;
vm.Pay.ocbprice = resultMap.ContainsKey("OCB_PayPrice") ? resultMap["OCB_PayPrice"] : null;
} }
if ((resultMap.ContainsKey("GSPT_Num") ? resultMap["GSPT_Num"] : "null") != null && (resultMap.ContainsKey("GSPT_Num") ? resultMap["GSPT_Num"] : "null") != "") vm.Pay.payresult = xpay.Response("LGD_RESPCODE", 0);
{ vm.Pay.payresultmsg = xpay.Response("LGD_RESPMSG", 0);
vm.Pay.gsnum = resultMap.ContainsKey("GSPT_Num") ? resultMap["GSPT_Num"] : null; vm.Pay.pgkey = xpay.Response("LGD_TID", 0);
vm.Pay.gsremain = resultMap.ContainsKey("GSPT_Remains") ? resultMap["GSPT_Remains"] : null; vm.Pay.mid = LGD_MID;
vm.Pay.gsprice = resultMap.ContainsKey("GSPT_ApplPrice") ? resultMap["GSPT_ApplPrice"] : null;
}
if ((resultMap.ContainsKey("UNPT_CardNum") ? resultMap["UNPT_CardNum"] : "null") != null && (resultMap.ContainsKey("UNPT_CardNum") ? resultMap["UNPT_CardNum"] : "null") != "")
{
vm.Pay.unum = resultMap.ContainsKey("UNPT_CardNum") ? resultMap["UNPT_CardNum"] : null;
vm.Pay.upoint = resultMap.ContainsKey("UPNT_UsablePoint") ? resultMap["UPNT_UsablePoint"] : null;
vm.Pay.uprice = resultMap.ContainsKey("UPNT_PayPrice") ? resultMap["UPNT_PayPrice"] : null;
}
}
vm.Pay.payresult = resultMap.ContainsKey("resultCode") ? resultMap["resultCode"] : null;
vm.Pay.payresultmsg = resultMap.ContainsKey("resultMsg") ? resultMap["resultMsg"] : null;
vm.Pay.pgkey = resultMap.ContainsKey("tid") ? resultMap["tid"] : null;
vm.Pay.uno = SUserInfo.UserNo; vm.Pay.uno = SUserInfo.UserNo;
vm.Pay.uip = GetUserIP(); vm.Pay.uip = GetUserIP();
//상품구매완료 처리 (최소 3건 업데이트 (pay, paydata, payitem) //상품구매완료 처리 (최소 3건 업데이트 (pay, paydata, payitem)
@ -645,387 +613,97 @@ namespace NP.FO.Controllers
throw new Exception("구매완료 실패(E4)"); throw new Exception("구매완료 실패(E4)");
} }
vm.Pay.payresult = "1:결제완료"; vm.Pay.payresult = "1:결제완료";
//if (GetConfig("ispaytest") == "1" && vm.Pay.ptype != 3)
//{
// vm.Pay.payresult = "1:구매완료 성공 개발단 망취소(S1)";
// String netcancelResultString = processHTTP(authMap, netCancel); // 망취소 요청 API url(고정, 임의 세팅 금지)
//}
try try
{ {
vm.Pay.oid2 = pginfo[4] + vm.Pay.payno; vm.Pay.oid2 = GetConfig("PAYMENT_CLASSIFICATION") + vm.Pay.payno;
vm.PayItemResults = Dao.Get<PayItemResult>("pay.payitems", vm.Pay.payno); vm.PayItemResults = Dao.Get<PayItemResult>("pay.payitems", vm.Pay.payno);
vm.PayItem = Dao.Get<PayItem>("pay.payresult", new System.Collections.Hashtable() { { "payno", vm.Pay.payno }, { "userno", SUserInfo.UserNo } }).First();
vm.Pay.pstatus = vm.Pay.ptype == 1 ? 1 : 22;
vm.CM = Dao.Get<CM>("cm.cms", new System.Collections.Hashtable() { { "cmno", vm.PayItemResults.First().itemno } }).FirstOrDefault();
} }
catch (Exception exresult) catch (Exception exresult)
{ {
SetError(exresult.StackTrace); SetError(exresult.StackTrace);
} }
} #region
} String authdata = vm.Pay.mid + vm.Pay.pgkey + GetConfig("LGD_MERTKEY");
//System.Collections.Generic.Dictionary<string, string> checkMap = new System.Collections.Generic.Dictionary<string, string>(); HashAlgorithm hash;
//checkMap.Add("mid", mid); // 필수 byte[] authdataTextBytes = Encoding.UTF8.GetBytes(authdata);
//checkMap.Add("authToken", HttpUtility.UrlEncode(authToken)); // 필수 - 반드시 urlencode 해서 전달. hash = new MD5CryptoServiceProvider();
//checkMap.Add("applDate", (resultMap.ContainsKey("applDate") ? resultMap["applDate"] : "null")); // 필수 byte[] hashed = hash.ComputeHash(authdataTextBytes);
//checkMap.Add("applTime", (resultMap.ContainsKey("applTime") ? resultMap["applTime"] : "null")); // 필수 for (int i = 0; i < hashed.Length; i++)
//checkMap.Add("timestamp", timestamp); // 필수
//checkMap.Add("signature", signature); // 필수
//checkMap.Add("charset", charset); // default=UTF-8
//checkMap.Add("format", format); // default=XML
}
else
{ {
vm.Pay.payresult = resultMap.ContainsKey("resultMsg") ? ("0:" + resultMap["resultMsg"]) : "0:결제취소"; vm.Pay.authdata += string.Format("{0:x2}", hashed[i]);
vm.Pay.cancelresult = resultMap.ContainsKey("resultCode") ? resultMap["resultCode"] : "";
//결제보안키가 다른 경우.
if (!secureSignature.Equals(resultMap["authSignature"]) && "0000".Equals((resultMap.ContainsKey("resultCode") ? resultMap["resultCode"] : "null")))
{
cancelMsg += "|보안키오류(E41)";
vm.Pay.payresult = "0:보안키오류(E41)";
//망취소
if ("0000".Equals((resultMap.ContainsKey("resultCode") ? resultMap["resultCode"] : "null")))
{
vm.Pay.payresult = "0:데이터 위변조 에크 오류(E42)";
cancelMsg += "|데이터위변조 체크 실패(E42)";
throw new Exception("데이터 위변조 체크 실패");
} }
else #endregion
{
try
{
Dao.Save("pay.pay.fail", new System.Collections.Hashtable() { {"payno", oid },{"pstatus", 66 },
{ "payresult", (resultMap.ContainsKey("resultCode") ? resultMap["resultCode"] : "").Substring(0, 100)},
{"payresultmsg", (resultMap.ContainsKey("resultCode") ? resultMap["resultCode"] : "").Substring(0, 100) },{ "uno", SUserInfo.UserNo},{"uip", GetUserIP() } });
}
catch (Exception ex2)
{
SetError(cancelMsg += "|" + (cancelMsg ?? "") + "|" + ex2.StackTrace);
} }
} }
} }
else
{
vm.Pay.payresult = "0:결제오류(기타)(E44)";
try
{
Dao.Save("pay.pay.fail", new System.Collections.Hashtable() { {"payno", oid },{"pstatus", 66 },
{ "payresult", (resultMap.ContainsKey("resultCode") ? resultMap["resultCode"] : "").Substring(0, 100)},
{"payresultmsg", (resultMap.ContainsKey("resultCode") ? resultMap["resultCode"] : "").Substring(0, 100) },{ "uno", SUserInfo.UserNo},{"uip", GetUserIP() } });
}
catch (Exception ex2)
{
SetError(cancelMsg += "|" + (cancelMsg ?? "") + "|" + ex2.StackTrace);
}
}
}
// 수신결과를 파싱후 resultCode가 "0000"이면 승인성공 이외 실패
// 가맹점에서 스스로 파싱후 내부 DB 처리 후 화면에 결과 표시
// payViewType을 popup으로 해서 결제를 하셨을 경우
// 내부처리후 스크립트를 이용해 opener의 화면 전환처리를 하세요
//throw new Exception("강제 Exception");
}
catch (Exception ex) catch (Exception ex)
{ {
//#################################### //망취소
// 실패시 처리(***가맹점 개발수정***) xpay.Rollback("상점 DB처리 실패로 인하여 Rollback 처리 [TID:" + xpay.Response("LGD_TID", 0) + ",MID:" + xpay.Response("LGD_MID", 0) + ",OID:" + xpay.Response("LGD_OID", 0) + "]");
//####################################
//---- db 저장 실패시 등 예외처리----//
//##################### if ("0000".Equals(xpay.m_szResCode))
// 망취소 API {
//#####################
String netcancelResultString = processHTTP(authMap, netCancel); // 망취소 요청 API url(고정, 임의 세팅 금지)
// 취소 결과 확인
//Response.Write("<p>" + netcancelResultString.Replace("<", "&lt;").Replace(">", "&gt;") + "</p>");
//망취소기록
try try
{ {
vm.Pay.cancelresult = (vm.Pay.cancelresult ?? "") + "|" + netcancelResultString; // 자동취소가 정상적으로 완료 되었을때
vm.Pay.cancelresult = (vm.Pay.cancelresult ?? "") + "|" + xpay.Response("LGD_RESPMSG", 0);
vm.Pay.pstatus = 66; vm.Pay.pstatus = 66;
Dao.Save("pay.pay.fail", vm.Pay); Dao.Save("pay.pay.fail", vm.Pay);
SetError(cancelMsg += "|" + (netcancelResultString ?? "") + "|" + ex.StackTrace); SetError(cancelMsg += "|" + xpay.Response("LGD_RESPMSG", 0) + "|" + ex.StackTrace);
} }
catch (Exception ex2) catch (Exception ex2)
{ {
SetError(cancelMsg += "|" + (netcancelResultString ?? "") + "|" + ex2.StackTrace); SetError(cancelMsg += "|" + xpay.Response("LGD_RESPMSG", 0) + "|" + ex2.StackTrace);
} }
}
else
{
// 자동취소가 정상적으로 처리되지 않았을때
vm.Pay.cancelresult = (vm.Pay.cancelresult ?? "") + "|" + xpay.Response("LGD_RESPMSG", 0);
vm.Pay.pstatus = 66;
Dao.Save("pay.pay.fail", vm.Pay);
SetError(cancelMsg += "|" + xpay.Response("LGD_RESPCODE", 0) + "|" + xpay.Response("LGD_RESPMSG", 0));
}
vm.Pay.payresult = "0:결제중 오류(E101)"; vm.Pay.payresult = "0:결제중 오류(E101)";
} }
} }
else else
{ {
//############# //통신상의 문제 발생(최종결제요청 결과 실패 DB처리)
// 인증 실패시 vm.Pay.payresult = "0:통신상의 문제 발생(" + xpay.Response("LGD_RESPCODE", 0) + ")";
//############# vm.Pay.cancelresult = xpay.Response("LGD_RESPMSG", 0);
vm.Pay.payresult = "0:인증실패"; if ("S007".Equals(xpay.m_szResCode))
vm.Pay.cancelresult = HttpUtility.UrlDecode(sb.ToString()); {
} vm.Pay.cancelresult = "이미 거래시도된 내역입니다.";
} }
else else
{ {
var noti = Request["P_NOTI"];
//모바일
vm.pginfo = GetConfig("pginfo");
vm.IsMobilePay = true;
System.Collections.Specialized.NameValueCollection parameters = Request.Params;
if ("00".Equals(parameters.Get("P_STATUS")))
{
String strReplace = "";
try try
{ {
//데이터베이스 Dao.Save("pay.pay.fail", new System.Collections.Hashtable() { {"payno", payno },{"pstatus", 66 },
System.Collections.Generic.Dictionary<String, String> authMap = new System.Collections.Generic.Dictionary<String, String>(); { "payresult", xpay.Response("LGD_RESPCODE", 0)},
authMap.Add("P_TID", parameters.Get("P_TID"));// 필수 { "payresultmsg", xpay.Response("LGD_RESPMSG", 0) },
authMap.Add("P_MID", vm.pginfo.Split('|')[1]); // 필수 { "uno", SUserInfo.UserNo},{"uip", GetUserIP() } });
//결제승인요청
String authResultString = processHTTP(authMap, parameters.Get("P_REQ_URL"));
strReplace = authResultString.Replace(",", "&").Replace(":", "=").Replace("\"", "").Replace(" ", "").Replace("\n", "").Replace("}", "").Replace("{", "");
System.Collections.Generic.Dictionary<string, string> resultMap = parseStringToMap(strReplace);
if ("00".Equals(resultMap["P_STATUS"]))
{
//db처리
try
{
Int64 oid = GetLong(resultMap["P_OID"].Substring(2));
vm.Pay = Dao.Get<Pay>("pay.pay", new System.Collections.Hashtable() { { "payno", oid }, { "userno", SUserInfo.UserNo } }).FirstOrDefault();
if (vm.Pay == null)
{
vm.Pay = new Pay() { payno = 0, payresultmsg = "주문내역오류입니다." };
throw new Exception("결제상품 오류(E1)");
}
else if (vm.Pay.pstatus == 1 || vm.Pay.pstatus == 22)
{
vm.Pay = new Pay() { payno = 0, payresultmsg = "이미 결제된 주문내역입니다." };
}
else
{
vm.Pay.uno = SUserInfo.UserNo;
vm.Pay.uip = GetUserIP();
if (vm.Pay.payamt != GetInt((resultMap["P_AMT"] ?? "").Replace(",", "")))
{
vm.Pay = new Pay() { payno = 0, payresultmsg = "결제금액 오류입니다." };
throw new Exception("결제금액 오류(E3)");
}
else
{
//if (GetConfig("ispaytest") == "1" && vm.Pay.ptype != 3)
//{
// try
// {
// //개발단 망취소
// System.Collections.Generic.Dictionary<String, String> authMapCancel = new System.Collections.Generic.Dictionary<String, String>();
// authMapCancel.Add("P_TID", parameters.Get("P_TID"));
// authMapCancel.Add("P_MID", vm.pginfo.Split('|')[1]);
// authMapCancel.Add("P_AMT", vm.Pay.payamt.ToString());
// authMapCancel.Add("P_OID", resultMap["P_OID"]);
// authResultString = processHTTP(authMapCancel, parameters.Get("P_REQ_URL").Substring(0, parameters.Get("P_REQ_URL").Length - parameters.Get("P_REQ_URL").Split('/').Last().Length) + "payNetCancel.ini", true);
// strReplace = authResultString.Replace(",", "&").Replace(":", "=").Replace("\"", "").Replace(" ", "").Replace("\n", "").Replace("}", "").Replace("{", "");
// System.Collections.Generic.Dictionary<string, string> resultMapCancel = parseStringToMap(strReplace);
// if ("00".Equals(resultMapCancel["P_STATUS"]))
// {
// Console.WriteLine(resultMapCancel["P_TID"] + ":" + resultMapCancel["P_RMESG1"]);
// }
// else
// {
// Console.WriteLine(EuckrToUtf8(resultMapCancel["P_RMESG1"]));
// }
// }
// catch (Exception excancel)
// {
// SetError(excancel.Message);
// }
//}
if (vm.Pay.ptype == 3)
{
#region
//가상계좌
//"P_STATUS=00&P_AUTH_DT=20190819174235&P_AUTH_NO=&P_RMESG1=성공적으로 처리 하였습니다.&P_RMESG2=
//&P_TID =INIMX_VBNKINIpayTest20190819174235894667&P_FN_CD1=&P_AMT=1000&P_TYPE=VBANK&P_UNAME=npuser1name&P_MID=INIpayTest
//&P_OID=te170&P_NOTI=MOBILE|/OffDetail?cmno=87|170
//&P_NEXT_URL=https://phd.nptc.kr:8080/Course/OffPayReturn&P_MNAME=
//&P_NOTEURL=https://phd.nptc.kr:8080/Account/PayVBankMoney
//&P_VACT_NUM=07500531297112
//&P_VACT_DATE=20190825
//&P_VACT_TIME=235900
//&P_VACT_NAME=(주)케이지이니시
//&P_VACT_BANK_CODE=03
//&P_CSHR_CODE=0000&P_CSHR_MSG=정상처리되었습니다.&P_CSHR_AMT=1000
//&P_CSHR_SUP_AMT=1000&P_CSHR_TAX=0&P_CSHR_SRVC_AMT=0&P_CSHR_TYPE=0&P_CSHR_DT=20190819174235&P_CSHR_AUTH_NO="
#endregion
vm.Pay.vactnum = resultMap["P_VACT_NUM"];
vm.Pay.vactbankcode = resultMap["P_VACT_BANK_CODE"];
vm.Pay.vactbankname = GetBankName(resultMap["P_VACT_BANK_CODE"]);
vm.Pay.vactname = resultMap["P_VACT_NAME"];
//vm.Pay.vactinname = resultMap.ContainsKey("VACT_InputName") ? resultMap["VACT_InputName"] : null; 입금자명 안주네?
}
else if (vm.Pay.ptype == 2)
{
#region
/*
*
P_STATUS=00
P_AUTH_DT =20190820154747
P_AUTH_NO=
P_RMESG1=.
P_RMESG2=
P_TID=INIMX_DBNKINIpayTest20190820154747214066
P_FN_CD1=04
P_AMT=1000
P_TYPE=BANK
P_UNAME=npuser1name
P_MID=INIpayTest
P_OID=te222
P_NOTI=MOBILE|/OffDetail?cmno=87|222
P_NEXT_URL=https=//phd.nptc.kr=8080/Course/OffPayReturn
P_MNAME=
P_NOTEURL=
P_FN_NM=KB국민은행
P_ACCT_NUM=*********58215
P_CSHR_CODE=0000
P_CSHR_MSG=.
P_CSHR_AMT=1000
P_CSHR_SUP_AMT=1000
P_CSHR_TAX=0
P_CSHR_SRVC_AMT=0
P_CSHR_TYPE=0
P_CSHR_DT=20190820154747
P_CSHR_AUTH_NO=266393740
*/
#endregion
vm.Pay.vactnum = resultMap["P_ACCT_NUM"];
vm.Pay.vactbankcode = resultMap["P_FN_CD1"];
vm.Pay.vactbankname = resultMap["P_FN_NM"];
vm.Pay.cshrrcode = resultMap["CSHR_ResultCode"];
vm.Pay.cshrtype = resultMap["CSHR_Type"];
vm.Pay.cshrauthno = resultMap["P_CSHR_AUTH_NO"];
}
else
{
#region
//카드
//P_STATUS=00
//P_AUTH_DT =20190820154214
//P_AUTH_NO =30025104
//P_RMESG1=성공적으로처리하였습니다.
//P_RMESG2=00
//P_TID=INIMX_ISP_INIpayTest20190820154214874779
//P_FN_CD1=06
//P_AMT=1000
//P_TYPE=CARD
//P_UNAME=npuser1name
//P_MID=INIpayTest
//P_OID=te219
//P_NOTI=MOBILE|/OffDetail?cmno=87|219
//P_NEXT_URL=https=//phd.nptc.kr=8080/Course/OffPayReturn
//P_MNAME=
//P_NOTEURL=
//P_CARD_MEMBER_NUM=
//P_CARD_NUM=943646*********7
//P_CARD_ISSUER_CODE=04
//P_CARD_PURCHASE_CODE=06
//P_CARD_PRTC_CODE=1
//P_CARD_INTEREST=0
//P_CARD_CHECKFLAG=1
//P_CARD_ISSUER_NAME=국민카드
//P_CARD_PURCHASE_NAME=국민계열
//P_FN_NM=국민계열
//P_ISP_CARDCODE=000204040015606
//P_CARD_APPLPRICE=1000
#endregion
vm.Pay.cardquota = resultMap["P_RMESG2"];
vm.Pay.cardquotatype = GetInt(resultMap["P_CARD_INTEREST"]);
vm.Pay.cardnum = resultMap["P_CARD_NUM"];
vm.Pay.cardcode = resultMap["P_FN_CD1"];
vm.Pay.cardbankcode = resultMap["P_CARD_ISSUER_CODE"];
vm.Pay.cardprtccode = resultMap["P_CARD_PURCHASE_CODE"];
vm.Pay.checkflag = resultMap["P_CARD_CHECKFLAG"];
vm.Pay.vactname = resultMap["P_AUTH_NO"];
}
vm.Pay.payresult = resultMap["P_STATUS"];
vm.Pay.payresultmsg = resultMap["P_RMESG1"];
vm.Pay.pgkey = resultMap["P_TID"];
vm.Pay.uno = SUserInfo.UserNo;
vm.Pay.uip = GetUserIP();
//상품구매완료 처리 (최소 3건 업데이트 (pay, paydata, payitem)
if (Dao.Save("pay.paylect", vm.Pay) < 3)
{
//vm.Pay.payresult = "0:구매완료 실패(E4)";
vm.Pay = new Pay() { payno = 0, payresultmsg = "상품DB처리 중 오류발생" };
throw new Exception("구매완료 실패(E4)");
}
vm.Pay.payresult = "1:결제완료";
try
{
vm.Pay.oid2 = vm.pginfo.Split('|')[4] + vm.Pay.payno;
vm.PayItemResults = Dao.Get<PayItemResult>("pay.payitems", vm.Pay.payno);
}
catch (Exception exresult)
{
SetError(exresult.StackTrace);
}
return View("PayReturn", vm);
}
}
} }
catch (Exception ex2) catch (Exception ex2)
{ {
SetError("모바일결제오류망취소: " + noti.Split('|')[1] + ": " + ex2.Message); SetError(cancelMsg += "|" + (cancelMsg ?? "") + "|" + ex2.StackTrace);
//망취소요청
try
{
vm.Pay = new Pay() { payno = 0, payresultmsg = "상품 DB처리중 오류발생" };
//개발단 망취소
System.Collections.Generic.Dictionary<String, String> authMapCancel = new System.Collections.Generic.Dictionary<String, String>();
authMapCancel.Add("P_TID", parameters.Get("P_TID"));
authMapCancel.Add("P_MID", vm.pginfo.Split('|')[1]);
authMapCancel.Add("P_AMT", vm.Pay.payamt.ToString());
authMapCancel.Add("P_OID", resultMap["P_OID"]);
authResultString = processHTTP(authMapCancel, parameters.Get("P_REQ_URL").Substring(0, parameters.Get("P_REQ_URL").Length - parameters.Get("P_REQ_URL").Split('/').Last().Length) + "payNetCancel.ini", true);
strReplace = authResultString.Replace(",", "&").Replace(":", "=").Replace("\"", "").Replace(" ", "").Replace("\n", "").Replace("}", "").Replace("{", "");
System.Collections.Generic.Dictionary<string, string> resultMapCancel = parseStringToMap(strReplace);
if ("00".Equals(resultMapCancel["P_STATUS"]))
{
Console.WriteLine(resultMapCancel["P_TID"] + ":" + resultMapCancel["P_RMESG1"]);
}
else
{
SetError("모바일망취소실패2: " + noti.Split('|')[1] + ": " + (resultMapCancel["P_RMESG1"] ?? ""));
} }
} }
catch (Exception ex3)
{
SetError("모바일망취소실패1: " + noti.Split('|')[1] + ": " + ex2.Message);
}
}
vm.Pay = new Pay() { payno = 1, payresultmsg = Request["P_RMESG1"] };
}
else
{
//Dictionary<String, String> secureMap = new Dictionary<String, String>();
//if (resultMap["resultCode"] == "R201")
//{
vm.Pay = new Pay() { payno = GetLong(Request["P_NOTI"].Split('|')[2]), oid2 = GetConfig("pginfo").Split('|')[4] + GetLong(Request["P_NOTI"].Split('|')[2]) };
vm.Pay.payresult = "1:결제완료";
//기결제 건(새로고침)
vm.PayItemResults = Dao.Get<PayItemResult>("pay.payitems", vm.Pay.payno);
return View("PayReturn", vm);
//}
//SetError("모바일결제오류02: " + noti.Split('|')[1] + ": ");
//vm.Pay = new Pay() { payno = 0, payresultmsg = "결제사 승인오류발생" };
}
}
catch (Exception ex)
{
SetError("모바일결제오류01: " + noti.Split('|')[1] + ": " + ex.Message);
vm.Pay = new Pay() { payno = 0, payresultmsg = "결제사 연결중 오류발생" };
} }
} }
else else
{ {
vm.Pay = new Pay() { payno = 0, payresultmsg = Request["P_RMESG1"] + "<br />결제완료화면에서 이전화면으로 돌아가면서 이동하면 발생하는 경우일 수 있습니다." }; //2)API 요청실패 화면처리
vm.Pay.payresult = "0:결제요청실패(" + xpay.m_szResCode + ")";
vm.Pay.cancelresult = xpay.m_szResMsg;
} }
} }
} return View("ApplyComplete", vm);
return View("PayReturn", vm);
} }
} }
} }

View File

@ -1,16 +1,28 @@
<input type="hidden" name="cmno" id="cmno" value="@Model.cmno" /> @*강좌번호*@ @model NP.Model.VMPay
<div id="pageTitle"> @*<div id="pageTitle">
<h3>신청완료</h3> <h3>신청@(Model.Pay.payresult.Substring(0, 1) == "1" ? "완료" : "실패")</h3>
</div> </div>*@
@if (Model.Pay.payresult.Substring(0, 1) != "1")
<h4 class="clsTitle">신청강좌</h4> {
<ul class="smtList mt0"> <h4 class="clsTitle">결제실패</h4>
<div>
@(!string.IsNullOrEmpty(Model.Pay.cancelresult) ? Model.Pay.cancelresult : Model.Pay.payresult.Substring(1))
</div>
<ul class="clsBtn society">
<li><a href="/My/Index">마이페이지</a></li>
<li><a href="/">다시 신청하기</a></li>
</ul>
}
else
{
<h4 class="clsTitle">신청강좌</h4>
<ul class="smtList mt0">
<li> <li>
<ul class="smtlChk"> <ul class="smtlChk">
<li> <li>
@if (Model.CM.cshape == 0) @if (Model.CM.cshape == 0)
{ {
<p><label>@(Model.CM.tseq)기 <span class='gry'>@(Model.CM.rsrename) (@(Model.CM.rsretimeToDay)일) </span> @Model.CM.cname<span class='red'> | @(Model.CM.infee)원</span></label></p> <p><label>@(Model.CM.tseq)기 <span class='gry'>@(Model.CM.rsrename) (@(Model.CM.rsretimeToDay)일) </span> @Model.CM.cname</label></p>
} }
else if (Model.CM.cshape == 1) else if (Model.CM.cshape == 1)
{ {
@ -21,66 +33,71 @@
<p><label>@(Model.CM.tseq)기 <span class='gry'>@(Model.CM.rsrename) (@(Model.CM.rsretimeToDay)일) </span> @Model.CM.cname<span class='red'> | @(Model.CM.infee)원 ※ 집체교육 선택 필수</span></label></p> <p><label>@(Model.CM.tseq)기 <span class='gry'>@(Model.CM.rsrename) (@(Model.CM.rsretimeToDay)일) </span> @Model.CM.cname<span class='red'> | @(Model.CM.infee)원 ※ 집체교육 선택 필수</span></label></p>
} }
@if (Model.CM.applicableCM == "정상접수") @*@if (Model.CM.applicableCM == "정상접수")
{ {
<span class="smtlChkBtn smtlChk01">정상접수</span> <span class="smtlChkBtn smtlChk01">정상접수</span>
} }
else else
{ {
<span class="smtlChkBtn smtlChk02">대기접수</span> <span class="smtlChkBtn smtlChk02">대기접수</span>
} }*@
</li> </li>
</ul> </ul>
<div class="apyCost"> <div class="apyCost">
결제금액 : <span class="red">@Model.CM.infee</span> 원 결제@(Model.Pay.isready==1?"예상":"")금액 : <span class="red">@Model.CM.infee.ToString("#,0")</span> 원
</div> </div>
</li> </li>
</ul> </ul>
@if (Model.CM.applicableCM == "정상접수") if (Model.Pay.isready == 0)
{ {
<h4 class="clsTitle">결제정보</h4> <h4 class="clsTitle">결제정보</h4>
<table class="clsTable"> <table class="clsTable">
<tbody> <tbody>
<tr> <tr>
<th>구매금액</th> <th>구매금액</th>
<td>원</td> <td>@Model.Pay.payamt.ToString("#,0") 원</td>
</tr> </tr>
<tr> <tr>
<th>지불방법</th> <th>지불방법</th>
<td>카드결제</td> <td>@Model.Pay.ptypename</td>
</tr> </tr>
@if (Model.Pay.ptype == 3)
{
<tr> <tr>
<th>입금계좌</th> <th>입금계좌</th>
<td>국민은행 | 계좌번호 | (주)이니시스</td> <td>
@Model.Pay.vactbankname | @Model.Pay.vactnum | @Model.Pay.vactname
</td>
</tr> </tr>
<tr> <tr>
<th>주문접수일</th> <th>주문접수일</th>
<td>2017-10-16 12ㅣ00 (만료일: 2018-10-16 12:00)</td> <td>@DateTime.Now.ToString("yyyy-MM-dd HH:mm") (만료일: @Model.Pay.paylimit.Value.ToString("yyyy-MM-dd HH:mm"))</td>
</tr> </tr>
}
<tr> <tr>
<th>주문상태</th> <th>주문상태</th>
<td>결제완료</td> <td>@Model.Pay.pstatusname</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<ul class="clsBtn society"> <ul class="clsBtn society">
<li><a href="#">결제현황 이동</a></li> <li><a href="/My/Paies">결제현황 이동</a></li>
<li><a href="#">마이페이지</a></li> <li><a href="/My/Index">마이페이지</a></li>
<li><a href="/Home/index">계속 신청하기</a></li> <li><a href="/">계속 신청하기</a></li>
</ul> </ul>
} }
else else
{ {
<div class="apyScs"> <div class="apyScs">
<h5>위 강좌의 대기접수가 완료되었습니다. </h5> <h5>위 강좌의 대기접수가 완료되었습니다. </h5>
<h6>(대기인원 : <span>@Model.CM.standbyPerson</span>명)</h6> <h6>(대기인원 : <span>@Model.Pay.ccount.ToString("#,0")</span>명)</h6>
<p>※ 결원 발생 시 대기신청 차례에 따라 교육생 연락처로 연락드릴 예정입니다.</p> <p>※ 결원 발생 시 대기신청 차례에 따라 교육생 연락처로 연락드릴 예정입니다.</p>
<p>※ 교육비 결제는 마이페이지 학습현황의 학습대기에서 가능하며 교육비결제 완료 후 학습을 시작할 수 있습니다.</p> <p>※ 교육비 결제는 마이페이지 학습현황의 학습대기에서 가능하며 교육비결제 완료 후 학습을 시작할 수 있습니다.</p>
</div> </div>
<ul class="clsBtn society"> <ul class="clsBtn society">
<li><a href="#">마이페이지</a></li> <li><a href="/My/Index">마이페이지</a></li>
<li><a href="/Home/index">계속 신청하기</a></li> <li><a href="/">계속 신청하기</a></li>
</ul> </ul>
}
} }

View File

@ -136,7 +136,8 @@
if (capResult.obj == 0) { if (capResult.obj == 0) {
var resultmsg = capResult.msg; var resultmsg = capResult.msg;
if (resultmsg.indexOf("buyertel")) { if (resultmsg.indexOf("buyertel")) {
msg("개인정보에 휴대폰 번호를 입력해주세요."); //msg("개인정보에 휴대폰 번호를 입력해주세요.");
msg(capResult.msg || "이미 신청한 강좌인지 확인해주세요.");
} else { } else {
msg(capResult.msg); msg(capResult.msg);
} }

View File

@ -43,7 +43,6 @@ else
function payment_return() { function payment_return() {
var fDoc; var fDoc;
fDoc = lgdwin.contentWindow || lgdwin.contentDocument; fDoc = lgdwin.contentWindow || lgdwin.contentDocument;
alert(1);
document.getElementById("LGD_PAYINFO").target = "_self"; document.getElementById("LGD_PAYINFO").target = "_self";
if (fDoc.document.getElementById('LGD_RESPCODE').value == "0000") { if (fDoc.document.getElementById('LGD_RESPCODE').value == "0000") {
document.getElementById("LGD_PAYKEY").value = fDoc.document.getElementById('LGD_PAYKEY').value; document.getElementById("LGD_PAYKEY").value = fDoc.document.getElementById('LGD_PAYKEY').value;
@ -52,7 +51,7 @@ else
} }
else { else {
document.getElementById("rsMsg").value = fDoc.document.getElementById('rsMsg').value; document.getElementById("rsMsg").value = fDoc.document.getElementById('rsMsg').value;
document.getElementById("LGD_PAYINFO").action = "/Course/PayOn"; document.getElementById("LGD_PAYINFO").action = "/Course/ApplyPay";
closeIframe(); closeIframe();
document.getElementById("LGD_PAYINFO").submit(); document.getElementById("LGD_PAYINFO").submit();
} }

View File

@ -283,6 +283,9 @@
} }
} }
}); });
if (@Model.isalreadyreq == 1) {
msg("이미 신청된 강좌입니다. 메인화면으로 이동되었습니다.");
}
}); });
function schIpt(num, code, name) { function schIpt(num, code, name) {
$('#sch' + num).val(code); $('#sch' + num).val(code);

View File

@ -6,7 +6,11 @@
<ul> <ul>
<li>결제완료 이전의 신청과정은 즉시 취소하실 수 있습니다.</li> <li>결제완료 이전의 신청과정은 즉시 취소하실 수 있습니다.</li>
<li>결제완료 이후의 과정들은 결제현황 페이지에서 신청취소 및 환불요청을 해주셔야 합니다.</li> <li>결제완료 이후의 과정들은 결제현황 페이지에서 신청취소 및 환불요청을 해주셔야 합니다.</li>
<li>결제대기중인 과정들은 결제를 완료하셔야 최종 신청이 완료됩니다.</li> <li>무통장입금(가상계좌)는 신청기간 내에 입금 완료 되어야 신청이 완료됩니다. (신청 기간이 지나면 자동 취소되고 결제대기 처리됩니다.)</li>
<li>
교육일정 변경은 및 교육취소는 교육시작일 기준 5일전 까지만 가능 합니다.<br />
입교가 확정된 과정에 대하여 미 참석 하실 경우 다음 번 교육신청 시 제한이 될 수 있으니 교육취소 및 변경 기한이 지난 경우에는 교육원으로 연락하여 주시기 바랍니다(1544-77660)
</li>
</ul> </ul>
</div> </div>
@ -31,17 +35,23 @@
<span class="nav">@d.cshapename</span> <span class="nav">@d.cshapename</span>
@Html.Raw(d.isrebate == 1 ? "<span class=\"grn\">환급</span>" : "") @Html.Raw(d.isrebate == 1 ? "<span class=\"grn\">환급</span>" : "")
<b class="payno@(d.payno)-@(d.itemno)"> @d.cname</b> <b class="payno@(d.payno)-@(d.itemno)"> @d.cname</b>
@Html.Raw(d.pstatus == 21 ? string.Format("<b><a href=\"#\" class=\"paybtn\" onclick=\"gopay({0})\">교육비납부</a></b>", d.payno) : "")
</h5> </h5>
<dl class="ltaDl"> <dl class="ltaDl">
<dt class="@(d.pstatus == 1 && d.rfdstatus < 1 ? "ltaDlbk":"ltaDlred")">@(d.pstatus == 51 ? "심사중" : d.pstatus == 21 ? "결제대기" : d.pstatus == 22 ? "입금대기" : d.pstatus == 1 && d.rfdstatus > 0 ? "환불요청" : d.pstatus == 1 ? "결제완료" : d.rstatus == 1 ? "부분환불" : d.rstatus == 2 ? "전액환불" : "-")</dt> <dt class="@(d.pstatus == 1 && d.rfdstatus < 1 ? "ltaDlbk":"ltaDlred")">@(d.pstatus == 55 ? "대기신청" : d.pstatus == 51 ? "심사중" : d.pstatus == 21 ? "결제대기" : d.pstatus == 22 ? "입금대기" : d.pstatus == 1 && d.rfdstatus > 0 ? "환불요청" : d.pstatus == 1 ? "결제완료" : d.rstatus == 1 ? "부분환불" : d.rstatus == 2 ? "전액환불" : "-")</dt>
@Html.Raw(d.pstatus == 21 ? string.Format("<dt class=\"ltaDlppl\"><a href=\"#\"></a><a href=\"#\" onclick=\"gopay({0})\">결제하기</a></dt>", d.payno):"") <dd>
<dd>신청(교육)기간 : @d.rstime.Value.ToString("yy/MM/dd") ~ @d.retime.Value.ToString("yy/MM/dd") (@d.sstime.ToString("yy/MM/dd") ~ @d.setime.ToString("yy/MM/dd"))</dd> 신청(교육)기간 : @d.rstime.Value.ToString("yy'/'MM'/'dd") ~ @d.retime.Value.ToString("yy'/'MM'/'dd") (@d.sstime.ToString("yy'/'MM'/'dd") ~ @d.setime.ToString("yy'/'MM'/'dd"))
@if (d.cshape == 2)
{
@:| 집체교육기간 : @(d.cmisno == null ? "미정" : ("[" + d.studyplacename + "]" + string.Format("{0}~{1}", d.cmiestart.ToString("yy'/'MM'/'dd"), d.cmieend.ToString("yy'/'MM'/'dd"))))
}
</dd>
</dl> </dl>
</a> </a>
</div> </div>
</th> </th>
<td class="ltaBtn" data-th="교육생 : "><span class="ltaOpen@(d.isgroup == 1 ? "" : "x")" ltaOpen="@(a)" >@(d.isgroup == 0 ? 1 : Model.PIs.Where(w=>w.payno == d.payno && w.itemno == d.itemno).Count())명</span></td> <td class="ltaBtn" data-th="교육생 : "><span class="ltaOpen@(d.isgroup == 1 ? "" : "x")" ltaOpen="@(a)" >@(d.isgroup == 0 ? 1 : Model.PIs.Where(w=>w.payno == d.payno && w.itemno == d.itemno).Count())명</span></td>
<td class="ltaBtn" data-th="관리 : "><a href="#" onclick="gowork(@(d.pstatus==51||d.pstatus == 21 || d.pstatus == 22?1:0), @string.Format("{0},{1}",d.payno, d.pino), this)">@(d.pstatus==51||d.pstatus == 21 || d.pstatus == 22?"취소":"결제상세")</a></td> <td class="ltaBtn" data-th="관리 : "><a href="#" onclick="gowork(@(d.pstatus == 55 || d.pstatus==51||d.pstatus == 21 || d.pstatus == 22?1:0), @string.Format("{0},{1}",d.payno, d.pino), this)">@(d.pstatus == 55 || d.pstatus==51||d.pstatus == 21 || d.pstatus == 22?"취소":"결제상세")</a></td>
</tr> </tr>
if (d.isgroup == 1) if (d.isgroup == 1)
{ {
@ -65,6 +75,20 @@
} }
</tbody> </tbody>
</table> </table>
@section styles{
<style type="text/css">
#confirmbox .confirmbtnbox a.btn,#confirmbox .confirmbtnbox a.btn:focus{color: #fff;}
a.paybtn {
border: 1px solid #999;
background-color: #ecf4fb;
padding: 0px 10px;
font-weight: normal;
color: #555;
margin-left: 4px;
font-size: 10pt;
}
</style>
}
@section scriptsHeader{ @section scriptsHeader{
} }

View File

@ -69,7 +69,7 @@
<!--test, service--> <!--test, service-->
<add key="LGD_ENCODING" value="UTF-8" /> <add key="LGD_ENCODING" value="UTF-8" />
<add key="LGD_BACKBTN_YN" value="N" /> <add key="LGD_BACKBTN_YN" value="N" />
<add key="LGD_CASNOTEURL" value="https://kdh.nptc.kr:8082/Account/XPayVBankMoney" /> <add key="LGD_CASNOTEURL" value="http://kdh.nptc.kr:8084/Account/XPayVBankMoney" />
<!--가상계좌 입금통보 URL--> <!--가상계좌 입금통보 URL-->
<add key="LGD_AUTOFILLYN_BUYER" value="Y" /> <add key="LGD_AUTOFILLYN_BUYER" value="Y" />
<add key="LGD_CASHRECEIPTYN" value="Y" /> <add key="LGD_CASHRECEIPTYN" value="Y" />

View File

@ -438,6 +438,7 @@ namespace NP.Model
/// </summary> /// </summary>
public int finalcut { get; set; } public int finalcut { get; set; }
public String username { get; set; } public String username { get; set; }
public Int64 lectnocheck { get; set; }
} }
[Serializable] [Serializable]

View File

@ -65,6 +65,7 @@
<Compile Include="VMMM.cs" /> <Compile Include="VMMM.cs" />
<Compile Include="VMSystem.cs" /> <Compile Include="VMSystem.cs" />
<Compile Include="VMUser.cs" /> <Compile Include="VMUser.cs" />
<Compile Include="Xpay.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

View File

@ -52,6 +52,6 @@ namespace NP.Model
public int? slevel { get; set; } public int? slevel { get; set; }
public Int64 payno { get; set; } public Int64 payno { get; set; }
public int pstatus { get; set; }
} }
} }

View File

@ -21,6 +21,10 @@ namespace NP.Model
/// 결제방식 1:신용카드,2:계좌이체,3:가상계좌,4:현금,5:현금+카드,6:무료,7:대기신청,9:위탁계약 /// 결제방식 1:신용카드,2:계좌이체,3:가상계좌,4:현금,5:현금+카드,6:무료,7:대기신청,9:위탁계약
/// </summary> /// </summary>
public int ptype { get; set; } public int ptype { get; set; }
/// <summary>
/// 0:정상, 1:대기신청
/// </summary>
public int isready { get; set; }
public String ptypecode public String ptypecode
{ {
get get
@ -92,7 +96,7 @@ namespace NP.Model
/// </summary> /// </summary>
public int refunding { get; set; } public int refunding { get; set; }
/// <summary> /// <summary>
/// 가상계좌입금만료일 수강신청 또는 가상계좌유효기간 중 빠른시간 가상계좌는 발급일로부터 7 /// 가상계좌입금만료일 수강신청 또는 가상계좌유효기간 중 빠른시간 가상계좌는 발급일로부터 ?
/// </summary> /// </summary>
public DateTime? paylimit { get; set; } public DateTime? paylimit { get; set; }
public String paylimitymd { get { public String paylimitymd { get {
@ -212,6 +216,16 @@ namespace NP.Model
public int iscashrct { get; set; } public int iscashrct { get; set; }
public String cashrcthp { get; set; } public String cashrcthp { get; set; }
//public Xpay xpay { get; set; }
public String mid { get; set; }
/// <summary>
/// 무결성 검증 필드
/// LGD_MID, LGD_TID, MertKey의 조합으로 생성된 인증문자열을 md5로 암호화한 값
/// 인증문자열 생성: LGD_MID + LGD_TID + MertKey
/// md5로 인증문자열 암호화(authdata): md5(인증문자열)
/// </summary>
public String authdata { get; set; }
} }
public class PayItem : BaseModel public class PayItem : BaseModel
@ -466,6 +480,9 @@ namespace NP.Model
public int? infee { get; set; } public int? infee { get; set; }
public int? outfee { get; set; } public int? outfee { get; set; }
public int ispg { get; set; } public int ispg { get; set; }
public String studyplacename { get; set; }
public DateTime cmiestart { get; set; }
public DateTime cmieend { get; set; }
} }
/// <summary> /// <summary>
@ -724,6 +741,7 @@ namespace NP.Model
public class PayItemResult : BaseModel public class PayItemResult : BaseModel
{ {
public Int64 payno {get;set;} public Int64 payno {get;set;}
public Int64 itemno { get; set; }
public int isgroup {get;set;} public int isgroup {get;set;}
public int isexam { get; set; } public int isexam { get; set; }
public int isdvr {get;set;} public int isdvr {get;set;}

View File

@ -16,5 +16,6 @@ namespace NP.Model
public IList<CM> CMsEtc { get; set; } public IList<CM> CMsEtc { get; set; }
public IList<Data> Datas { get; set; } public IList<Data> Datas { get; set; }
public IList<CMInning> CMInnings { get; set; } public IList<CMInning> CMInnings { get; set; }
public int isalreadyreq { get; set; }
} }
} }

View File

@ -59,5 +59,6 @@ namespace NP.Model
public int iscashrct { get; set; } public int iscashrct { get; set; }
public String cashrcthp { get; set; } public String cashrcthp { get; set; }
public System.Collections.Hashtable payParams { get; set; } public System.Collections.Hashtable payParams { get; set; }
public CM CM { get; set; }
} }
} }

301
Model/Xpay.cs Normal file
View File

@ -0,0 +1,301 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace NP.Model
{
/// <summary>
/// 구LG 현 토스페이먼츠
/// </summary>
[Serializable]
public class Xpay
{
/// <summary>
/// 토스페이먼츠 결제 서비스 선택(test:테스트, service:서비스)
/// </summary>
public String CST_PLATFORM { get; set; }
/// <summary>
/// 상점아이디(토스페이먼츠으로 부터 발급받으신 상점아이디를 입력하세요)
/// </summary>
public String CST_MID { get; set; }
/// <summary>
/// 상점아이디(자동생성)
/// 테스트 아이디는 't'를 반드시 제외하고 입력하세요.
/// </summary>
public String LGD_MID { get; set; }
/// <summary>
/// 주문번호(상점정의 유니크한 주문번호를 입력하세요)
/// </summary>
public String LGD_OID { get; set; }
/// <summary>
/// 결제금액("," 를 제외한 결제금액을 입력하세요)
/// </summary>
public String LGD_AMOUNT { get; set; }
/// <summary>
/// 구매자명
/// </summary>
public String LGD_BUYER { get; set; }
/// <summary>
/// 상품명
/// </summary>
public String LGD_PRODUCTINFO { get; set; }
/// <summary>
/// 구매자 이메일
/// </summary>
public String LGD_BUYEREMAIL { get; set; }
/// <summary>
/// 타임스탬프
/// </summary>
public String LGD_TIMESTAMP { get; set; }
/// <summary>
/// 상점정의 결제수단
/// </summary>
public String LGD_CUSTOM_USABLEPAY { get; set; }
/// <summary>
/// 상점정의 결제창 스킨 (red, blue, cyan, green, yellow)
/// </summary>
public String LGD_CUSTOM_SKIN { get; set; }
/// <summary>
/// 가상계좌 상점결과전송 NOTE_URL
/// </summary>
public String LGD_CASNOTEURL { get; set; }
/// <summary>
/// 해쉬암호데이터
/// </summary>
public String LGD_HASHDATA { get; set; }
/// <summary>
/// 결제창 2.0 타입
/// </summary>
public String LGD_CUSTOM_PROCESSTYPE { get; set; }
/// <summary>
/// 응답수신페이지
/// </summary>
public String LGD_RETURNURL { get; set; }
/// <summary>
/// 사용타입 정보(수정 및 삭제 금지): 이 정보를 근거로 어떤 서비스를 사용하는지 판단할 수 있습니다.
/// </summary>
public String LGD_VERSION { get; set; }
/// <summary>
/// 결제창 호출 방식 (수정불가)
/// </summary>
public String LGD_WINDOW_TYPE { get; set; }
/// <summary>
/// 카드사 호출 방식 (수정불가)
/// </summary>
public String LGD_CUSTOM_SWITCHINGTYPE { get; set; }
/// <summary>
/// 결제창 버전정보
/// </summary>
public String LGD_WINDOW_VER { get; set; }
/// <summary>
/// 응답코드: 0000(성공) 그외 실패
/// 인증후 자동채움 (수정불가)
/// </summary>
public String LGD_RESPCODE { get; set; }
/// <summary>
/// 응답메세지
/// 인증후 자동채움 (수정불가)
/// </summary>
public String LGD_RESPMSG { get; set; }
/// <summary>
/// 값 P: XPay 실행(PC 결제 모듈): PC용과 모바일용 모듈은 파라미터 및 프로세스가 다르므로 PC용은 PC 웹브라우저에서 실행 필요. "P", "M" 외의 문자(Null, "" 포함)는 모바일 또는 PC 여부를 체크하지 않음
/// </summary>
public String LGD_OSTYPE_CHECK { get; set; }
/// <summary>
/// 계좌이체 결제시 사용, ActiveX 사용 여부로 "N" 이외의 값: ActiveX 환경에서 계좌이체 결제 진행(IE)
/// </summary>
public String LGD_ACTIVEXYN { get; set; }
/// <summary>
/// 환경파일 위치
/// </summary>
public String configPath;
public String LGD_DOMAIN_URL { get; set; }
/// <summary>
/// 결제창 호출 문자 인코딩방식
/// Form submit 방식으로 결제창 호출시 EUC-KR이외의 인코딩을 하는 경우만 사용
/// </summary>
public String LGD_ENCODING { get; set; }
/// <summary>
/// 결과수신페이지 호출 문자 인코딩방식
/// UTF-8로 넘기면 UTF-8로 인코딩된 값을 LGD_NOTEURL, LGD_CASNOTEURL 에 전달
/// </summary>
public String LGD_ENCODING_NOTEURL { get; set; }
/// <summary>
/// 결과수신페이지 호출 문자 인코딩방식
/// UTF-8로 넘기면 UTF-8로 인코딩된 값을 LGD_RETURNURL 에 전달
/// </summary>
public String LGD_ENCODING_RETURNURL { get; set; }
/// <summary>
/// 결제창 내 신용카드/계좌이체/가상계좌 결제수단을 다시 선택하기 위한 “뒤로가기” 버튼
/// 'Y: 뒤로가기 버튼 사용
/// N: 뒤로가기 버튼 사용하지 않음
/// </summary>
public String LGD_BACKBTN_YN { get; set; }
/// <summary>
/// 구매자명 자동채움
/// 결제요청시 구매자명을 결제창에 자동으로 채움 (Y:사용함, 'N':사용안함)
/// </summary>
public String LGD_AUTOFILLYN_BUYER { get; set; }
/// <summary>
/// 현금영수증발급사용여부
/// Y:사용함, 'N':사용안함
/// </summary>
public String LGD_CASHRECEIPTYN { get; set; }
/// <summary>
/// LG유플러스에서 부여한 거래번호
/// </summary>
public String LGD_TID { get; set; }
/// <summary>
/// 결제수단코드
/// </summary>
public String LGD_PAYTYPE { get; set; }
/// <summary>
/// 거래일시(승인일시/이체일시)
/// </summary>
public String LGD_PAYDATE { get; set; }
/// <summary>
/// 결제기관코드(은행코드)
/// </summary>
public String LGD_FINANCECODE { get; set; }
/// <summary>
/// 결제기관이름(은행이름)
/// </summary>
public String LGD_FINANCENAME { get; set; }
/// <summary>
/// 에스크로 적용여부
/// </summary>
public String LGD_ESCROWYN { get; set; }
/// <summary>
/// 계좌번호(무통장입금)
/// </summary>
public String LGD_ACCOUNTNUM { get; set; }
/// <summary>
/// 입금총액(무통장입금)
/// </summary>
public String LGD_CASTAMOUNT { get; set; }
/// <summary>
/// 현입금액(무통장입금)
/// </summary>
public String LGD_CASCAMOUNT { get; set; }
/// <summary>
/// 무통장입금 플래그(무통장입금) - 'R':계좌할당, 'I':입금, 'C':입금취소
/// </summary>
public String LGD_CASFLAG { get; set; }
/// <summary>
/// 입금순서(무통장입금)
/// </summary>
public String LGD_CASSEQNO { get; set; }
/// <summary>
/// 현금영수증 승인번호
/// </summary>
public String LGD_CASHRECEIPTNUM { get; set; }
/// <summary>
/// 현금영수증자진발급제유무 Y: 자진발급제 적용, 그외 : 미적용
/// </summary>
public String LGD_CASHRECEIPTSELFYN { get; set; }
/// <summary>
/// 현금영수증 종류 0: 소득공제용 , 1: 지출증빙용
/// </summary>
public String LGD_CASHRECEIPTKIND { get; set; }
/// <summary>
/// 입금자명
/// </summary>
public String LGD_PAYER { get; set; }
/// <summary>
/// 구매자 ID
/// </summary>
public String LGD_BUYERID { get; set; }
/// <summary>
/// 구매자 주소
/// </summary>
public String LGD_BUYERADDRESS { get; set; }
/// <summary>
/// 구매자 전화번호
/// </summary>
public String LGD_BUYERPHONE { get; set; }
/// <summary>
/// 구매자 주민번호
/// </summary>
public String LGD_BUYERSSN { get; set; }
/// <summary>
/// 상품코드
/// </summary>
public String LGD_PRODUCTCODE { get; set; }
/// <summary>
/// 수취인
/// </summary>
public String LGD_RECEIVER { get; set; }
/// <summary>
/// 수취인 전화번호
/// </summary>
public String LGD_RECEIVERPHONE { get; set; }
/// <summary>
/// 배송지
/// </summary>
public String LGD_DELIVERYINFO { get; set; }
public String LGD_HASHDATA2 { get; set; }
public String LGD_CLOSEDATE { get; set; }
public String CST_WINDOW_TYPE { get; set; }
public String LGD_PCVIEWYN { get; set; }
public String LGD_CUSTOM_FIRSTPAY { get; set; }
public String LGD_KVPMISPAUTOAPPYN { get; set; }
public String LGD_MTRANSFERAUTOAPPYN { get; set; }
}
}