카드 영수증 출력, 현금영수증 출력 수정

테스트 영수증관련 js url 변경
https://pgweb.tosspayments.com:7085/WEB_SERVER/js/receipt_link.js
->
https://pgweb.tosspayments.com:7086/WEB_SERVER/js/receipt_link.js
This commit is contained in:
lch 2021-05-10 07:45:09 +00:00
parent 2d198c36c5
commit 123701b40b
4 changed files with 32 additions and 11 deletions

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
@ -464,4 +465,17 @@ public static class Helpers
}
return retVal;
}
public static string MD5Hash(string data)
{
var mdHash = MD5.Create();
byte[] hash = mdHash.ComputeHash(Encoding.UTF8.GetBytes(data));
StringBuilder stringBuilder = new StringBuilder();
foreach (byte b in hash)
{
stringBuilder.AppendFormat("{0:x2}", b);
}
return stringBuilder.ToString();
}
}

View File

@ -7,6 +7,8 @@ using System.Web.Mvc;
using NP.Model;
using NP.Base;
using System.Web.Routing;
using System.Security.Cryptography;
using System.Text;
namespace NP.FO.Controllers
{
@ -245,8 +247,7 @@ namespace NP.FO.Controllers
return Redirect("/My/Paies");
}
vm.Pay.mid = (("test".Equals(GetConfig("CST_PLATFORM").Trim())) ? "t" : "") + GetConfig("CST_MID");
String authdata = vm.Pay.mid + vm.Pay.pgkey + GetConfig("LGD_MERTKEY");
vm.Pay.authdata = Helpers.MD5Hash(vm.Pay.mid + vm.Pay.pgkey + GetConfig("LGD_MERTKEY"));
vm.PayItems = Dao.Get<PayItem>("pay.mypayitem", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo }, { "payno", vm.payno } });
vm.PayItem = Dao.Get<PayItem>("pay.mypayitem", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo }, { "payno", vm.payno } }).FirstOrDefault();
vm.intval3 = Dao.Get<PayRfd>("pay.mypayrfd", new System.Collections.Hashtable() { { "payno", vm.Pay.payno }/*,{ "rstatus", 0}*/, { "withoutrstatus" , "4" } }).Count();

View File

@ -102,7 +102,7 @@
@Html.Raw("-")
}
</td>
<td class="ltaBtn" data-th="계산서/영수증 : ">
<td class="ltaBtn" data-th="계산서/영수증 : ">
@if (item.pstatus == 1 && item.rstatus == 0)
{
if (item.ptype == 6)
@ -111,13 +111,13 @@
}
else if (item.ptype == 1 && item.ispg == 1) /*신용카드*/
{
<a href="#" onclick="viewtax('@(item.pgkey)')">[인쇄]</a>
<a href="#" onclick="viewtax('@(item.pgkey)', '@(Helpers.MD5Hash(ViewBag.mid + item.pgkey + ViewBag.mertkey))')">[인쇄]</a>
}
else if (item.ptype == 3 && item.ispg == 1) /*가상계좌*/
{
if (item.iscashrct == 1) /*현금영수증신청*/
{
<a href="#" onclick="viewtax('@(item.pgkey)')">[인쇄]</a>
<a href="#" onclick="viewtaxcash('@(item.payno)')">[인쇄]</a>
}
else
{
@ -129,7 +129,7 @@
}
else if (item.iscancel == 1) /*취소시 일반영수증*/
{
<a href="#" onclick="viewtax('@(item.pgkey)')">[인쇄]</a>
<a href="#" onclick="viewtax('@(item.pgkey)', '@(Helpers.MD5Hash(ViewBag.mid + item.pgkey + ViewBag.mertkey))')">[인쇄]</a>
}
else
{
@ -144,7 +144,7 @@
}
else
{
<a href="#" onclick="viewtax('@(item.pgkey)')">[인쇄]</a>
<a href="#" onclick="viewtax('@(item.pgkey)', '@(Helpers.MD5Hash(ViewBag.mid + item.pgkey + ViewBag.mertkey))')">[인쇄]</a>
}
}
}
@ -419,8 +419,14 @@ else
msg("팝업이 차단되어 있습니다. 차단을 해제해 주세요.");
}
}
function viewtax(pgkey) {
showReceiptByTID('@(ViewBag.mid)', pgkey, '@(ViewBag.mid)+pakey+@(ViewBag.mertkey)');
function viewtax(pgkey, authdata) {
showReceiptByTID('@(ViewBag.mid)', pgkey, authdata);
}
function viewtaxcash(payno) {
var seqno = '001';
var LGD_OID = "@(@System.Web.Configuration.WebConfigurationManager.AppSettings["PAYMENT_CLASSIFICATION"])" + String(payno);
var service_type = "@(@System.Web.Configuration.WebConfigurationManager.AppSettings["CST_PLATFORM"])";
showCashReceipts('@(ViewBag.mid)', LGD_OID, seqno, 'CAS', service_type);
}
function viewtaxinvoice(payno) {
capp('/fcommon/paytaxinvoiceview', { payno: payno }, 'cbviewtaxinvoice');
@ -576,7 +582,7 @@ else
@if (ViewBag.isPayTest == "1")
{
//테스트일 경우
<script language="JavaScript" src="http://pgweb.tosspayments.com:7085/WEB_SERVER/js/receipt_link.js"></script>
<script language="JavaScript" src="https://pgweb.tosspayments.com:7086/WEB_SERVER/js/receipt_link.js"></script>
}
else
{

View File

@ -698,7 +698,7 @@
@if (ViewBag.isPayTest == "1")
{
//테스트일 경우
<script language="JavaScript" src="http://pgweb.tosspayments.com:7085/WEB_SERVER/js/receipt_link.js"></script>
<script language="JavaScript" src="https://pgweb.tosspayments.com:7086/WEB_SERVER/js/receipt_link.js"></script>
}
else
{