Unexpected token 오류로 연동이 되지 않습니다.

.

------------------------------------------------------------------------

JS wd_module/pay/module.js
HTML wd_module/pay/index.html
/wd_module/pay/toss_ok.html
tosspayments-sample-main/php-javascript/public/payment/success.html

/wd_module/pay/toss_no.html
tosspayments-sample-main/php-javascript/public/fail.html


면 requestPayment
라 toss_ok.html, toss_no.html





Unexpected token '<', "<!DOCTYPE "... is not valid JSON

undefined
------------------------------------------------------------------------

서 Unexpected token
https://discord.com/channels/864296203746803753/1019841718318805064/threads/1327159920029864016

서 index.php 서 function confirmPayment .
는 index.php
case '/confirm/payment':
echo json_encode(["ok" => "confirmPayment call"]);
exit;
if ($requestMethod === 'POST') {
confirmPayment($encryptedApiSecretKey);
}
break;

면 index.php .
. ?


의 index.php
.



, , , 록 requestPayment
는 toss 제 API
면 requestPayment.successUrl
requestPayment.successUrl 의 confirm
의 then 과 catch
confirm()
.then(function (data) {
// TODO: 우 UI .
document.getElementById("response").innerHTML = <pre>${JSON.stringify(data, null, 4)}</pre>;
})
.catch((err) => {
// TODO: 우 UI .
window.location.href = /fail.html?message=${err.message}&code=${err.code};
});

.
Was this page helpful?