paypal 결제 지원
try {
await axios.post("/api/confirm/register", {
paymentKey,
orderId,
amount: amount.value,
orderName: "12345",
data: data
}, {
headers: {
Authorization:
}
});
await widgets.requestPayment({
orderId,
orderName: "1234",
successUrl: window.location.origin +"/success",
failUrl: window.location.origin +"/fail"
});
//await onSave(data);
onClose(); // 결제 후 모달 닫기
} catch (error) {
alert("An error occurred while processing the payment. Please try again.");
console.error(error);
}finally {
setIsLoading(false); // 결제 완료 후 로딩 상태 해제
}
이런식으로 결제 를 했고
widgets.renderPaymentMethods({ selector: "#payment-method", variantKey: variantKey }),
widgets.renderAgreement({ selector: "#agreement", variantKey: "AGREEMENT" }),
variantKey값을 변경해서 접속국가 확인해서 한국이 아닐땐 paypal이 들어가서 페이팔 결제 창이 뜨도록 했는데
로컬에서는 페이팔 결제로 잘 연결되는데 테스트로 VPN사용시에 ("An error occurred while processing the payment. Please try again."); 오류가 발생합니다. Backend쪽에서는 오류 발생하기 전이라서 frontend에서 에러 발생하는 것으로 보이는데 혹시 페이팔결제시 제가 빠뜨린게있을까요?
await axios.post("/api/confirm/register", {
paymentKey,
orderId,
amount: amount.value,
orderName: "12345",
data: data
}, {
headers: {
Authorization:
Bearer ${token} // Authorization 헤더 추가}
});
await widgets.requestPayment({
orderId,
orderName: "1234",
successUrl: window.location.origin +"/success",
failUrl: window.location.origin +"/fail"
});
//await onSave(data);
onClose(); // 결제 후 모달 닫기
} catch (error) {
alert("An error occurred while processing the payment. Please try again.");
console.error(error);
}finally {
setIsLoading(false); // 결제 완료 후 로딩 상태 해제
}
이런식으로 결제 를 했고
widgets.renderPaymentMethods({ selector: "#payment-method", variantKey: variantKey }),
widgets.renderAgreement({ selector: "#agreement", variantKey: "AGREEMENT" }),
variantKey값을 변경해서 접속국가 확인해서 한국이 아닐땐 paypal이 들어가서 페이팔 결제 창이 뜨도록 했는데
로컬에서는 페이팔 결제로 잘 연결되는데 테스트로 VPN사용시에 ("An error occurred while processing the payment. Please try again."); 오류가 발생합니다. Backend쪽에서는 오류 발생하기 전이라서 frontend에서 에러 발생하는 것으로 보이는데 혹시 페이팔결제시 제가 빠뜨린게있을까요?
