YNICTE/FO/Views/Course/XpayREQ.cshtml

63 lines
2.5 KiB
Plaintext
Raw Normal View History

2020-11-16 17:42:59 +09:00
@model NP.Model.VMPay
@if (ViewBag.isPayTest == "1")
{
//테스트일 경우
<script language="javascript" src="https://pretest.tosspayments.com:9443/xpay/js/xpay_crossplatform.js" type="text/javascript"></script>
}
else
{
//서비스일 경우
<script language="javascript" src="https://xpayvvip.tosspayments.com/xpay/js/xpay_crossplatform.js" type="text/javascript"></script>
}
<br />
<div style="border: 1px solid #ddd; color: red; font-weight: bold; font-size: 13px; text-align: center; padding: 15px;">결제 진행중입니다. 잠시만 기다려주세요.</div>
<br />
<form method="post" id="LGD_PAYINFO" action="">
@foreach (System.Collections.DictionaryEntry data in Model.payParams)
{
<input type="hidden" name="@data.Key" id="@data.Key" value="@data.Value" /><br />
@*@(data.Key + "-" + data.Value)*@
}
<input type="hidden" name="CM.cmino" id="becmino" value="@Model.CM.cmino" />
<input type="hidden" name="CM.cmisno" id="becmisno" value="@Model.CM.cmisno" />
2020-11-16 17:42:59 +09:00
</form>
<script>
$(function () {
launchCrossPlatform();
});
/* 수정불가 */
function launchCrossPlatform() {
if (ismobile()) {
lgdwin = open_paymentwindow(document.getElementById('LGD_PAYINFO'), val("CST_PLATFORM"), val("CST_WINDOW_TYPE"));
} else {
lgdwin = openXpay(document.getElementById('LGD_PAYINFO'), val("CST_PLATFORM"), val("LGD_WINDOW_TYPE"), null, "", "");
}
}
/* FORM 명만 수정 가능 */
function getFormObject() {
return document.getElementById("LGD_PAYINFO");
}
/* 인증결과 처리 */
function payment_return() {
var fDoc;
fDoc = lgdwin.contentWindow || lgdwin.contentDocument;
document.getElementById("LGD_PAYINFO").target = "_self";
if (fDoc.document.getElementById('LGD_RESPCODE').value == "0000") {
document.getElementById("LGD_PAYKEY").value = fDoc.document.getElementById('LGD_PAYKEY').value;
document.getElementById("LGD_PAYINFO").action = "/Course/OnPayReturn";
document.getElementById("LGD_PAYINFO").submit();
}
else {
document.getElementById("rsMsg").value = fDoc.document.getElementById('rsMsg').value;
2020-11-24 17:34:18 +09:00
document.getElementById("LGD_PAYINFO").action = "/Course/ApplyPay";
2020-11-16 17:42:59 +09:00
closeIframe();
document.getElementById("LGD_PAYINFO").submit();
}
}
</script>