혹시 카드관련해서요
데이터 저장하려고하는데
private CardRequest card;로
@Getter
@Setter
public static class CardRequest {
private String number;
private String issuerCode;
private String acquirerCode;
private String installmentPlanMonths;
private String approveNo;
private String cardType;
private String ownerType;
private String acquireStatus;
private String isInterestFree;
private String interestPayer;
private BigDecimal amount;
}
만들었는데 가져오는 과정에서 Failed to execute 'json' on 'Response': Unexpected end of JSON input에러가 발생하는데 그렇다고 값이 안들어오는것도 아니고 issuerCode등 출력이 되는데
관련 내용 찾아 보긴했는데 혹시 리액트 문제 일까요?
리액트는 예제에서 거의 수정을 안해서요
// Authorization 토큰 가져오기 (예: 로컬 스토리지에서)
const token = getCookie('accessToken');
async function confirm() {
const requestData = {
orderId: searchParams.get("orderId"),
amount: searchParams.get("amount"),
paymentKey: searchParams.get("paymentKey"),
};
const response = await fetch("/api/confirm/widget", {
method: "POST",
headers: {
Authorization:
"Content-Type": "application/json",
},
body: JSON.stringify(requestData),
});
const json = await response.json();
if (!response.ok) {
throw { message: json.message, code: json.code };
}
return json;
}
confirm()
.then((data) => {
setResponseData(data);
})
.catch((error) => {
navigate(
});
}, [searchParams]);
혹시 관련내용해서 질문 받으셨는지 궁금해서 질문남겨봅니다.
private CardRequest card;로
@Getter
@Setter
public static class CardRequest {
private String number;
private String issuerCode;
private String acquirerCode;
private String installmentPlanMonths;
private String approveNo;
private String cardType;
private String ownerType;
private String acquireStatus;
private String isInterestFree;
private String interestPayer;
private BigDecimal amount;
}
만들었는데 가져오는 과정에서 Failed to execute 'json' on 'Response': Unexpected end of JSON input에러가 발생하는데 그렇다고 값이 안들어오는것도 아니고 issuerCode등 출력이 되는데
관련 내용 찾아 보긴했는데 혹시 리액트 문제 일까요?
리액트는 예제에서 거의 수정을 안해서요
// Authorization 토큰 가져오기 (예: 로컬 스토리지에서)
const token = getCookie('accessToken');
async function confirm() {
const requestData = {
orderId: searchParams.get("orderId"),
amount: searchParams.get("amount"),
paymentKey: searchParams.get("paymentKey"),
};
const response = await fetch("/api/confirm/widget", {
method: "POST",
headers: {
Authorization:
Bearer ${token} ,// Authorization 헤더 추가"Content-Type": "application/json",
},
body: JSON.stringify(requestData),
});
const json = await response.json();
if (!response.ok) {
throw { message: json.message, code: json.code };
}
return json;
}
confirm()
.then((data) => {
setResponseData(data);
})
.catch((error) => {
navigate(
/fail?code=${error.code}&message=${error.message});});
}, [searchParams]);
혹시 관련내용해서 질문 받으셨는지 궁금해서 질문남겨봅니다.
