Amy
Amy
COMMON_ERROR
자체적으로 에러 해결해서 문의 클로징 하겠습니다
27 replies
COMMON_ERROR
터미널에 common_error 오류가 동일하게 뜨거든요
27 replies
COMMON_ERROR
2yVuxRHi0rrSL5mlPId_J 에서도 터미널 오류, 데이터베이스 저장 안되는 오류가 계속 되고 있는데 이건 토스페이먼츠 코드와는 상관이 없는건가요?
27 replies
COMMON_ERROR
네, COMMON_ERROR가 발생한 API endpoint와 관련 payload만 알려드리겠습니다. API Endpoint: https://api.tosspayments.com/v1/payments HTTP Method: POST Request Headers: { Authorization: Basic ${Buffer.from(TOSS_SECRET_KEY + ":").toString("base64")}, "Content-Type": "application/json" } Request Payload: { amount: number, // 결제 금액 orderId: string, // nanoid()로 생성된 주문번호 orderName: "객실 예약", // 주문명 customerName: string, // 고객 이름 successUrl: ${window.location.origin}/payments/success, // 성공 시 리다이렉트 URL failUrl: ${window.location.origin}/payments/fail, // 실패 시 리다이렉트 URL method: "card" | "bank_transfer" | "simple_payment" // 결제 수단 } Error Response: { 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=' } } }
27 replies
COMMON_ERROR
6. 데이터베이스에 저장되는 예약 정보: { id: string; // UUID reservationNumber: string; // 예약번호 roomId: string; // 객실 ID checkIn: string; // 체크인 날짜 checkOut: string; // 체크아웃 날짜 status: "pending" | "confirmed" | "cancelled"; // 예약 상태 guestName: string; // 투숙객 이름 guestPhone: string; // 투숙객 전화번호 guestEmail: string; // 투숙객 이메일 numberOfGuests: number; // 투숙 인원 numberOfRooms: number; // 객실 수 specialRequests?: string; // 특별 요청사항 totalAmount: number; // 총 결제 금액 basePrice: number; // 기본 요금 extraPersonFee: number; // 추가 인원 요금 paymentStatus: "pending" | "completed" | "failed" | "cancelled"; // 결제 상태 paymentMethod?: "card" | "bank_transfer" | "simple_payment"; // 결제 수단 paymentKey?: string; // 결제 키 receiptUrl?: string; // 영수증 URL cancelReason?: string; // 취소 사유 createdAt: string; // 생성 일시 updatedAt: string; // 수정 일시 } 이것이 전체 결제 프로세스에서 사용되는 모든 payload입니다.
27 replies
COMMON_ERROR
1. 예약 생성 시 Payload (POST /api/reservations): { roomName: string; // 객실 이름 checkIn: string; // 체크인 날짜 checkOut: string; // 체크아웃 날짜 guestName: string; // 투숙객 이름 guestPhone: string; // 투숙객 전화번호 guestEmail: string; // 투숙객 이메일 numberOfGuests: number; // 투숙 인원 numberOfRooms: number; // 객실 수 specialRequests?: string; // 특별 요청사항 totalAmount: number; // 총 결제 금액 basePrice: number; // 기본 요금 extraPersonFee: number; // 추가 인원 요금 } 2. 결제 초기화 요청 Payload (POST /api/payments): { amount: number; // 결제 금액 orderId: string; // 주문번호 (nanoid로 생성) orderName: string; // 주문명 ("객실 예약") customerName: string; // 고객 이름 successUrl: string; // 성공 시 리다이렉트 URL failUrl: string; // 실패 시 리다이렉트 URL } 3. 토스 페이먼츠 SDK 요청 Payload (requestPayment): { amount: number; // 결제 금액 orderId: string; // 주문번호 orderName: string; // 주문명 customerName: string; // 고객 이름 successUrl: string; // 성공 시 리다이렉트 URL failUrl: string; // 실패 시 리다이렉트 URL method: PaymentMethod; // 결제 수단 ("card" | "bank_transfer" | "simple_payment") } 4. 결제 승인 요청 Payload (POST /v1/payments/${paymentKey}): { paymentKey: string; // 결제 키 orderId: string; // 주문번호 amount: number; // 결제 금액 } 5.예약 상태 업데이트 Payload: { status: "pending" | "confirmed" | "cancelled"; // 예약 상태 paymentStatus: "pending" | "completed" | "failed" | "cancelled"; // 결제 상태 paymentMethod: "card" | "bank_transfer" | "simple_payment"; // 결제 수단 paymentKey?: string; // 결제 키 receiptUrl?: string; // 영수증 URL cancelReason?: string; // 취소 사유 }
27 replies
COMMON_ERROR
주문일시 2025-02-06 15:00:09
결제일시 2025-02-06 15:00:38
주문번호2yVuxRHi0rrSL5mlPId_J 완료
27 replies
COMMON_ERROR
1. 결제 초기화 요청 (POST /api/payments): { amount: totalAmount, // 결제 금액 orderId: orderId, // nanoid()로 생성된 주문번호 orderName: "객실 예약", // 주문명 customerName: customerName, // 고객 이름 successUrl: ${window.location.origin}/payments/success, // 성공 시 리다이렉트 URL failUrl: ${window.location.origin}/payments/fail // 실패 시 리다이렉트 URL } 2. 토스 페이먼츠 SDK 요청 (requestPayment): { amount: totalAmount, // 결제 금액 orderId: orderId, // nanoid()로 생성된 주문번호 orderName: "객실 예약", // 주문명 customerName: customerName, // 고객 이름 successUrl: ${window.location.origin}/payments/success, // 성공 시 리다이렉트 URL failUrl: ${window.location.origin}/payments/fail // 실패 시 리다이렉트 URL } 3. 결제 승인 요청 (POST /v1/payments/${paymentKey}): { orderId: orderId, // 주문번호 amount: amount // 결제 금액 } 4. 이 요청들은 다음과 같은 헤더와 함께 전송됩니다: headers: { Authorization: Basic ${Buffer.from(TOSS_SECRET_KEY + ":").toString("base64")}, "Content-Type": "application/json" }
27 replies
COMMON_ERROR
payload는 이걸 보내드리면 되나요? // 토스 페이먼츠 요청 타입 export interface ITossPaymentProps { amount: number; orderId: string; orderName: string; customerName: string; successUrl: string; failUrl: string; } // 토스 페이먼츠 응답 타입 export interface ITossPaymentResponse { paymentKey?: string; orderId: string; amount: number; status: string; receiptUrl?: string; }
27 replies
COMMON_ERROR
토스페이먼츠의 두 가지 API 엔드포인트를 사용하고 있습니다: 결제 생성 API: POST https://api.tosspayments.com/v1/payments 결제 승인 API:POST https://api.tosspayments.com/v1/payments/{paymentKey}
27 replies
COMMON_ERROR
이렇게 나오는데 /api/payments 이걸 호출할 때 나오는 에러인거 같습니다
27 replies
COMMON_ERROR
next dev
▲ Next.js 15.1.4 - Local: http://localhost:3000 - Network: http://172.30.1.24:3000 - Environments: .env.local ✓ Starting... ✓ Ready in 1171ms ○ Compiling / ... ✓ Compiled / in 1134ms (804 modules) ✓ Compiled in 76ms (323 modules) GET / 200 in 1947ms ○ Compiling /rooms/[id] ... ✓ Compiled /rooms/[id] in 1220ms (2663 modules) Error: Route "/rooms/[id]" used params.id. params should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis at id (app/rooms/[id]/page.tsx:66:44) 64 | export default async function RoomPage(props: Props) { 65 | try {
66 | const room = await getRoom(props.params.id);
| ^ 67 | 68 | if (!room) { 69 | return <div>객실을 찾을 수 없습니다.</div>; Error: Route "/rooms/[id]" used params.id. params should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis at id (app/rooms/[id]/page.tsx:58:42) 56 | 57 | export async function generateMetadata(props: Props): Promise<Metadata> {
58 | const room = await getRoom(props.params.id);
| ^ 59 | return { 60 | title: room ? ${room.name} - 힐링호텔 : "객실 정보", 61 | }; GET /rooms/ondol 200 in 1764ms ✓ Compiled /api/payments in 409ms (2681 modules) Toss payment error: { 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=' } } } POST /api/payments 200 in 661ms ✓ Compiled /payments/success in 399ms (2699 modules) PUT /api/payments 200 in 849ms GET /payments/success?orderId=ogVuyT1kZ3iWfCWiTN99A&paymentKey=tviva20250206135640lwwa2&amount=60000 200 in 1376ms
27 replies
COMMON_ERROR
예약생성 API 입니다. 호텔 객실 선택 후 예약자 정보 입력하고 결제완료할 때 받은 에러 입니다. 테스트 결제 창은 잘 뜨고 신용카드 또는 실시간 계좌이체로 결제하도록 하고 있고 결제 창 마지막 단계에서 결좌완료 버튼 누르면 화면에 결제성공 메시지와 주문번호 잘뜨고 토스 개발자센터 > 테스트 결제내역에도 로그가 남는데 데이터베이스에 reservations 테이블과 예약정보가 저장되지 않고 있습니다. 데이터베이스는 supabase 이용하고 있습니다.
27 replies
COMMON_ERROR
테스트 결제입니다
27 replies
COMMON_ERROR
주문번호 ogVuyT1kZ3iWfCWiTN99A 입니다
27 replies
에스크로 서비스 7일 후 구매확정 하도록 할 수 있을까요?
19 replies
에스크로 서비스 7일 후 구매확정 하도록 할 수 있을까요?
아직 계약체결 전이라 계약서가 없습니다. 홈페이지 자주 묻는 질문에 보니 에스크로에 관한 내용이긴 하지만 일주일 정도 걸린다고 예상하면 되겠네요
19 replies
에스크로 서비스 7일 후 구매확정 하도록 할 수 있을까요?
네 감사합니다. 그리고 고객 결제후 PG사에서 저에게 정산은 몇 일 후에 해주시는지요?
19 replies
에스크로 서비스 7일 후 구매확정 하도록 할 수 있을까요?
그럼 7일 이내 환불 요청이 들어오면 제가 그냥 전액 취소해주는 방식으로 진행하면 될까요?
19 replies
에스크로 서비스 7일 후 구매확정 하도록 할 수 있을까요?
아니요. 배송이 필요한 상품은 아니고 온라인 결제 후 다운로드 받는 방식입니다. 그런데 7일 이내에는 고객이 환불 할 수 있도록 하고 싶어서요. 배송일자를 제가 임의로 입력한다든지 해서 고객에게 구매확정까지 7일의 기간을 줄 수 있는지 궁금합니다.
19 replies