change getQRCodeUrl
This commit is contained in:
@@ -5,6 +5,7 @@ import stringReSourceDe from "../../resources/de/strings.json";
|
||||
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";
|
||||
|
||||
let _boundingRectCache = {};
|
||||
const BOUNDING_RECT_IGNORE_TIME = 10;
|
||||
@@ -335,23 +336,42 @@ export const getFormattingCardNo = (cardNumber) => {
|
||||
};
|
||||
|
||||
export const getQRCodeUrl = ({
|
||||
serverHOST,
|
||||
serverType,
|
||||
countryCode,
|
||||
patnrId,
|
||||
prdtId,
|
||||
dirPurcSelYn = "Y",
|
||||
prdtData,
|
||||
}) => {
|
||||
let baseUrl = "https://qt3-m.shoptime.lgappstv.com/";
|
||||
|
||||
if (serverType === "qt2") {
|
||||
baseUrl = "https://qt3-m.shoptime.lgappstv.com/";
|
||||
} else if (serverType === "qt") {
|
||||
baseUrl = "https://qt-m.shoptime.lgappstv.com/";
|
||||
} else if (serverType === "prd") {
|
||||
baseUrl = "https://m.shoptime.lgappstv.com/";
|
||||
if (!serverHOST) {
|
||||
console.error("getQRCodeUrl: Not Supported, Host is missing");
|
||||
return {};
|
||||
}
|
||||
|
||||
let sdpURL = serverHOST.split(".")[0];
|
||||
let countryCode = "";
|
||||
|
||||
if (sdpURL.indexOf("-") > 0) {
|
||||
countryCode = sdpURL.split("-")[1];
|
||||
} else {
|
||||
countryCode = sdpURL;
|
||||
}
|
||||
|
||||
sdpURL = sdpURL.toLowerCase();
|
||||
|
||||
if (serverType !== "system") {
|
||||
sdpURL = serverType;
|
||||
}
|
||||
|
||||
let baseUrl = "";
|
||||
|
||||
if (sdpURL.indexOf("qt2") >= 0) {
|
||||
baseUrl = "https://qt3-m.shoptime.lgappstv.com/";
|
||||
} else if (sdpURL.indexOf("qt") >= 0) {
|
||||
baseUrl = "https://qt-m.shoptime.lgappstv.com/";
|
||||
} else {
|
||||
baseUrl = "https://m.shoptime.lgappstv.com/";
|
||||
}
|
||||
const prdtDataStr = JSON.stringify(prdtData);
|
||||
const prdtDataBase64 = btoa(prdtDataStr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user