Stefan Lam
Stefan Lam2y ago

Error 500 when calling API billing authorize.

Hi support, i pass customerKey, authKey as json and also my header base64 encode with extra : getting 500 errors. any advise?
36 Replies
토스페이먼츠 BOT
3/12 이후에 결제 연동을 해보신 분들을 찾습니다!🔎
제품 발전을 위해 설문에 참여해주세요! 추첨을 통해 선물을 드립니다. (1분 소요)
이실장
이실장2y ago
share me the customerKey you used
Stefan Lam
Stefan Lam2y ago
ok 2cnelhOan9QpUrlXbIdYSedKn9g1
이실장
이실장2y ago
authKey can't be reusable
Stefan Lam
Stefan Lam2y ago
meaning? i only call 1 time
이실장
이실장2y ago
you already get the billingKey from that authKey
Stefan Lam
Stefan Lam2y ago
then how do i try again?
이실장
이실장2y ago
what are you trying know? do you know what bililing Key is?
Stefan Lam
Stefan Lam2y ago
billing/authorization/issues api
이실장
이실장2y ago
Do you know how the recurring system work?
Stefan Lam
Stefan Lam2y ago
Ya i authorize 1 time then charge anytime based on terms but the thing is i cant even authorize can advise? appreciate billing key i cannot get yet 500 error
이실장
이실장2y ago
Let's start from the first step
Stefan Lam
Stefan Lam2y ago
ok
이실장
이실장2y ago
tossPayments.requestBillingAuth('카드', { // 결제수단 파라미터
// 빌링키 발급 요청을 위한 파라미터
customerKey: '7aKTf1FiN2WOHJmC-KESD',
successUrl: 'http://localhost:8080/success',
failUrl: 'http://localhost:8080/fail',
})
tossPayments.requestBillingAuth('카드', { // 결제수단 파라미터
// 빌링키 발급 요청을 위한 파라미터
customerKey: '7aKTf1FiN2WOHJmC-KESD',
successUrl: 'http://localhost:8080/success',
failUrl: 'http://localhost:8080/fail',
})
Stefan Lam
Stefan Lam2y ago
i request payment window from jsSDK ya correct
이실장
이실장2y ago
you call above function right?
Stefan Lam
Stefan Lam2y ago
yea after that fill up all information
이실장
이실장2y ago
ok then plz get the whole new authKey tru that function Yes in test Key it doesnt have to be ful-correct card num. Just check CARD BIN (6-digit from left side)
Stefan Lam
Stefan Lam2y ago
Yah it redirect to success page then i go call api billing authorize fail 500 error fetch('https://api.tosspayments.com/v1/billing/authorizations/issue', { headers: { 'Content-Type': 'application/json', 'Authorization' : 'Basic '+base64Key }, method: 'POST', body: JSON.stringify({ authKey: json.authKey, customerKey: json.customerKey }) }) .then(res => res.json())
이실장
이실장2y ago
In the log you already got the billing Key at 13:54 KST Did you get the brand new authKey?
Stefan Lam
Stefan Lam2y ago
yah bln_v2kwEKYYzxX it still fail 500 anything wrong? i only call 1 time but fail
이실장
이실장2y ago
{"mId":"txxxxxx8v","customerKey":"2cnelhOan9QpUrlXbIdYSedKn9g1","authenticatedAt":"2023-04-26T14:04:14+09:00","method":"카드","billingKey":"qjz--************----44=","cardCompany":"국민","cardNumber":"94909401****123*","card":{"issuerCode":"11","acquirerCode":"11","number":"94909401****123*","cardType":"체크","ownerType":"개인"}}
{"mId":"txxxxxx8v","customerKey":"2cnelhOan9QpUrlXbIdYSedKn9g1","authenticatedAt":"2023-04-26T14:04:14+09:00","method":"카드","billingKey":"qjz--************----44=","cardCompany":"국민","cardNumber":"94909401****123*","card":{"issuerCode":"11","acquirerCode":"11","number":"94909401****123*","cardType":"체크","ownerType":"개인"}}
We send you api response with 200 status I think we need to check if you guys are receiving it well.
Stefan Lam
Stefan Lam2y ago
no receive ... just 500 error
이실장
이실장2y ago
코어 API | 토스페이먼츠 개발자센터
토스페이먼츠 API 엔드포인트(Endpoint)와 객체 정보, 파라미터, 요청 및 응답 예제를 살펴보세요.
이실장
이실장2y ago
can you test that you can get the api response succesfully? just change the Authorization header to your api key
Stefan Lam
Stefan Lam2y ago
/v1/promotions/card?
이실장
이실장2y ago
yeah
Stefan Lam
Stefan Lam2y ago
ok wait same 500 error
이실장
이실장2y ago
Then you have to check your firewall or timeout setting
이실장
이실장2y ago
방화벽 설정 | 토스페이먼츠 개발자센터
토스페이먼츠 API를 안전하게 사용할 수 있는 방화벽 설정을 알아봅니다.
Stefan Lam
Stefan Lam2y ago
eh receive
이실장
이실장2y ago
here is the firewall info 13.124.18.147 13.124.108.35 3.36.173.151 3.38.81.32 you have to open above ip
Stefan Lam
Stefan Lam2y ago
let me try ok got d sorry my bad
이실장
이실장2y ago
you are ok now right?
Stefan Lam
Stefan Lam2y ago
okie...my code issue thanks for your help
토스페이먼츠 BOT
❤️ 기술문의 경험이 어떠셨나요?!
간단히 코멘트 남겨주세요! 제품 발전에 큰 힘이 됩니다.