...
if (paymentMethod === '토스페이') {
const ck = process.env.NEXT_PUBLIC_TOSS_CLIENT_KEY;
const sk = process.env.NEXT_PUBLIC_TOSS_SECRET_KEY;
if (!ck) throw Error('Invalid Client Key');
if (!sk) throw Error('Invalid Secret Key');
const tossPayments = await loadTossPayments(ck);
tossPayments.requestPayment('토스페이', {
amount: price,
orderId: Buffer.from(token + popupId + date + ':').toString('base64'),
orderName: 'POPPY 테스트',
customerName: userInfoData[0].userNickname,
successUrl: `http://localhost:3000/detail/${popupId}/book/completed`,
failUrl: `http://localhost:3000/detail/${popupId}`,
});
}
...
...
if (paymentMethod === '토스페이') {
const ck = process.env.NEXT_PUBLIC_TOSS_CLIENT_KEY;
const sk = process.env.NEXT_PUBLIC_TOSS_SECRET_KEY;
if (!ck) throw Error('Invalid Client Key');
if (!sk) throw Error('Invalid Secret Key');
const tossPayments = await loadTossPayments(ck);
tossPayments.requestPayment('토스페이', {
amount: price,
orderId: Buffer.from(token + popupId + date + ':').toString('base64'),
orderName: 'POPPY 테스트',
customerName: userInfoData[0].userNickname,
successUrl: `http://localhost:3000/detail/${popupId}/book/completed`,
failUrl: `http://localhost:3000/detail/${popupId}`,
});
}
...