영웅
TPToss payments 개발자 커뮤니티
•Created by 영웅 on 6/24/2024 in #❓┃연동개발-문의
LIVE 키 적용 후 결제가 안되고 있어요.
이 부분인가요?
14 replies
TPToss payments 개발자 커뮤니티
•Created by 영웅 on 6/24/2024 in #❓┃연동개발-문의
LIVE 키 적용 후 결제가 안되고 있어요.
<script>
// 쿼리 파라미터 값이 결제 요청할 때 보낸 데이터와 동일한지 반드시 확인하세요.
// 클라이언트에서 결제 금액을 조작하는 행위를 방지할 수 있습니다.
const urlParams = new URLSearchParams(window.location.search);
// 서버로 결제 승인에 필요한 결제 정보를 보내세요.
async function confirm() {
const requestData = {
paymentKey: urlParams.get("paymentKey"),
orderId: urlParams.get("orderId"),
amount: urlParams.get("amount"),
};
const response = await fetch("/confirm", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(requestData),
});
const json = await response.json();
if (!response.ok) {
// TODO: 결제 실패 비즈니스 로직을 구현하세요.
console.log(json);
window.location.href =
/fail?message=${json.message}&code=${json.code}
;
}
// TODO: 결제 성공 비즈니스 로직을 구현하세요.
console.log(json);
}
confirm();
const paymentKeyElement = document.getElementById("paymentKey");
const orderIdElement = document.getElementById("orderId");
const amountElement = document.getElementById("amount");
orderIdElement.textContent = "주문번호: " + urlParams.get("orderId");
amountElement.textContent = "결제 금액: " + urlParams.get("amount");
paymentKeyElement.textContent =
"paymentKey: " + urlParams.get("paymentKey");
opener.parent.orderform_submit(urlParams.get("amount"));
</script>14 replies
TPToss payments 개발자 커뮤니티
•Created by 영웅 on 6/24/2024 in #❓┃연동개발-문의
LIVE 키 적용 후 결제가 안되고 있어요.
혹시
14 replies
TPToss payments 개발자 커뮤니티
•Created by 영웅 on 6/24/2024 in #❓┃연동개발-문의
LIVE 키 적용 후 결제가 안되고 있어요.
PHP로 작성중입니다. 참고할 샘플 페이지 URL 부탁드려요
14 replies
TPToss payments 개발자 커뮤니티
•Created by 영웅 on 6/24/2024 in #❓┃연동개발-문의
LIVE 키 적용 후 결제가 안되고 있어요.
승인 API 호출요? 샘플 페이지에 있는 내용은 다 했다고 생각했는데요.
14 replies