[SHOPTIME-3662] Checkout 이동 시 "thisProductDoesNotSupportPayment" 팝업 노출
수정 내용: 에러 코드 별 메세지 추가
This commit is contained in:
@@ -102,7 +102,10 @@ export const getCheckoutTotalAmt =
|
||||
} else {
|
||||
dispatch({
|
||||
type: types.GET_CHECKOUT_TOTAL_AMT_ERROR,
|
||||
payload: response.data.retCode,
|
||||
payload: {
|
||||
retCode: response.data.retCode,
|
||||
retMsg: response.data.retMsg,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -29,13 +29,17 @@ export const checkoutReducer = (state = initialState, action) => {
|
||||
return {
|
||||
...state,
|
||||
checkoutTotalData: action.payload,
|
||||
checkoutTotalError: null,
|
||||
};
|
||||
|
||||
case types.GET_CHECKOUT_TOTAL_AMT_ERROR:
|
||||
return {
|
||||
...state,
|
||||
checkoutTotalData: {},
|
||||
checkoutTotalError: action.payload,
|
||||
checkoutTotalError: {
|
||||
retCode: action.payload.retCode,
|
||||
retMsg: action.payload.retMsg,
|
||||
},
|
||||
};
|
||||
|
||||
case types.INSERT_MY_INFO_CHECKOUT_ORDER:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { $L } from "./helperMethods";
|
||||
|
||||
export const SUPPORT_COUNTRIES = { US: "en", DE: "de", UK: "uk", RU: "ru" };
|
||||
|
||||
// debug
|
||||
@@ -332,3 +334,207 @@ export const LOG_MENU = {
|
||||
CHECKOUT_PIN_CODE: "Checkout/PIN Code",
|
||||
CHECKOUT_ORDER_COMPLETE: "Checkout/Order Complete",
|
||||
};
|
||||
|
||||
// ERROR MESSAGE
|
||||
export const ERROR_MESSAGES_GROUPS = [
|
||||
{
|
||||
codes: [502, 503, 504],
|
||||
message: $L(
|
||||
"We're sorry, but this request cannot be supported by the service."
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [505, 506, 508],
|
||||
message: $L("Please confirm your agreement to the terms and conditions."),
|
||||
},
|
||||
{
|
||||
codes: [508, 509, 600, 601, 900, 901, 903, 904, 905, 906, 907],
|
||||
message: $L(
|
||||
"We're sorry, but an error occurred on the server. Please try again later."
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [602, 603, 604, 605, 606],
|
||||
message: $L(
|
||||
"Unsupported request. Please check the system configuration settings"
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [921, 922, 923, 924, 925, 926],
|
||||
message: $L(
|
||||
"Required information for the order is missing. Please check and try again."
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [927, 928, 929, 930, 931, 932, 933, 934, 941],
|
||||
message: $L(
|
||||
"Customer information is missing. Please check your details and try again."
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [935, 936, 937, 938, 939, 940],
|
||||
message: $L(
|
||||
"We're sorry, but there seems to be an issue with your order request. Please check and try again."
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [1006, 1007],
|
||||
message: $L(
|
||||
"Customer information is missing. Please check your details and try again."
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [1008],
|
||||
message: $L(
|
||||
"We're sorry, but there seems to be an issue with your order request. Please check and try again."
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [1009],
|
||||
message: $L(
|
||||
"Payment cannot be processed. Please check your details and try again."
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [1010],
|
||||
message: $L("This coupon has already been used."),
|
||||
},
|
||||
{
|
||||
codes: [1011],
|
||||
message: $L("There is an error with the membership system."),
|
||||
},
|
||||
{
|
||||
codes: [1012],
|
||||
message: $L("There is an error with the payment system."),
|
||||
},
|
||||
{
|
||||
codes: [1013],
|
||||
message: $L("You have already received this coupon."),
|
||||
},
|
||||
{
|
||||
codes: [1014],
|
||||
message: $L("This item is out of stock."),
|
||||
},
|
||||
{
|
||||
codes: [1015],
|
||||
message: $L("Card information is missing."),
|
||||
},
|
||||
{
|
||||
codes: [1016, 1017],
|
||||
message: $L("Invalid product information."),
|
||||
},
|
||||
{
|
||||
codes: [1018, 1019],
|
||||
message: $L("Coupon information is missing."),
|
||||
},
|
||||
{
|
||||
codes: [1020],
|
||||
message: $L("Order system error."),
|
||||
},
|
||||
{
|
||||
codes: [1021],
|
||||
message: $L("Invalid PIN."),
|
||||
},
|
||||
{
|
||||
codes: [1024],
|
||||
message: $L("Payment request failed."),
|
||||
},
|
||||
{
|
||||
codes: [1025],
|
||||
message: $L("An error has occurred in the tax lookup system."),
|
||||
},
|
||||
{
|
||||
codes: [1026],
|
||||
message: $L("Invalid product information."),
|
||||
},
|
||||
{
|
||||
codes: [1027],
|
||||
message: $L(
|
||||
"This item cannot be purchased on the TV. Please scan the QR code or send an SMS."
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [1028],
|
||||
message: $L("Invalid email format."),
|
||||
},
|
||||
{
|
||||
codes: [1029],
|
||||
message: $L("Please select a payment method."),
|
||||
},
|
||||
{
|
||||
codes: [1030],
|
||||
message: $L("Payment cancellation request failed."),
|
||||
},
|
||||
{
|
||||
codes: [1033],
|
||||
message: $L(
|
||||
"Customer information is missing. Please check your details and try again."
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [1037],
|
||||
message: $L("Invalid data format."),
|
||||
},
|
||||
{
|
||||
codes: [1038],
|
||||
message: $L(
|
||||
"Required information for the order is missing. Please check and try again."
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [1039, 1040],
|
||||
message: $L("Payment cancellation request failed."),
|
||||
},
|
||||
{
|
||||
codes: [1041],
|
||||
message: $L("You have exceeded the coupon issuance limit."),
|
||||
},
|
||||
{
|
||||
codes: [1104],
|
||||
message: $L("Only one coupon can be used."),
|
||||
},
|
||||
{
|
||||
codes: [1106],
|
||||
message: $L("Invalid card information."),
|
||||
},
|
||||
{
|
||||
codes: [1107],
|
||||
message: $L("Invalid price information."),
|
||||
},
|
||||
{
|
||||
codes: [1109],
|
||||
message: $L("This coupon cannot be used for the current amount."),
|
||||
},
|
||||
{
|
||||
codes: [1122],
|
||||
message: $L("Invalid card information."),
|
||||
},
|
||||
{
|
||||
codes: [1123, 1124],
|
||||
message: $L(
|
||||
"Customer information is missing. Please check your details and try again."
|
||||
),
|
||||
},
|
||||
{
|
||||
codes: [1125],
|
||||
message: $L("Card information is missing."),
|
||||
},
|
||||
{
|
||||
codes: [1126, 1127],
|
||||
message: $L("There are terms and conditions that have not been agreed to."),
|
||||
},
|
||||
{
|
||||
codes: [1130],
|
||||
message: $L("This coupon cannot be used for the current amount."),
|
||||
},
|
||||
{
|
||||
codes: [1134],
|
||||
message: $L("This order has already been canceled."),
|
||||
},
|
||||
{
|
||||
codes: [1139],
|
||||
message: $L(
|
||||
"This order has already been shipped and cannot be canceled. Please contact ShopLC Customer Service. Contact Information -ShopLC: 877-899-0078 (Customer Service)"
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -6,7 +6,7 @@ import stringReSourceEn from "../../resources/en/strings.json";
|
||||
import stringReSourceGb from "../../resources/gb/strings.json";
|
||||
import stringReSourceRu from "../../resources/ru/strings.json";
|
||||
import { getRicCode } from "../api/apiConfig";
|
||||
import { SECRET_KEY } from "./Config";
|
||||
import { ERROR_MESSAGES_GROUPS, SECRET_KEY } from "./Config";
|
||||
|
||||
let _boundingRectCache = {};
|
||||
const BOUNDING_RECT_IGNORE_TIME = 10;
|
||||
@@ -525,3 +525,16 @@ export const getTimeDifferenceByMilliseconds = (
|
||||
|
||||
return timeDifference > threshold;
|
||||
};
|
||||
|
||||
export const getErrorMessage = (errorCode, retMsg) => {
|
||||
const group = ERROR_MESSAGES_GROUPS.find((group) =>
|
||||
group.codes.includes(Number(errorCode))
|
||||
);
|
||||
if (group) {
|
||||
return group.message;
|
||||
} else if (retMsg) {
|
||||
return retMsg;
|
||||
} else {
|
||||
return "An unknown error occurred. Please try again later.";
|
||||
}
|
||||
};
|
||||
|
||||
@@ -125,9 +125,9 @@
|
||||
|
||||
p {
|
||||
width: 100%;
|
||||
font-size: 36px;
|
||||
font-size: 28px;
|
||||
color: #222222;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.popupBtn {
|
||||
|
||||
@@ -9,7 +9,11 @@ import { popPanel } from "../../../actions/panelActions";
|
||||
import TButton from "../../../components/TButton/TButton";
|
||||
import TPopUp from "../../../components/TPopUp/TPopUp";
|
||||
import * as Config from "../../../utils/Config";
|
||||
import { $L, formatCurrencyValue } from "../../../utils/helperMethods";
|
||||
import {
|
||||
$L,
|
||||
formatCurrencyValue,
|
||||
getErrorMessage,
|
||||
} from "../../../utils/helperMethods";
|
||||
import css from "./SummaryContainer.module.less";
|
||||
|
||||
const Container = SpotlightContainerDecorator(
|
||||
@@ -17,13 +21,6 @@ const Container = SpotlightContainerDecorator(
|
||||
"div"
|
||||
);
|
||||
|
||||
const getErrorMessage = (errorCode) => {
|
||||
switch (errorCode) {
|
||||
default:
|
||||
return "ERROR OCCURRED";
|
||||
}
|
||||
};
|
||||
|
||||
export default function SummaryContainer({
|
||||
setPlaceOrderPopup,
|
||||
empTermsData,
|
||||
@@ -53,6 +50,16 @@ export default function SummaryContainer({
|
||||
}
|
||||
}, [checkoutTotalError]);
|
||||
|
||||
const errorMessage = useMemo(() => {
|
||||
if (checkoutTotalError) {
|
||||
return getErrorMessage(
|
||||
checkoutTotalError.retCode,
|
||||
checkoutTotalError.retMsg
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}, [checkoutTotalError]);
|
||||
|
||||
const handleCloseErrorPopup = useCallback(() => {
|
||||
dispatch(setHidePopup());
|
||||
dispatch(popPanel());
|
||||
@@ -208,7 +215,7 @@ export default function SummaryContainer({
|
||||
className={css.checkoutErrorPopup}
|
||||
>
|
||||
<div className={css.popupContainer}>
|
||||
<p>ERROR OCCURRED</p>
|
||||
<p className={css.errMsg}>{errorMessage}</p>
|
||||
<TButton className={css.popupBtn} onClick={handleCloseErrorPopup}>
|
||||
{$L("OK")}
|
||||
</TButton>
|
||||
|
||||
Reference in New Issue
Block a user