제이킹
제이킹3y ago

토스페이먼츠 결제 취소 웹훅 관련 문의드립니다.

안녕하세요, 결제 취소 Webhook 관련 문의드립니다. 먼저 테스트 환경은 다음과 같습니다. 1. 테스트 Webhook 2. 라이브 Webhook 저희가 사용하고 있는 토스페이먼츠 Webhook Event 는 다음과 같습니다. - PAYMENT_STATUS_CHANGED 토스페이먼츠 공식 문서에 따르면, PAYMENT_STATUS_CHANGED Event 의 응답 객체는 아래와 같습니다. https://docs.tosspayments.com/reference#payment-%EA%B0%9D%EC%B2%B4 문제는 저희 측에서 "토스페이먼츠 - 상점 - 결제 내역 - 결제취소" 를 진행하였을 때 전송된 Webhook 을 처리하는 과정에서 다음과 같은 에러가 발생합니다.
org.springframework.web.server.ServerWebInputException: 400 BAD_REQUEST “Failed to read HTTP message”; nested exception is org.springframework.core.codec.DecodingException: JSON decoding error: Instantiation of [simple type, class ....] value failed for JSON property version due to missing (therefore NULL) value for creator parameter version which is a non-nullable type; nested exception is com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class ....] value failed for JSON property version due to missing (therefore NULL) value for creator parameter version which is a non-nullable type
org.springframework.web.server.ServerWebInputException: 400 BAD_REQUEST “Failed to read HTTP message”; nested exception is org.springframework.core.codec.DecodingException: JSON decoding error: Instantiation of [simple type, class ....] value failed for JSON property version due to missing (therefore NULL) value for creator parameter version which is a non-nullable type; nested exception is com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class ....] value failed for JSON property version due to missing (therefore NULL) value for creator parameter version which is a non-nullable type
at [Source: (io.netty.buffer.ByteBufInputStream); line: 1, column: 1624] (through reference chain: ....TossWebhookPayload[“data”]->....[“version”])
at [Source: (io.netty.buffer.ByteBufInputStream); line: 1, column: 1624] (through reference chain: ....TossWebhookPayload[“data”]->....[“version”])
즉, 결제취소 시 PAYMENT_STATUS_CHANGED Event 를 통해 받은 토스페이먼츠 Json 에 version field 정보가 없어 Deserialize 에러가 발생하는데, 공식 문서에는 version field 가 Notnull 로 명시 되어있습니다.
{
"data": {
"mId": "tosspayments",
"version": "2022-11-16", // Not null
{
"data": {
"mId": "tosspayments",
"version": "2022-11-16", // Not null
테스트 환경에서의 Webhook 테스트 시에는 version field 가 담겨 정상적으로 응답하지만, 라이브 환경에서의 Webhook 테스트 시에는 version field 가 담겨오지 않아 Decode 에러가 발생합니다. 정리하자면, Webhook 의 PAYMENT_STATUS_CHANGED Event 를 통한 응답객체의 데이터 중 version field 가 문서에는 Notnull 이지만 Null로 들어와 Decode 에러가 발생합니다. 또한 동일한 조건에서, 테스트 Webhook 환경과 라이브 Webhook 환경의 결과가 다릅니다. version field 의 index 가 우선이므로 에러는 해당 필드에서 발생하였지만 다음 field 에서의 동일한 문제가 발생할 가능성이 있습니다. 라이브 Webhook 환경에서, 공식문서에 기반한 응답값 체크확인 부탁드립니다.
코어 API | 토스페이먼츠 개발자센터
토스페이먼츠 API 엔드포인트(Endpoint)와 객체 정보, 파라미터, 요청 및 응답 예제를 살펴보세요.
12 Replies
토스페이먼츠 BOT
⏳ 잠시만 기다려주세요! 곧 답변드리겠습니다
오류 문의일 경우 아래 정보를 미리 전달해주시면, 빠른 답변에 도움이 됩니다.
- 주문번호(orderId) : - 문의 내용 :
(img를 함께 첨부해주시면 도움이됩니다)
* 계약관련 내용은 1544-7772로 문의주세요. * 주말/공휴일에는 답변이 늦을 수 있어요.
today.lastday
today.lastday3y ago
테스트와 라이브에서 사용한 주문번호 확인 부탁드립니다.
제이킹
제이킹OP3y ago
테스트 주문번호 : HF1670570530614 라이브 주문번호 : HF1670573736648 입니다!
김차장
김차장3y ago
넵 내용은 확인되었구요. 개발팀과 상의해서 월요일에 알려드리겠습니다.
제이킹
제이킹OP3y ago
네 감사합니다😊
유부장
유부장3y ago
안녕하세요 확인 결과, 상점관리자에서 취소 되었을때 응답버전이 다른것으로 확인되었고, 관련 조치 진행 예정 입니다. 전달 감사드립니다.
토스페이먼츠 BOT
❤️ 기술문의 경험이 어떠셨나요?!
간단히 코멘트 남겨주세요! 제품 발전에 큰 힘이 됩니다.
제이킹
제이킹OP3y ago
조치 결과는 언제쯤 알수있읗까요~?
today.lastday
today.lastday3y ago
API 호출시에는 동일한 것으로 보이며, 상점관리자 취소하는 경우 버전컨텍스트가 꼬이는 것으로 보입니다. 혹시 상점관리자에서 취소할 경우 해당 결과를 확인하셨을까요?
제이킹
제이킹OP3y ago
네 상점관리자 결제내역에서 취소를 할 경우 위와 같은 현상이 발생합니다.
김차장
김차장3y ago
안녕하세요, 곧 배포가 진행될 예정입니다. 00시 이후로 확인하시면 잘 받으실 수 있으실거에요
제이킹
제이킹OP3y ago
네 감사합니다 확인해보겠습니다~!~! 정상적으로 내려오네요! 지원감사합니다😀

Did you find this page helpful?