Toss payments 개발자 커뮤니티Tp개커Toss payments 개발자 커뮤니티
Powered by
조갱조
Toss payments 개발자 커뮤니티•3y ago•
10 replies
조갱

XPayClient 응답값 문의

안녕하세요, 토스페이 알파환경 연동중에 문의드립니다.
구매 confirm 요청을 보내고, Response를 받아오는 과정에서 Exception이 발생합니다.

XPayClient의 Response를 수집하는 코드는 아래와 같습니다.
 kotlin
    private fun XPayClient.toResponseMap(): Map<String, String> {
        val result = HashMap<String, String>()
        log.info("====== [DEBUG] : ResponseNameCount: ${this.ResponseNameCount()}")
        log.info("====== [DEBUG] : ResponseCount: ${this.ResponseCount()}")

        for (i in 0 until this.ResponseNameCount()) {
            log.info("===== [DEBUG] this.Responsename(i) = ${this.ResponseName(i)} ===== ")
            log.info("===== [DEBUG] this.ResponseCount() - 1 = ${this.ResponseCount() - 1} =====")
            result[this.ResponseName(i)] = this.Response(this.ResponseName(i), this.ResponseCount() - 1)
            log.info("===== [DEBUG] $i 번까지 수행 완료")
        }
        return result
    }
 kotlin
    private fun XPayClient.toResponseMap(): Map<String, String> {
        val result = HashMap<String, String>()
        log.info("====== [DEBUG] : ResponseNameCount: ${this.ResponseNameCount()}")
        log.info("====== [DEBUG] : ResponseCount: ${this.ResponseCount()}")

        for (i in 0 until this.ResponseNameCount()) {
            log.info("===== [DEBUG] this.Responsename(i) = ${this.ResponseName(i)} ===== ")
            log.info("===== [DEBUG] this.ResponseCount() - 1 = ${this.ResponseCount() - 1} =====")
            result[this.ResponseName(i)] = this.Response(this.ResponseName(i), this.ResponseCount() - 1)
            log.info("===== [DEBUG] $i 번까지 수행 완료")
        }
        return result
    }

그리고, 위 코드에서 출력되는 로그는 아래와 같습니다.
20:47:14.136 [NioDispatcher-2 @coroutine#1] INFO  c.n.p.g.t.TossPaymentsClient - ===== [DEBUG] 38 번까지 수행 완료
20:47:14.136 [NioDispatcher-2 @coroutine#1] INFO  c.n.p.g.t.TossPaymentsClient - ===== [DEBUG] this.Responsename(i) = LGD_BUYERID ===== 
20:47:14.136 [NioDispatcher-2 @coroutine#1] INFO  c.n.p.g.t.TossPaymentsClient - ===== [DEBUG] this.ResponseCount() - 1 = 0 =====
20:47:14.136 [NioDispatcher-2 @coroutine#1] INFO  c.n.p.g.t.TossPaymentsClient - ===== [DEBUG] 39 번까지 수행 완료
20:47:14.136 [NioDispatcher-2 @coroutine#1] INFO  c.n.p.g.t.TossPaymentsClient - ===== [DEBUG] this.Responsename(i) = LGD_ORDERS_METADATA ===== 
20:47:14.136 [NioDispatcher-2 @coroutine#1] INFO  c.n.p.g.t.TossPaymentsClient - ===== [DEBUG] this.ResponseCount() - 1 = 0 =====
20:47:14.186 [NioDispatcher-2 @coroutine#1] ERROR c.n.p.c.GlobalErrorWebExceptionHandler - Internal Error
java.lang.NullPointerException: this.Response(this.Respo…this.ResponseCount() - 1) must not be null
20:47:14.136 [NioDispatcher-2 @coroutine#1] INFO  c.n.p.g.t.TossPaymentsClient - ===== [DEBUG] 38 번까지 수행 완료
20:47:14.136 [NioDispatcher-2 @coroutine#1] INFO  c.n.p.g.t.TossPaymentsClient - ===== [DEBUG] this.Responsename(i) = LGD_BUYERID ===== 
20:47:14.136 [NioDispatcher-2 @coroutine#1] INFO  c.n.p.g.t.TossPaymentsClient - ===== [DEBUG] this.ResponseCount() - 1 = 0 =====
20:47:14.136 [NioDispatcher-2 @coroutine#1] INFO  c.n.p.g.t.TossPaymentsClient - ===== [DEBUG] 39 번까지 수행 완료
20:47:14.136 [NioDispatcher-2 @coroutine#1] INFO  c.n.p.g.t.TossPaymentsClient - ===== [DEBUG] this.Responsename(i) = LGD_ORDERS_METADATA ===== 
20:47:14.136 [NioDispatcher-2 @coroutine#1] INFO  c.n.p.g.t.TossPaymentsClient - ===== [DEBUG] this.ResponseCount() - 1 = 0 =====
20:47:14.186 [NioDispatcher-2 @coroutine#1] ERROR c.n.p.c.GlobalErrorWebExceptionHandler - Internal Error
java.lang.NullPointerException: this.Response(this.Respo…this.ResponseCount() - 1) must not be null


즉,
LGD_ORDERS_METADATA
LGD_ORDERS_METADATA
이 ResponseName의 값이 없는것 같은데, 이유가 궁금합니다.
(리얼(운영) 환경에서는 정상 동작하는데, 알파환경만 발생합니다..)
Toss payments 개발자 커뮤니티 banner
Toss payments 개발자 커뮤니티Join
Toss payments 개발자 커뮤니티입니다. 결제 연동하며 겪는 기술 문의부터, 결제 시장에 대한 다양한 정보까지 얻어가세요~
15,588Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

XPayClient 문의
GGGGG / ❓┃연동개발-문의
10mo ago
XPAYClient 관련 문의
정찬복/레드블루정정찬복/레드블루 / ❓┃연동개발-문의
12mo ago
간편결제 응답값 문의
LeeLLee / ❓┃연동개발-문의
12mo ago
지급대행 응답값 문의
JINIJJINI / ❓┃연동개발-문의
15mo ago