@pelcro/react-pelcro-js 3.10.1-beta.8 → 3.10.1-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +68 -70
- package/dist/index.esm.js +68 -70
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -15867,9 +15867,8 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15867
15867
|
const vantivInstanceRef = React__default['default'].useRef(null);
|
|
15868
15868
|
const tapInstanceRef = React__default['default'].useRef(null);
|
|
15869
15869
|
const tapInstanceCard = React__default['default'].useRef(null);
|
|
15870
|
+
const cardProcessor = getSiteCardProcessor();
|
|
15870
15871
|
React.useEffect(() => {
|
|
15871
|
-
const cardProcessor = getSiteCardProcessor();
|
|
15872
|
-
|
|
15873
15872
|
if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
|
|
15874
15873
|
var _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
15875
15874
|
|
|
@@ -15896,76 +15895,75 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15896
15895
|
}
|
|
15897
15896
|
});
|
|
15898
15897
|
}
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
15904
|
-
|
|
15905
|
-
|
|
15906
|
-
|
|
15907
|
-
|
|
15908
|
-
|
|
15909
|
-
|
|
15910
|
-
|
|
15911
|
-
|
|
15912
|
-
|
|
15913
|
-
|
|
15914
|
-
|
|
15915
|
-
|
|
15916
|
-
|
|
15917
|
-
}
|
|
15918
|
-
},
|
|
15919
|
-
invalid: {
|
|
15920
|
-
color: "red"
|
|
15898
|
+
}, [selectedPaymentMethodId]);
|
|
15899
|
+
React.useEffect(() => {
|
|
15900
|
+
if (cardProcessor === "tap" && !selectedPaymentMethodId && window.Tapjsli) {
|
|
15901
|
+
var _window$Pelcro$site$r3;
|
|
15902
|
+
|
|
15903
|
+
console.log("Yes Tap JSLI is enabled and activated");
|
|
15904
|
+
const tapKey = Tapjsli((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.tap_gateway_settings.publishable_key);
|
|
15905
|
+
let elements = tapKey.elements({});
|
|
15906
|
+
let style = {
|
|
15907
|
+
base: {
|
|
15908
|
+
color: "#535353",
|
|
15909
|
+
lineHeight: "18px",
|
|
15910
|
+
fontFamily: "sans-serif",
|
|
15911
|
+
fontSmoothing: "antialiased",
|
|
15912
|
+
fontSize: "16px",
|
|
15913
|
+
"::placeholder": {
|
|
15914
|
+
color: "rgba(0, 0, 0, 0.26)",
|
|
15915
|
+
fontSize: "15px"
|
|
15921
15916
|
}
|
|
15922
|
-
}
|
|
15923
|
-
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
|
|
15927
|
-
|
|
15928
|
-
|
|
15929
|
-
|
|
15930
|
-
|
|
15931
|
-
|
|
15932
|
-
|
|
15933
|
-
|
|
15934
|
-
|
|
15935
|
-
|
|
15936
|
-
|
|
15937
|
-
|
|
15938
|
-
|
|
15939
|
-
|
|
15940
|
-
|
|
15941
|
-
|
|
15942
|
-
|
|
15943
|
-
|
|
15944
|
-
|
|
15945
|
-
|
|
15946
|
-
|
|
15947
|
-
|
|
15948
|
-
|
|
15949
|
-
|
|
15950
|
-
|
|
15951
|
-
|
|
15952
|
-
|
|
15953
|
-
|
|
15954
|
-
|
|
15955
|
-
|
|
15956
|
-
|
|
15957
|
-
|
|
15958
|
-
|
|
15959
|
-
|
|
15960
|
-
|
|
15961
|
-
|
|
15962
|
-
|
|
15963
|
-
|
|
15964
|
-
|
|
15965
|
-
|
|
15966
|
-
|
|
15917
|
+
},
|
|
15918
|
+
invalid: {
|
|
15919
|
+
color: "red"
|
|
15920
|
+
}
|
|
15921
|
+
}; // input labels/placeholders
|
|
15922
|
+
|
|
15923
|
+
let labels = {
|
|
15924
|
+
cardNumber: "Card Number",
|
|
15925
|
+
expirationDate: "MM/YY",
|
|
15926
|
+
cvv: "CVV",
|
|
15927
|
+
cardHolder: "Card Holder Name"
|
|
15928
|
+
}; //payment options
|
|
15929
|
+
|
|
15930
|
+
let paymentOptions = {
|
|
15931
|
+
labels: labels,
|
|
15932
|
+
TextDirection: "ltr"
|
|
15933
|
+
}; //create element, pass style and payment options
|
|
15934
|
+
|
|
15935
|
+
let card = elements.create("card", {
|
|
15936
|
+
style: style
|
|
15937
|
+
}, paymentOptions); //mount element
|
|
15938
|
+
|
|
15939
|
+
card.mount("#tapPaymentIframe"); //card change event listener
|
|
15940
|
+
|
|
15941
|
+
card.addEventListener("change", function (event) {// if (event.error_interactive) {
|
|
15942
|
+
// onFailure(event.error_interactive);
|
|
15943
|
+
// return dispatch({
|
|
15944
|
+
// type: SHOW_ALERT,
|
|
15945
|
+
// payload: {
|
|
15946
|
+
// type: "error",
|
|
15947
|
+
// content: getErrorMessages(event.error_interactive)
|
|
15948
|
+
// }
|
|
15949
|
+
// });
|
|
15950
|
+
// } else {
|
|
15951
|
+
// dispatch({
|
|
15952
|
+
// type: SHOW_ALERT,
|
|
15953
|
+
// payload: { type: "error", content: "" }
|
|
15954
|
+
// });
|
|
15955
|
+
// }
|
|
15956
|
+
// let displayError = document.getElementById("error-handler");
|
|
15957
|
+
// if (event.error) {
|
|
15958
|
+
// displayError.textContent = event.error.message;
|
|
15959
|
+
// } else {
|
|
15960
|
+
// displayError.textContent = "";
|
|
15961
|
+
// }
|
|
15962
|
+
});
|
|
15963
|
+
tapInstanceRef.current = tapKey;
|
|
15964
|
+
tapInstanceCard.current = card;
|
|
15967
15965
|
}
|
|
15968
|
-
}, [selectedPaymentMethodId]);
|
|
15966
|
+
}, [selectedPaymentMethodId, window.Tapjsli]);
|
|
15969
15967
|
|
|
15970
15968
|
const initPaymentRequest = (state, dispatch) => {
|
|
15971
15969
|
try {
|
package/dist/index.esm.js
CHANGED
|
@@ -15837,9 +15837,8 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15837
15837
|
const vantivInstanceRef = React__default.useRef(null);
|
|
15838
15838
|
const tapInstanceRef = React__default.useRef(null);
|
|
15839
15839
|
const tapInstanceCard = React__default.useRef(null);
|
|
15840
|
+
const cardProcessor = getSiteCardProcessor();
|
|
15840
15841
|
useEffect(() => {
|
|
15841
|
-
const cardProcessor = getSiteCardProcessor();
|
|
15842
|
-
|
|
15843
15842
|
if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
|
|
15844
15843
|
var _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
15845
15844
|
|
|
@@ -15866,76 +15865,75 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15866
15865
|
}
|
|
15867
15866
|
});
|
|
15868
15867
|
}
|
|
15869
|
-
|
|
15870
|
-
|
|
15871
|
-
|
|
15872
|
-
|
|
15873
|
-
|
|
15874
|
-
|
|
15875
|
-
|
|
15876
|
-
|
|
15877
|
-
|
|
15878
|
-
|
|
15879
|
-
|
|
15880
|
-
|
|
15881
|
-
|
|
15882
|
-
|
|
15883
|
-
|
|
15884
|
-
|
|
15885
|
-
|
|
15886
|
-
|
|
15887
|
-
}
|
|
15888
|
-
},
|
|
15889
|
-
invalid: {
|
|
15890
|
-
color: "red"
|
|
15868
|
+
}, [selectedPaymentMethodId]);
|
|
15869
|
+
useEffect(() => {
|
|
15870
|
+
if (cardProcessor === "tap" && !selectedPaymentMethodId && window.Tapjsli) {
|
|
15871
|
+
var _window$Pelcro$site$r3;
|
|
15872
|
+
|
|
15873
|
+
console.log("Yes Tap JSLI is enabled and activated");
|
|
15874
|
+
const tapKey = Tapjsli((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.tap_gateway_settings.publishable_key);
|
|
15875
|
+
let elements = tapKey.elements({});
|
|
15876
|
+
let style = {
|
|
15877
|
+
base: {
|
|
15878
|
+
color: "#535353",
|
|
15879
|
+
lineHeight: "18px",
|
|
15880
|
+
fontFamily: "sans-serif",
|
|
15881
|
+
fontSmoothing: "antialiased",
|
|
15882
|
+
fontSize: "16px",
|
|
15883
|
+
"::placeholder": {
|
|
15884
|
+
color: "rgba(0, 0, 0, 0.26)",
|
|
15885
|
+
fontSize: "15px"
|
|
15891
15886
|
}
|
|
15892
|
-
}
|
|
15893
|
-
|
|
15894
|
-
|
|
15895
|
-
|
|
15896
|
-
|
|
15897
|
-
|
|
15898
|
-
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
15904
|
-
|
|
15905
|
-
|
|
15906
|
-
|
|
15907
|
-
|
|
15908
|
-
|
|
15909
|
-
|
|
15910
|
-
|
|
15911
|
-
|
|
15912
|
-
|
|
15913
|
-
|
|
15914
|
-
|
|
15915
|
-
|
|
15916
|
-
|
|
15917
|
-
|
|
15918
|
-
|
|
15919
|
-
|
|
15920
|
-
|
|
15921
|
-
|
|
15922
|
-
|
|
15923
|
-
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
|
|
15927
|
-
|
|
15928
|
-
|
|
15929
|
-
|
|
15930
|
-
|
|
15931
|
-
|
|
15932
|
-
|
|
15933
|
-
|
|
15934
|
-
|
|
15935
|
-
|
|
15936
|
-
|
|
15887
|
+
},
|
|
15888
|
+
invalid: {
|
|
15889
|
+
color: "red"
|
|
15890
|
+
}
|
|
15891
|
+
}; // input labels/placeholders
|
|
15892
|
+
|
|
15893
|
+
let labels = {
|
|
15894
|
+
cardNumber: "Card Number",
|
|
15895
|
+
expirationDate: "MM/YY",
|
|
15896
|
+
cvv: "CVV",
|
|
15897
|
+
cardHolder: "Card Holder Name"
|
|
15898
|
+
}; //payment options
|
|
15899
|
+
|
|
15900
|
+
let paymentOptions = {
|
|
15901
|
+
labels: labels,
|
|
15902
|
+
TextDirection: "ltr"
|
|
15903
|
+
}; //create element, pass style and payment options
|
|
15904
|
+
|
|
15905
|
+
let card = elements.create("card", {
|
|
15906
|
+
style: style
|
|
15907
|
+
}, paymentOptions); //mount element
|
|
15908
|
+
|
|
15909
|
+
card.mount("#tapPaymentIframe"); //card change event listener
|
|
15910
|
+
|
|
15911
|
+
card.addEventListener("change", function (event) {// if (event.error_interactive) {
|
|
15912
|
+
// onFailure(event.error_interactive);
|
|
15913
|
+
// return dispatch({
|
|
15914
|
+
// type: SHOW_ALERT,
|
|
15915
|
+
// payload: {
|
|
15916
|
+
// type: "error",
|
|
15917
|
+
// content: getErrorMessages(event.error_interactive)
|
|
15918
|
+
// }
|
|
15919
|
+
// });
|
|
15920
|
+
// } else {
|
|
15921
|
+
// dispatch({
|
|
15922
|
+
// type: SHOW_ALERT,
|
|
15923
|
+
// payload: { type: "error", content: "" }
|
|
15924
|
+
// });
|
|
15925
|
+
// }
|
|
15926
|
+
// let displayError = document.getElementById("error-handler");
|
|
15927
|
+
// if (event.error) {
|
|
15928
|
+
// displayError.textContent = event.error.message;
|
|
15929
|
+
// } else {
|
|
15930
|
+
// displayError.textContent = "";
|
|
15931
|
+
// }
|
|
15932
|
+
});
|
|
15933
|
+
tapInstanceRef.current = tapKey;
|
|
15934
|
+
tapInstanceCard.current = card;
|
|
15937
15935
|
}
|
|
15938
|
-
}, [selectedPaymentMethodId]);
|
|
15936
|
+
}, [selectedPaymentMethodId, window.Tapjsli]);
|
|
15939
15937
|
|
|
15940
15938
|
const initPaymentRequest = (state, dispatch) => {
|
|
15941
15939
|
try {
|