@pelcro/react-pelcro-js 3.10.1-beta.19 → 3.10.1-beta.20
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 +141 -91
- package/dist/index.esm.js +141 -91
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -15417,18 +15417,148 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15417
15417
|
const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
|
|
15418
15418
|
const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
|
|
15419
15419
|
const cardProcessor = getSiteCardProcessor();
|
|
15420
|
-
|
|
15420
|
+
React.useState(Boolean(window.Tapjsli));
|
|
15421
15421
|
React.useEffect(() => {
|
|
15422
15422
|
whenUserReady(() => {
|
|
15423
15423
|
if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
15424
15424
|
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
15425
15425
|
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
15426
15426
|
document.querySelector('script[src="https://secure.gosell.io/js/sdk/tap.min.js"]').addEventListener("load", () => {
|
|
15427
|
-
|
|
15428
|
-
|
|
15427
|
+
var _window$Pelcro$site$r;
|
|
15428
|
+
|
|
15429
|
+
console.log("From event listener: Tap script is loaded");
|
|
15430
|
+
const tapKey = window.Tapjsli((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings.publishable_key);
|
|
15431
|
+
let elements = tapKey.elements({});
|
|
15432
|
+
let style = {
|
|
15433
|
+
base: {
|
|
15434
|
+
color: "#535353",
|
|
15435
|
+
lineHeight: "18px",
|
|
15436
|
+
fontFamily: "sans-serif",
|
|
15437
|
+
fontSmoothing: "antialiased",
|
|
15438
|
+
fontSize: "16px",
|
|
15439
|
+
"::placeholder": {
|
|
15440
|
+
color: "rgba(0, 0, 0, 0.26)",
|
|
15441
|
+
fontSize: "15px"
|
|
15442
|
+
}
|
|
15443
|
+
},
|
|
15444
|
+
invalid: {
|
|
15445
|
+
color: "red"
|
|
15446
|
+
}
|
|
15447
|
+
}; // input labels/placeholders
|
|
15448
|
+
|
|
15449
|
+
let labels = {
|
|
15450
|
+
cardNumber: "Card Number",
|
|
15451
|
+
expirationDate: "MM/YY",
|
|
15452
|
+
cvv: "CVV",
|
|
15453
|
+
cardHolder: "Card Holder Name"
|
|
15454
|
+
}; //payment options
|
|
15455
|
+
|
|
15456
|
+
let paymentOptions = {
|
|
15457
|
+
labels: labels,
|
|
15458
|
+
TextDirection: "ltr"
|
|
15459
|
+
}; //create element, pass style and payment options
|
|
15460
|
+
|
|
15461
|
+
let card = elements.create("card", {
|
|
15462
|
+
style: style
|
|
15463
|
+
}, paymentOptions); //mount element
|
|
15464
|
+
|
|
15465
|
+
card.mount("#tapPaymentIframe"); //card change event listener
|
|
15466
|
+
|
|
15467
|
+
card.addEventListener("change", function (event) {// if (event.error_interactive) {
|
|
15468
|
+
// onFailure(event.error_interactive);
|
|
15469
|
+
// return dispatch({
|
|
15470
|
+
// type: SHOW_ALERT,
|
|
15471
|
+
// payload: {
|
|
15472
|
+
// type: "error",
|
|
15473
|
+
// content: getErrorMessages(event.error_interactive)
|
|
15474
|
+
// }
|
|
15475
|
+
// });
|
|
15476
|
+
// } else {
|
|
15477
|
+
// dispatch({
|
|
15478
|
+
// type: SHOW_ALERT,
|
|
15479
|
+
// payload: { type: "error", content: "" }
|
|
15480
|
+
// });
|
|
15481
|
+
// }
|
|
15482
|
+
// let displayError = document.getElementById("error-handler");
|
|
15483
|
+
// if (event.error) {
|
|
15484
|
+
// displayError.textContent = event.error.message;
|
|
15485
|
+
// } else {
|
|
15486
|
+
// displayError.textContent = "";
|
|
15487
|
+
// }
|
|
15488
|
+
});
|
|
15489
|
+
tapInstanceRef.current = tapKey;
|
|
15490
|
+
tapInstanceCard.current = card;
|
|
15491
|
+
});
|
|
15492
|
+
}
|
|
15493
|
+
|
|
15494
|
+
if (cardProcessor === "tap" && !selectedPaymentMethodId && window.Tapjsli) {
|
|
15495
|
+
var _window$Pelcro$site$r2;
|
|
15496
|
+
|
|
15497
|
+
console.log("window.Tapjsli script is loaded");
|
|
15498
|
+
const tapKey = window.Tapjsli((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.tap_gateway_settings.publishable_key);
|
|
15499
|
+
let elements = tapKey.elements({});
|
|
15500
|
+
let style = {
|
|
15501
|
+
base: {
|
|
15502
|
+
color: "#535353",
|
|
15503
|
+
lineHeight: "18px",
|
|
15504
|
+
fontFamily: "sans-serif",
|
|
15505
|
+
fontSmoothing: "antialiased",
|
|
15506
|
+
fontSize: "16px",
|
|
15507
|
+
"::placeholder": {
|
|
15508
|
+
color: "rgba(0, 0, 0, 0.26)",
|
|
15509
|
+
fontSize: "15px"
|
|
15510
|
+
}
|
|
15511
|
+
},
|
|
15512
|
+
invalid: {
|
|
15513
|
+
color: "red"
|
|
15514
|
+
}
|
|
15515
|
+
}; // input labels/placeholders
|
|
15516
|
+
|
|
15517
|
+
let labels = {
|
|
15518
|
+
cardNumber: "Card Number",
|
|
15519
|
+
expirationDate: "MM/YY",
|
|
15520
|
+
cvv: "CVV",
|
|
15521
|
+
cardHolder: "Card Holder Name"
|
|
15522
|
+
}; //payment options
|
|
15523
|
+
|
|
15524
|
+
let paymentOptions = {
|
|
15525
|
+
labels: labels,
|
|
15526
|
+
TextDirection: "ltr"
|
|
15527
|
+
}; //create element, pass style and payment options
|
|
15528
|
+
|
|
15529
|
+
let card = elements.create("card", {
|
|
15530
|
+
style: style
|
|
15531
|
+
}, paymentOptions); //mount element
|
|
15532
|
+
|
|
15533
|
+
card.mount("#tapPaymentIframe"); //card change event listener
|
|
15534
|
+
|
|
15535
|
+
card.addEventListener("change", function (event) {// if (event.error_interactive) {
|
|
15536
|
+
// onFailure(event.error_interactive);
|
|
15537
|
+
// return dispatch({
|
|
15538
|
+
// type: SHOW_ALERT,
|
|
15539
|
+
// payload: {
|
|
15540
|
+
// type: "error",
|
|
15541
|
+
// content: getErrorMessages(event.error_interactive)
|
|
15542
|
+
// }
|
|
15543
|
+
// });
|
|
15544
|
+
// } else {
|
|
15545
|
+
// dispatch({
|
|
15546
|
+
// type: SHOW_ALERT,
|
|
15547
|
+
// payload: { type: "error", content: "" }
|
|
15548
|
+
// });
|
|
15549
|
+
// }
|
|
15550
|
+
// let displayError = document.getElementById("error-handler");
|
|
15551
|
+
// if (event.error) {
|
|
15552
|
+
// displayError.textContent = event.error.message;
|
|
15553
|
+
// } else {
|
|
15554
|
+
// displayError.textContent = "";
|
|
15555
|
+
// }
|
|
15556
|
+
});
|
|
15557
|
+
tapInstanceRef.current = tapKey;
|
|
15558
|
+
tapInstanceCard.current = card;
|
|
15429
15559
|
}
|
|
15430
15560
|
});
|
|
15431
|
-
}, [
|
|
15561
|
+
}, [selectedPaymentMethodId]);
|
|
15432
15562
|
React.useEffect(() => {
|
|
15433
15563
|
if (window.Pelcro.coupon.getFromUrl()) {
|
|
15434
15564
|
dispatch({
|
|
@@ -15885,10 +16015,10 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15885
16015
|
const tapInstanceCard = React__default['default'].useRef(null);
|
|
15886
16016
|
React.useEffect(() => {
|
|
15887
16017
|
if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
|
|
15888
|
-
var _window$Pelcro$site$
|
|
16018
|
+
var _window$Pelcro$site$r3, _window$Pelcro$site$r4;
|
|
15889
16019
|
|
|
15890
|
-
const payPageId = (_window$Pelcro$site$
|
|
15891
|
-
const reportGroup = (_window$Pelcro$site$
|
|
16020
|
+
const payPageId = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.vantiv_gateway_settings.pay_page_id;
|
|
16021
|
+
const reportGroup = (_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.vantiv_gateway_settings.report_group;
|
|
15892
16022
|
vantivInstanceRef.current = new window.EprotectIframeClient({
|
|
15893
16023
|
paypageId: payPageId,
|
|
15894
16024
|
reportGroup: reportGroup,
|
|
@@ -15911,85 +16041,6 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15911
16041
|
});
|
|
15912
16042
|
}
|
|
15913
16043
|
}, [selectedPaymentMethodId]);
|
|
15914
|
-
React.useEffect(() => {
|
|
15915
|
-
if (cardProcessor === "tap" && !selectedPaymentMethodId && window.Tapjsli) {
|
|
15916
|
-
var _window$Pelcro$site$r3;
|
|
15917
|
-
|
|
15918
|
-
console.log("window.Tapjsli script is loaded");
|
|
15919
|
-
const tapKey = window.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);
|
|
15920
|
-
let elements = tapKey.elements({});
|
|
15921
|
-
let style = {
|
|
15922
|
-
base: {
|
|
15923
|
-
color: "#535353",
|
|
15924
|
-
lineHeight: "18px",
|
|
15925
|
-
fontFamily: "sans-serif",
|
|
15926
|
-
fontSmoothing: "antialiased",
|
|
15927
|
-
fontSize: "16px",
|
|
15928
|
-
"::placeholder": {
|
|
15929
|
-
color: "rgba(0, 0, 0, 0.26)",
|
|
15930
|
-
fontSize: "15px"
|
|
15931
|
-
}
|
|
15932
|
-
},
|
|
15933
|
-
invalid: {
|
|
15934
|
-
color: "red"
|
|
15935
|
-
}
|
|
15936
|
-
}; // input labels/placeholders
|
|
15937
|
-
|
|
15938
|
-
let labels = {
|
|
15939
|
-
cardNumber: "Card Number",
|
|
15940
|
-
expirationDate: "MM/YY",
|
|
15941
|
-
cvv: "CVV",
|
|
15942
|
-
cardHolder: "Card Holder Name"
|
|
15943
|
-
}; //payment options
|
|
15944
|
-
|
|
15945
|
-
let paymentOptions = {
|
|
15946
|
-
labels: labels,
|
|
15947
|
-
TextDirection: "ltr"
|
|
15948
|
-
}; //create element, pass style and payment options
|
|
15949
|
-
|
|
15950
|
-
let card = elements.create("card", {
|
|
15951
|
-
style: style
|
|
15952
|
-
}, paymentOptions); //mount element
|
|
15953
|
-
|
|
15954
|
-
card.mount("#tapPaymentIframe"); //card change event listener
|
|
15955
|
-
|
|
15956
|
-
card.addEventListener("change", function (event) {// if (event.error_interactive) {
|
|
15957
|
-
// onFailure(event.error_interactive);
|
|
15958
|
-
// return dispatch({
|
|
15959
|
-
// type: SHOW_ALERT,
|
|
15960
|
-
// payload: {
|
|
15961
|
-
// type: "error",
|
|
15962
|
-
// content: getErrorMessages(event.error_interactive)
|
|
15963
|
-
// }
|
|
15964
|
-
// });
|
|
15965
|
-
// } else {
|
|
15966
|
-
// dispatch({
|
|
15967
|
-
// type: SHOW_ALERT,
|
|
15968
|
-
// payload: { type: "error", content: "" }
|
|
15969
|
-
// });
|
|
15970
|
-
// }
|
|
15971
|
-
// let displayError = document.getElementById("error-handler");
|
|
15972
|
-
// if (event.error) {
|
|
15973
|
-
// displayError.textContent = event.error.message;
|
|
15974
|
-
// } else {
|
|
15975
|
-
// displayError.textContent = "";
|
|
15976
|
-
// }
|
|
15977
|
-
});
|
|
15978
|
-
tapInstanceRef.current = tapKey;
|
|
15979
|
-
tapInstanceCard.current = card;
|
|
15980
|
-
} else if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
15981
|
-
console.log("window.Tapjsli script is NOT loaded");
|
|
15982
|
-
whenUserReady(() => {
|
|
15983
|
-
console.log("Site is ready and trying to load window.Tapjsli script");
|
|
15984
|
-
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
15985
|
-
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
15986
|
-
setIsTapLoaded(true);
|
|
15987
|
-
});
|
|
15988
|
-
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
15989
|
-
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
15990
|
-
setIsTapLoaded(true);
|
|
15991
|
-
}
|
|
15992
|
-
}, [selectedPaymentMethodId, isTapLoaded]);
|
|
15993
16044
|
|
|
15994
16045
|
const initPaymentRequest = (state, dispatch) => {
|
|
15995
16046
|
try {
|
|
@@ -16061,9 +16112,9 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16061
16112
|
|
|
16062
16113
|
|
|
16063
16114
|
const updateTotalAmountWithTax = () => {
|
|
16064
|
-
var _window$Pelcro$site$
|
|
16115
|
+
var _window$Pelcro$site$r5;
|
|
16065
16116
|
|
|
16066
|
-
const taxesEnabled = (_window$Pelcro$site$
|
|
16117
|
+
const taxesEnabled = (_window$Pelcro$site$r5 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r5 === void 0 ? void 0 : _window$Pelcro$site$r5.taxes_enabled;
|
|
16067
16118
|
|
|
16068
16119
|
if (taxesEnabled && type === "createPayment") {
|
|
16069
16120
|
dispatch({
|
|
@@ -16746,13 +16797,13 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16746
16797
|
|
|
16747
16798
|
|
|
16748
16799
|
const resolveTaxCalculation = () => {
|
|
16749
|
-
var _window$Pelcro$site$
|
|
16800
|
+
var _window$Pelcro$site$r6;
|
|
16750
16801
|
|
|
16751
16802
|
if (type === "invoicePayment") {
|
|
16752
16803
|
return new Promise(resolve => resolve());
|
|
16753
16804
|
}
|
|
16754
16805
|
|
|
16755
|
-
const taxesEnabled = (_window$Pelcro$site$
|
|
16806
|
+
const taxesEnabled = (_window$Pelcro$site$r6 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r6 === void 0 ? void 0 : _window$Pelcro$site$r6.taxes_enabled;
|
|
16756
16807
|
return new Promise((resolve, reject) => {
|
|
16757
16808
|
// resolve early if taxes isn't enabled
|
|
16758
16809
|
if (!taxesEnabled) {
|
|
@@ -17114,7 +17165,6 @@ const PaymentMethodContainer = props => {
|
|
|
17114
17165
|
const {
|
|
17115
17166
|
whenUserReady
|
|
17116
17167
|
} = usePelcro.getStore();
|
|
17117
|
-
getSiteCardProcessor();
|
|
17118
17168
|
React.useEffect(() => {
|
|
17119
17169
|
whenUserReady(() => {
|
|
17120
17170
|
if (!window.Stripe) {
|
package/dist/index.esm.js
CHANGED
|
@@ -15387,18 +15387,148 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15387
15387
|
const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
|
|
15388
15388
|
const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
|
|
15389
15389
|
const cardProcessor = getSiteCardProcessor();
|
|
15390
|
-
|
|
15390
|
+
useState(Boolean(window.Tapjsli));
|
|
15391
15391
|
useEffect(() => {
|
|
15392
15392
|
whenUserReady(() => {
|
|
15393
15393
|
if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
15394
15394
|
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
15395
15395
|
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
15396
15396
|
document.querySelector('script[src="https://secure.gosell.io/js/sdk/tap.min.js"]').addEventListener("load", () => {
|
|
15397
|
-
|
|
15398
|
-
|
|
15397
|
+
var _window$Pelcro$site$r;
|
|
15398
|
+
|
|
15399
|
+
console.log("From event listener: Tap script is loaded");
|
|
15400
|
+
const tapKey = window.Tapjsli((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings.publishable_key);
|
|
15401
|
+
let elements = tapKey.elements({});
|
|
15402
|
+
let style = {
|
|
15403
|
+
base: {
|
|
15404
|
+
color: "#535353",
|
|
15405
|
+
lineHeight: "18px",
|
|
15406
|
+
fontFamily: "sans-serif",
|
|
15407
|
+
fontSmoothing: "antialiased",
|
|
15408
|
+
fontSize: "16px",
|
|
15409
|
+
"::placeholder": {
|
|
15410
|
+
color: "rgba(0, 0, 0, 0.26)",
|
|
15411
|
+
fontSize: "15px"
|
|
15412
|
+
}
|
|
15413
|
+
},
|
|
15414
|
+
invalid: {
|
|
15415
|
+
color: "red"
|
|
15416
|
+
}
|
|
15417
|
+
}; // input labels/placeholders
|
|
15418
|
+
|
|
15419
|
+
let labels = {
|
|
15420
|
+
cardNumber: "Card Number",
|
|
15421
|
+
expirationDate: "MM/YY",
|
|
15422
|
+
cvv: "CVV",
|
|
15423
|
+
cardHolder: "Card Holder Name"
|
|
15424
|
+
}; //payment options
|
|
15425
|
+
|
|
15426
|
+
let paymentOptions = {
|
|
15427
|
+
labels: labels,
|
|
15428
|
+
TextDirection: "ltr"
|
|
15429
|
+
}; //create element, pass style and payment options
|
|
15430
|
+
|
|
15431
|
+
let card = elements.create("card", {
|
|
15432
|
+
style: style
|
|
15433
|
+
}, paymentOptions); //mount element
|
|
15434
|
+
|
|
15435
|
+
card.mount("#tapPaymentIframe"); //card change event listener
|
|
15436
|
+
|
|
15437
|
+
card.addEventListener("change", function (event) {// if (event.error_interactive) {
|
|
15438
|
+
// onFailure(event.error_interactive);
|
|
15439
|
+
// return dispatch({
|
|
15440
|
+
// type: SHOW_ALERT,
|
|
15441
|
+
// payload: {
|
|
15442
|
+
// type: "error",
|
|
15443
|
+
// content: getErrorMessages(event.error_interactive)
|
|
15444
|
+
// }
|
|
15445
|
+
// });
|
|
15446
|
+
// } else {
|
|
15447
|
+
// dispatch({
|
|
15448
|
+
// type: SHOW_ALERT,
|
|
15449
|
+
// payload: { type: "error", content: "" }
|
|
15450
|
+
// });
|
|
15451
|
+
// }
|
|
15452
|
+
// let displayError = document.getElementById("error-handler");
|
|
15453
|
+
// if (event.error) {
|
|
15454
|
+
// displayError.textContent = event.error.message;
|
|
15455
|
+
// } else {
|
|
15456
|
+
// displayError.textContent = "";
|
|
15457
|
+
// }
|
|
15458
|
+
});
|
|
15459
|
+
tapInstanceRef.current = tapKey;
|
|
15460
|
+
tapInstanceCard.current = card;
|
|
15461
|
+
});
|
|
15462
|
+
}
|
|
15463
|
+
|
|
15464
|
+
if (cardProcessor === "tap" && !selectedPaymentMethodId && window.Tapjsli) {
|
|
15465
|
+
var _window$Pelcro$site$r2;
|
|
15466
|
+
|
|
15467
|
+
console.log("window.Tapjsli script is loaded");
|
|
15468
|
+
const tapKey = window.Tapjsli((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.tap_gateway_settings.publishable_key);
|
|
15469
|
+
let elements = tapKey.elements({});
|
|
15470
|
+
let style = {
|
|
15471
|
+
base: {
|
|
15472
|
+
color: "#535353",
|
|
15473
|
+
lineHeight: "18px",
|
|
15474
|
+
fontFamily: "sans-serif",
|
|
15475
|
+
fontSmoothing: "antialiased",
|
|
15476
|
+
fontSize: "16px",
|
|
15477
|
+
"::placeholder": {
|
|
15478
|
+
color: "rgba(0, 0, 0, 0.26)",
|
|
15479
|
+
fontSize: "15px"
|
|
15480
|
+
}
|
|
15481
|
+
},
|
|
15482
|
+
invalid: {
|
|
15483
|
+
color: "red"
|
|
15484
|
+
}
|
|
15485
|
+
}; // input labels/placeholders
|
|
15486
|
+
|
|
15487
|
+
let labels = {
|
|
15488
|
+
cardNumber: "Card Number",
|
|
15489
|
+
expirationDate: "MM/YY",
|
|
15490
|
+
cvv: "CVV",
|
|
15491
|
+
cardHolder: "Card Holder Name"
|
|
15492
|
+
}; //payment options
|
|
15493
|
+
|
|
15494
|
+
let paymentOptions = {
|
|
15495
|
+
labels: labels,
|
|
15496
|
+
TextDirection: "ltr"
|
|
15497
|
+
}; //create element, pass style and payment options
|
|
15498
|
+
|
|
15499
|
+
let card = elements.create("card", {
|
|
15500
|
+
style: style
|
|
15501
|
+
}, paymentOptions); //mount element
|
|
15502
|
+
|
|
15503
|
+
card.mount("#tapPaymentIframe"); //card change event listener
|
|
15504
|
+
|
|
15505
|
+
card.addEventListener("change", function (event) {// if (event.error_interactive) {
|
|
15506
|
+
// onFailure(event.error_interactive);
|
|
15507
|
+
// return dispatch({
|
|
15508
|
+
// type: SHOW_ALERT,
|
|
15509
|
+
// payload: {
|
|
15510
|
+
// type: "error",
|
|
15511
|
+
// content: getErrorMessages(event.error_interactive)
|
|
15512
|
+
// }
|
|
15513
|
+
// });
|
|
15514
|
+
// } else {
|
|
15515
|
+
// dispatch({
|
|
15516
|
+
// type: SHOW_ALERT,
|
|
15517
|
+
// payload: { type: "error", content: "" }
|
|
15518
|
+
// });
|
|
15519
|
+
// }
|
|
15520
|
+
// let displayError = document.getElementById("error-handler");
|
|
15521
|
+
// if (event.error) {
|
|
15522
|
+
// displayError.textContent = event.error.message;
|
|
15523
|
+
// } else {
|
|
15524
|
+
// displayError.textContent = "";
|
|
15525
|
+
// }
|
|
15526
|
+
});
|
|
15527
|
+
tapInstanceRef.current = tapKey;
|
|
15528
|
+
tapInstanceCard.current = card;
|
|
15399
15529
|
}
|
|
15400
15530
|
});
|
|
15401
|
-
}, [
|
|
15531
|
+
}, [selectedPaymentMethodId]);
|
|
15402
15532
|
useEffect(() => {
|
|
15403
15533
|
if (window.Pelcro.coupon.getFromUrl()) {
|
|
15404
15534
|
dispatch({
|
|
@@ -15855,10 +15985,10 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15855
15985
|
const tapInstanceCard = React__default.useRef(null);
|
|
15856
15986
|
useEffect(() => {
|
|
15857
15987
|
if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
|
|
15858
|
-
var _window$Pelcro$site$
|
|
15988
|
+
var _window$Pelcro$site$r3, _window$Pelcro$site$r4;
|
|
15859
15989
|
|
|
15860
|
-
const payPageId = (_window$Pelcro$site$
|
|
15861
|
-
const reportGroup = (_window$Pelcro$site$
|
|
15990
|
+
const payPageId = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.vantiv_gateway_settings.pay_page_id;
|
|
15991
|
+
const reportGroup = (_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.vantiv_gateway_settings.report_group;
|
|
15862
15992
|
vantivInstanceRef.current = new window.EprotectIframeClient({
|
|
15863
15993
|
paypageId: payPageId,
|
|
15864
15994
|
reportGroup: reportGroup,
|
|
@@ -15881,85 +16011,6 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15881
16011
|
});
|
|
15882
16012
|
}
|
|
15883
16013
|
}, [selectedPaymentMethodId]);
|
|
15884
|
-
useEffect(() => {
|
|
15885
|
-
if (cardProcessor === "tap" && !selectedPaymentMethodId && window.Tapjsli) {
|
|
15886
|
-
var _window$Pelcro$site$r3;
|
|
15887
|
-
|
|
15888
|
-
console.log("window.Tapjsli script is loaded");
|
|
15889
|
-
const tapKey = window.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);
|
|
15890
|
-
let elements = tapKey.elements({});
|
|
15891
|
-
let style = {
|
|
15892
|
-
base: {
|
|
15893
|
-
color: "#535353",
|
|
15894
|
-
lineHeight: "18px",
|
|
15895
|
-
fontFamily: "sans-serif",
|
|
15896
|
-
fontSmoothing: "antialiased",
|
|
15897
|
-
fontSize: "16px",
|
|
15898
|
-
"::placeholder": {
|
|
15899
|
-
color: "rgba(0, 0, 0, 0.26)",
|
|
15900
|
-
fontSize: "15px"
|
|
15901
|
-
}
|
|
15902
|
-
},
|
|
15903
|
-
invalid: {
|
|
15904
|
-
color: "red"
|
|
15905
|
-
}
|
|
15906
|
-
}; // input labels/placeholders
|
|
15907
|
-
|
|
15908
|
-
let labels = {
|
|
15909
|
-
cardNumber: "Card Number",
|
|
15910
|
-
expirationDate: "MM/YY",
|
|
15911
|
-
cvv: "CVV",
|
|
15912
|
-
cardHolder: "Card Holder Name"
|
|
15913
|
-
}; //payment options
|
|
15914
|
-
|
|
15915
|
-
let paymentOptions = {
|
|
15916
|
-
labels: labels,
|
|
15917
|
-
TextDirection: "ltr"
|
|
15918
|
-
}; //create element, pass style and payment options
|
|
15919
|
-
|
|
15920
|
-
let card = elements.create("card", {
|
|
15921
|
-
style: style
|
|
15922
|
-
}, paymentOptions); //mount element
|
|
15923
|
-
|
|
15924
|
-
card.mount("#tapPaymentIframe"); //card change event listener
|
|
15925
|
-
|
|
15926
|
-
card.addEventListener("change", function (event) {// if (event.error_interactive) {
|
|
15927
|
-
// onFailure(event.error_interactive);
|
|
15928
|
-
// return dispatch({
|
|
15929
|
-
// type: SHOW_ALERT,
|
|
15930
|
-
// payload: {
|
|
15931
|
-
// type: "error",
|
|
15932
|
-
// content: getErrorMessages(event.error_interactive)
|
|
15933
|
-
// }
|
|
15934
|
-
// });
|
|
15935
|
-
// } else {
|
|
15936
|
-
// dispatch({
|
|
15937
|
-
// type: SHOW_ALERT,
|
|
15938
|
-
// payload: { type: "error", content: "" }
|
|
15939
|
-
// });
|
|
15940
|
-
// }
|
|
15941
|
-
// let displayError = document.getElementById("error-handler");
|
|
15942
|
-
// if (event.error) {
|
|
15943
|
-
// displayError.textContent = event.error.message;
|
|
15944
|
-
// } else {
|
|
15945
|
-
// displayError.textContent = "";
|
|
15946
|
-
// }
|
|
15947
|
-
});
|
|
15948
|
-
tapInstanceRef.current = tapKey;
|
|
15949
|
-
tapInstanceCard.current = card;
|
|
15950
|
-
} else if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
15951
|
-
console.log("window.Tapjsli script is NOT loaded");
|
|
15952
|
-
whenUserReady(() => {
|
|
15953
|
-
console.log("Site is ready and trying to load window.Tapjsli script");
|
|
15954
|
-
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
15955
|
-
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
15956
|
-
setIsTapLoaded(true);
|
|
15957
|
-
});
|
|
15958
|
-
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
15959
|
-
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
15960
|
-
setIsTapLoaded(true);
|
|
15961
|
-
}
|
|
15962
|
-
}, [selectedPaymentMethodId, isTapLoaded]);
|
|
15963
16014
|
|
|
15964
16015
|
const initPaymentRequest = (state, dispatch) => {
|
|
15965
16016
|
try {
|
|
@@ -16031,9 +16082,9 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16031
16082
|
|
|
16032
16083
|
|
|
16033
16084
|
const updateTotalAmountWithTax = () => {
|
|
16034
|
-
var _window$Pelcro$site$
|
|
16085
|
+
var _window$Pelcro$site$r5;
|
|
16035
16086
|
|
|
16036
|
-
const taxesEnabled = (_window$Pelcro$site$
|
|
16087
|
+
const taxesEnabled = (_window$Pelcro$site$r5 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r5 === void 0 ? void 0 : _window$Pelcro$site$r5.taxes_enabled;
|
|
16037
16088
|
|
|
16038
16089
|
if (taxesEnabled && type === "createPayment") {
|
|
16039
16090
|
dispatch({
|
|
@@ -16716,13 +16767,13 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16716
16767
|
|
|
16717
16768
|
|
|
16718
16769
|
const resolveTaxCalculation = () => {
|
|
16719
|
-
var _window$Pelcro$site$
|
|
16770
|
+
var _window$Pelcro$site$r6;
|
|
16720
16771
|
|
|
16721
16772
|
if (type === "invoicePayment") {
|
|
16722
16773
|
return new Promise(resolve => resolve());
|
|
16723
16774
|
}
|
|
16724
16775
|
|
|
16725
|
-
const taxesEnabled = (_window$Pelcro$site$
|
|
16776
|
+
const taxesEnabled = (_window$Pelcro$site$r6 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r6 === void 0 ? void 0 : _window$Pelcro$site$r6.taxes_enabled;
|
|
16726
16777
|
return new Promise((resolve, reject) => {
|
|
16727
16778
|
// resolve early if taxes isn't enabled
|
|
16728
16779
|
if (!taxesEnabled) {
|
|
@@ -17084,7 +17135,6 @@ const PaymentMethodContainer = props => {
|
|
|
17084
17135
|
const {
|
|
17085
17136
|
whenUserReady
|
|
17086
17137
|
} = usePelcro.getStore();
|
|
17087
|
-
getSiteCardProcessor();
|
|
17088
17138
|
useEffect(() => {
|
|
17089
17139
|
whenUserReady(() => {
|
|
17090
17140
|
if (!window.Stripe) {
|