[SHOPTIME-3662] Checkout 이동 시 "thisProductDoesNotSupportPayment" 팝업 노출

수정 내용: 에러 코드 별 메세지 추가
This commit is contained in:
hyunwoo93.cha
2024-10-18 14:28:21 +09:00
parent f6dbac465c
commit 4df3fa9f0f
6 changed files with 247 additions and 14 deletions

View File

@@ -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.";
}
};