수정을 하고 난 뒤에 로그를 확인해 봤더니 아래와 같이 역시나 400 Bad Request 오류가 발생합니다.
어떤게 잘못된건지 알려주세요 ^^
===========================request begin================================================
URI : https://kapi.kakao.com/v1/payment/ready
Method : POST
Headers : {Accept=[application/json;charset=UTF-8], Authorization=[KakaoAK 695c206ec549d13455fd2e0b582ea69a], Content-Type=[application/x-www-form-urlencoded;charset=UTF-8], Content-Length=[318]}
Request body: cid=TC0ONETIME&partner_order_id=1001&partner_user_id=test%40koitt.com&item_name=%EA%B0%A4%EB%9F%AD%EC%8B%9CS9&quantity=1&total_amount=1155000&tax_free_amount=0&approval_url=http%3A%2F%2Flocalhost%3A8082%2Fapproval.do&cancel_url=http%3A%2F%2Flocalhost%3A8082%2Fcancel.do&fail_url=http%3A%2F%2Flocalhost%3A8082%2Ffail.do
==========================request end================================================
Exception in thread “main” org.springframework.web.client.ResourceAccessException: I/O error on POST request for “https://kapi.kakao.com/v1/payment/ready”: Server returned HTTP response code: 400 for URL: https://kapi.kakao.com/v1/payment/ready; nested exception is java.io.IOException: Server returned HTTP response code: 400 for URL: https://kapi.kakao.com/v1/payment/ready
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:674)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:636)
at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:406)
at test.KakaoPayTestDrive.paymentReady(KakaoPayTestDrive.java:53)
at test.KakaoPayTestDrive.main(KakaoPayTestDrive.java:23)
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://kapi.kakao.com/v1/payment/ready
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at org.springframework.http.client.SimpleClientHttpResponse.getBody(SimpleClientHttpResponse.java:85)
at org.springframework.http.client.BufferingClientHttpResponseWrapper.getBody(BufferingClientHttpResponseWrapper.java:69)
at test.LoggingRequestInterceptor.traceResponse(LoggingRequestInterceptor.java:33)
at test.LoggingRequestInterceptor.intercept(LoggingRequestInterceptor.java:18)
at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:86)
at org.springframework.http.client.InterceptingClientHttpRequest.executeInternal(InterceptingClientHttpRequest.java:70)
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:660)
… 4 more