js express로 결제승인 코드를 구성했는데 빈값이 넘어옵니다
router.post('/config', async (req, res) => {
const { amount, orderId, paymentKey } = req.body;
const BASIC_TOKEN = Buffer.from(
const test = await fetch("https://api.tosspayments.com/v1/payments/confirm", {
method: "POST",
headers: {
Authorization:
"Content-Type": "application/json",
},
body: JSON.stringify({ amount, orderId, paymentKey, customerKey: orderId }),
});
console.log("\n\n\n" + JSON.stringify(test))
});
const { amount, orderId, paymentKey } = req.body;
const BASIC_TOKEN = Buffer.from(
시크릿키:, "utf-8").toString('base64')const test = await fetch("https://api.tosspayments.com/v1/payments/confirm", {
method: "POST",
headers: {
Authorization:
Basic ${BASIC_TOKEN},"Content-Type": "application/json",
},
body: JSON.stringify({ amount, orderId, paymentKey, customerKey: orderId }),
});
console.log("\n\n\n" + JSON.stringify(test))
});
