https://tyrannocoding.tistory.com/44
private IamportClient api;
public ReserveCreateController() {
this.api = new IamportClient("5396366384017153","483b3abedb0f4e219f1fe9528a7fe23131a03914c61ecc767f0886e618f94e907da270c735dbd609");
}
@ResponseBody
@RequestMapping(value="/verifyIamport/{imp_uid}", method=RequestMethod.POST)
public IamportResponse<Payment> paymentByImpUid(
Model model
, Locale locale
, HttpSession session
, @PathVariable(value= "imp_uid") String imp_uid) throws IamportResponseException, IOException
{
return api.paymentByImpUid(imp_uid);
}
쓰던 컨트롤러에 저 내용들 추가함
xml로 뜨는문제 발생
jQuery.ajax({
type : "POST",
beforeSend : function(xhr)
{
xhr.setRequestHeader(header,token);
},
url : "${cPath}/reserve/verifyIamport/" + rsp.imp_uid
}).done(function(data) {
console.log(data);
let value = jQuery(data).find("amount").text()
console.log("value",value); // HTML
파싱으로 해결하였다