<html>
<head>
<!--PortOne SDK-->
<script src="https://static.portone.cloud/portone.js"></script>
<script>
// PortOne API Key로 객체 초기화
const portone = new window.PortOne({
portOneKey : 'pptafmcddmszvgXl'
})
// 파라미터 셋팅
var data = {
key:"pptafmcddmszvgXl",
pmt_channel:"TAZAPAY",
pmt_method:"TAZAPAY_CREDIT_CARD",
merchant_order_id:"MERCHANT1617366877238",
signature_hash:"10b664f803035a2146b26949041c2ce8c8693512e4b85159d3c43b001a714af0",
amount:4000,
currency:"VND",
environment:"sandbox",
description:"Product description"
country_code:"VN"
response_type:"redirect_url_only",
override_auto_redirect:true,
success_url:"http://www.youdomain.me/result/success",
failure_url:"http://www.youdomain.me/result/failure"
};
function call_PortOne_payment() {
// 결제창 호출
portone.paymentService.payment(data,
function (rsp) {
// override_auto_redirect : true로 설정된 경우 콜백으로 결과내려옴
console.log ("Processing Response Data: ", rsp.data);
}
);
}
</script>
</head>
<!--begin::Body-->
<body>
<!--결제버튼 생성-->
<button onclick="call_PortOne_payment();">결제하기</button>
</body>
<!--end::Body-->
</html>