버그 수정, 모임장 설정 수정
This commit is contained in:
@@ -461,14 +461,23 @@ exports.requestPayment = async (req, res) => {
|
||||
planChange: planChange || false
|
||||
});
|
||||
|
||||
// 플랜 정보 조회 (planId가 있는 경우)
|
||||
let planName = '';
|
||||
if (planId) {
|
||||
const plan = await SubscriptionPlan.findByPk(planId);
|
||||
if (plan) {
|
||||
planName = plan.name; // 베이직 또는 프리미엄 등의 플랜 이름
|
||||
}
|
||||
}
|
||||
|
||||
// 토스페이먼츠에 전송할 데이터 구성
|
||||
const paymentData = {
|
||||
orderId: paymentInfo.orderId,
|
||||
amount: totalAmount,
|
||||
orderName: planId ? `구독 플랜: ${planDuration}개월` : '추가 기능 구매',
|
||||
orderName: planId ? `${planName} 플랜: ${planDuration}개월` : '추가 기능 구매',
|
||||
customerName: club.name,
|
||||
successUrl: successUrl || `${process.env.FRONTEND_URL}/payment/success`,
|
||||
failUrl: failUrl || `${process.env.FRONTEND_URL}/payment/fail`,
|
||||
successUrl: successUrl || `${req.headers.origin}/payment/success`,
|
||||
failUrl: failUrl || `${req.headers.origin}/payment/fail`,
|
||||
customerEmail: req.user.email
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user