어플리케이션에서 결제 취소 관련 문의
안녕하세요, 어플리케이션(next.js+react-native를 이용한 하이브리드 웹앱)에서 결제 모듈을 연동했는데, 결제 방법에 따라 상단 왼측에 x표시가 없어서 결제를 취소하려고 필연적으로 (안드로이드 기준) 핸드폰의 뒤로가기 버튼을 누르게 됩니다.
그렇게 했을 때, 결제 취소가 되지 않아 failUrl로 리다이렉트 되거나 위젯의 requestPayment의 catch(error)로 진행되지 않아 오류가 생기게 됩니다.
해결 방법이 없을까요?
코드는 아래와 같습니다.
try {
await paymentWidget?.requestPayment({
orderId: orderId,
orderName: orderName,
customerName: myName,
successUrl: window.location.origin + '/successPurchase',
failUrl: window.location.origin + '/failPurchase',
});
} catch (error) {
// 에러처리
}
그렇게 했을 때, 결제 취소가 되지 않아 failUrl로 리다이렉트 되거나 위젯의 requestPayment의 catch(error)로 진행되지 않아 오류가 생기게 됩니다.
해결 방법이 없을까요?
코드는 아래와 같습니다.
try {
await paymentWidget?.requestPayment({
orderId: orderId,
orderName: orderName,
customerName: myName,
successUrl: window.location.origin + '/successPurchase',
failUrl: window.location.origin + '/failPurchase',
});
} catch (error) {
// 에러처리
}
