ragyun.
ragyun.
brandpay.requestPayment
base64에서 오타가 있던거 같습니다. 잘 되네요 확인감사합니다
104 replies
brandpay.requestPayment
이건 /v1/brandpay/authorizations/access-token 호출 시 grantType을 기존 토큰의 RefreshToken로 할 때 나타나고 있는 현상이였습니다. 무조건 AuthorizationCode으로 요청하니 잘 넘어가집니다. 결제승인 시 허용되지 않은 요청입니다. 부분을 확인해주시면 감사합니다.
104 replies
brandpay.requestPayment
결제 승인 시 mid cp_ngymz55dhx 의 api key를 사용중이고 paymentKey=tcp_n20250430081316HcT31, amount=400, odId=20250430081212538139 의 결제 승인 결과 FORBIDDEN_REQUEST[허용되지 않은 요청입니다.] 에러가 나타나고 있는 것도 같이 확인해주시면 감사합니다
104 replies
brandpay.requestPayment
customerKey를 새로운 키로 하면 본인인증창이 나오고 successUrl로 반환이 됩니다. 하지만 본인인증을 마친 customerKey로 다시 결제창 호출 시 /v1/brandpay/authorizations/customer-token을 계속해서 PENDING상태로 나옵니다.
104 replies
brandpay.requestPayment
그래도 /v1/brandpay/authorizations/customer-token을 계속해서 PENDING을 보내주고 있습니다
104 replies
brandpay.requestPayment
// 3. Toss API 호출
const response:iResAccessToken = await $fetch(`${tossBaseUrl}/v1/brandpay/authorizations/access-token`, {
method: 'POST',
headers: {
authorization: "Basic " + tossBrandPaySecretBase64,
"Content-Type": "application/json"
},
body: {
code: code,
customerKey: customerKey,
grantType: grantType,
refreshToken: refreshToken,
},
});

// 4. 엑세스 토큰 저장
console.log('response', response);
// 3. Toss API 호출
const response:iResAccessToken = await $fetch(`${tossBaseUrl}/v1/brandpay/authorizations/access-token`, {
method: 'POST',
headers: {
authorization: "Basic " + tossBrandPaySecretBase64,
"Content-Type": "application/json"
},
body: {
code: code,
customerKey: customerKey,
grantType: grantType,
refreshToken: refreshToken,
},
});

// 4. 엑세스 토큰 저장
console.log('response', response);
엑세스 토큰을 조회하는 로그도 잘 보이고 있습니다.
104 replies
brandpay.requestPayment
그래서 토큰을 발급받아 저장까지 성공적인데, https://api.tosspayments.com/v1/brandpay/authorizations/customer-token?atms=209&customerKey=289ac81b-2ec0-11ef-abab-000e1e9ab310 이 호출을 계속해서 부르고 결제창이 나오지 않는 현상이 나타나고 있습니다.
104 replies
brandpay.requestPayment
vue페이지가 아니라 /server/api/brand-pay-auth.ts를 만들고 http://localhost:3000/api/brand-pay-auth 를 보도록 수정하니 됩니다.
104 replies
brandpay.requestPayment
또한 console.log(code, customerKey); 로그도 보이지 않고 있습니다.
104 replies
brandpay.requestPayment
/bridge/toss/brand-pay-auth 를 호출한 결과가 200으로 보입니다.
104 replies
brandpay.requestPayment
/bridge/toss/brand-pay-auth 에서 백엔드 서버로 보내고 있던 요청을 제거하고 아래 코드와 같이 access-token api 불러도 반응이 이전과 같습니다.
const route = useRoute();
const code = route.query.code;
const customerKey = route.query.customerKey;
onMounted(async () => {
const grantType = 'AuthorizationCode';
const refreshToken = '';

const { data: auth } = await useFetch(
console.log(code, customerKey);
`${tossBaseUrl}/v1/brandpay/authorizations/access-token`,
{
method: "POST",
headers: {
authorization: "Basic " + tossBrandPaySecretBase64,
"Content-Type": "application/json"
},
body: {
code: code,
customerKey: customerKey,
grantType: grantType,
// refreshToken: refreshToken,
}
}
)
});
const route = useRoute();
const code = route.query.code;
const customerKey = route.query.customerKey;
onMounted(async () => {
const grantType = 'AuthorizationCode';
const refreshToken = '';

const { data: auth } = await useFetch(
console.log(code, customerKey);
`${tossBaseUrl}/v1/brandpay/authorizations/access-token`,
{
method: "POST",
headers: {
authorization: "Basic " + tossBrandPaySecretBase64,
"Content-Type": "application/json"
},
body: {
code: code,
customerKey: customerKey,
grantType: grantType,
// refreshToken: refreshToken,
}
}
)
});
sdk에서 redirectUrl로 저희 서버에 보낼 때 cros가 나타나는 것인가요? 다른 분들이 이런 에러로 문의할 때엔 어떻게 처리가 되었는지도 궁금합니다.
104 replies
brandpay.requestPayment
네 확인 감사합니다
104 replies
brandpay.requestPayment
저도 오면 응답 부분 확인해서 에러코드 확인 가능합니다...
104 replies
brandpay.requestPayment
호출이 오지 않습니다...
104 replies
brandpay.requestPayment
이 네트워크 정보가 sdk에서 brandpay.requestPayment를 열어서 볼 수 있는 네트워크입니다
104 replies
brandpay.requestPayment
sdk로는 제가 네트워크에서 보이지 않습니다
104 replies
brandpay.requestPayment
방금 보낸 har는 페이지를 임의로 열어서 본거에요
104 replies
brandpay.requestPayment
Basic으로 수정하고 오류가 달라져서 sdk로 호출했지만 429 Too Many Requests로 떨어집니다 ㅠ
104 replies
brandpay.requestPayment
페이로드에 보시면 customerKey를 보내고 있습니다.
104 replies
brandpay.requestPayment
customerKey를 넣으면 되는 것인지 아니라면 무엇을 넣어야 하는지 알려주시면 감사합니다
104 replies