Toss Payment API confirm always response error result

After i make payment successfully, i was redirected to successful url attached in request. Then i call confirm api it always returned response error: 1. The 400 status code error { "code": "ALREADY_PROCESSED_PAYMENT", "message": "이미 처리된 결제 입니다." } 2. The 500 { "code": "FAILED_PAYMENT_INTERNAL_SYSTEM_PROCESSING", "message": "[S021] 이미 사용된 주문번호입니다. 새로운 주문번호로 결제를 시도해 주십시요." }
35 Replies
토스페이먼츠 BOT
⏳ 잠시만 기다려주세요! 곧 답변드리겠습니다
오류 문의일 경우 아래 정보를 미리 전달해주시면, 빠른 답변에 도움이 됩니다.
- 주문번호(orderId) : - 문의 내용 :
(img를 함께 첨부해주시면 도움이됩니다)
* 계약관련 내용은 1544-7772로 문의주세요. * 주말/공휴일에는 답변이 늦을 수 있어요.
Kimoon Lee
Kimoon Lee5mo ago
This error occurs when an payment request is made again for an order that has already been approved. So please check it was already completed
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
No description
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
i dont see any orders approved The flow is that i create payment through toss api with secret key -> The api response checkout url -> then i make payment on that checkout url -> redirected to url success -> confirm -> error
Kimoon Lee
Kimoon Lee5mo ago
Could you check what was the value of confirmationMethod when you create the payment?
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
you mean method? i passed it 'CARD' whats wrong here
Kimoon Lee
Kimoon Lee5mo ago
no I mean "confirmationMethod"
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
No description
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
here r what i passed i just pass fields mentioned on docs
Kimoon Lee
Kimoon Lee5mo ago
Could you check the payment key when you call confirm API?
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
yes i have already checked it { "code": "ALREADY_PROCESSED_PAYMENT", "message": "이미 처리된 결제 입니다." } i dont know why the payment proccessed while i never authorized it
유부장
유부장5mo ago
Please let us know paymentKey of request that you have faced error
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
so wait for me a minute tviva20240821112846DcZt9
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
No description
유부장
유부장5mo ago
Oh you are using the publically shared key from docs, is it?
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
no i have individual account
유부장
유부장5mo ago
what is the MID that provided from Tosspayments? (Contract Merchant ID)
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
No description
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
i just use this and pass sk in header from server's request
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
No description
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
like this code
유부장
유부장5mo ago
I recommend you as below * Please use more complex orderId value for your test. Your orderId seems too simple. * There are several key type, and you are using api key pair that provided when you just register your accout at tosspayments.com. this key is sharing the resource with other public test env resource. * You may have dedicated merchant ID (MID) when you completed contract with Tosspayments. We recommend you to use MID's api key pair.
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
hmmm currently, i just test toss api for server so dont have MID apikey pair now
유부장
유부장5mo ago
ok, then please change orderId value (not simple one) and try again for the testing purpose, I am utilizing the orderId generate logic as below var orderId = new Date().getTime();
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
so the reason for this error is about orderId ? lemme check
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
No description
유부장
유부장5mo ago
card method amount need to be more than 100 KRW
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
: D okay
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
No description
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
Now its forbiddened when i made payment by vise, it redirected me to successful url, but i cant confirm that payment visa "mId": "tvivarepublica", "lastTransactionKey": "6A42E59A88C4B044B2D9568CE4576460", "paymentKey": "tviva20240821121215vzcX3", "orderId": "order-12312432sfdjdfh", "orderName": "hello world 166", "taxExemptionAmount": 0, "status": "IN_PROGRESS", "requestedAt": "2024-08-21T12:12:15+09:00", Look at this, the status is in "IN_PROGRESS" but i cant confirm through api
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
I have already tested this on toss web
No description
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
i guess the test key not support visa oversea? right. I cant found this information from anywhere in doc
유부장
유부장5mo ago
I have checked logs, You have tried confirmation API parameter as below {"orderId":"order-order-12312432sfdjdfh","paymentKey":"tviva20240821121215vzcX3","amount":1000} your payment request orderId should be "orderId":"order-12312432sfdjdfh" orderId of request payment and confirmaion is different. that is the reason why you received error
nghe mà bưa tề
nghe mà bưa tềOP5mo ago
Oh that is my mistake, sorry. Thanks all guys
토스페이먼츠 BOT
❤️ 기술문의 경험이 어떠셨나요?!
간단히 코멘트 남겨주세요! 제품 발전에 큰 힘이 됩니다.

Did you find this page helpful?