정기 결제 위젯 오류 발생합니다.

<!-- 창 SDK -->
<script src="https://js.tosspayments.com/v1/payment"></script>



// ------ ------
var clientKey = G_TOSS_CLIENT_KEY;
var tossPayments = TossPayments(clientKey);

var amount = 4900;

var successUrl = window.location.origin + "/success";
var failUrl = window.location.origin + "/fail";

function billing() {
var requestJson = {
// customerKey.
// . UUID.
"customerKey": "test_customer_key",
"successUrl": successUrl,
"failUrl": failUrl
};
tossPayments.requestBillingAuth('CARD', requestJson)
.catch(function (error) {
if (error.code === "USER_CANCEL") {
alert('.');
} else {
alert(error.message);
}
});
}

{
"result": "ERROR",
"data": null,
"error": {
"code": "COMMON_ERROR",
"message": "",
"data": {
"failUrl": "https://pages.tosspayments.com/error/?code=COMMON_ERROR&message=%EC%B2%98%EB%A6%AC%20%EC%A4%91%20%EC%98%A4%EB%A5%98%EA%B0%80%20%EB%B0%9C%EC%83%9D%ED%96%88%EC%8A%B5%EB%8B%88%EB%8B%A4&orderId="
}
}
}



clientKey : test_gck_5OWRapdA8djpZYDYgkE6Vo1zEqZK

https://docs.tosspayments.com/blog/subscription-service-1#1-%EB%B9%8C%EB%A7%81%ED%82%A4-%EB%B0%9C%EA%B8%89%ED%95%98%EA%B8%B0


.

.
image.png
.
구독 결제 서비스 구현하기 (1) 빌링키 발급 | 토스...
Was this page helpful?