이동준
TPToss payments 개발자 커뮤니티
•Created by 이동준 on 12/30/2024 in #❓┃연동개발-문의
정기결제 배포후 심사
로컬환경에서 테스트 후 홈페이지에 테스트 key값으로 배포한 상황입니다.
토슽 개발자센터에서 심사를 받는 부분을 못찾겠어서 문의드립니다.
어디에서 받으면 될까요??ㅠㅠ
5 replies
TPToss payments 개발자 커뮤니티
•Created by 이동준 on 12/27/2024 in #❓┃연동개발-문의
자동결제 에러 문의
안녕하세요
자동결제창에서 { code: 'INVALID_REQUEST', message: '필수 파라미터가 누락되었습니다.' }
에러가 발생되어 문의 드립니다
const encryptedSecretKey =
Basic ${btoa('내api개별연동키에서시크릿키:')}
;
export async function POST(req: Request) {
try {
const { customKey, authKey } = await req.json();
const response = await fetch( https://api.tosspayments.com/v1/billing/authorizations/issue
, {
method: "POST",
headers: {
Authorization: encryptedSecretKey,
"Content-Type": "application/json",
},
body: JSON.stringify({
authKey, // 인증 키
customKey, // 고객 키
})
}
);
const result = await response.json();
if (response.ok) {
return NextResponse.json(result, { status: 200 });
} else {
return NextResponse.json(result, { status: response.status });
}
} catch (error) {
console.error("Error:", error);
return NextResponse.json({ message: "Internal Server Error" }, { status: 500 });
}
}
customKey는 db에서 생성한 고객 id값
authKey는 redirect페이지 이동시 params에 나오는 authkey값입니다17 replies