@pelcro/react-pelcro-js 3.10.1-beta.14 → 3.10.1-beta.16
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 +47 -21
- package/dist/index.esm.js +47 -21
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -15405,7 +15405,9 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15405
15405
|
selectedPaymentMethodId,
|
|
15406
15406
|
couponCode
|
|
15407
15407
|
} = usePelcro();
|
|
15408
|
-
|
|
15408
|
+
const {
|
|
15409
|
+
whenUserReady
|
|
15410
|
+
} = usePelcro.getStore();
|
|
15409
15411
|
const product = (_props$product = props.product) !== null && _props$product !== void 0 ? _props$product : pelcroStore.product;
|
|
15410
15412
|
const plan = (_props$plan = props.plan) !== null && _props$plan !== void 0 ? _props$plan : pelcroStore.plan;
|
|
15411
15413
|
const subscriptionIdToRenew = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : pelcroStore.subscriptionIdToRenew;
|
|
@@ -15415,22 +15417,16 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15415
15417
|
const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
|
|
15416
15418
|
const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
|
|
15417
15419
|
const cardProcessor = getSiteCardProcessor();
|
|
15418
|
-
const [isTapLoaded, setIsTapLoaded] = React.useState(Boolean(window.Tapjsli));
|
|
15419
|
-
|
|
15420
|
-
|
|
15421
|
-
|
|
15422
|
-
|
|
15423
|
-
|
|
15424
|
-
|
|
15425
|
-
|
|
15426
|
-
|
|
15427
|
-
|
|
15428
|
-
// );
|
|
15429
|
-
// setIsTapLoaded(true);
|
|
15430
|
-
// }
|
|
15431
|
-
// });
|
|
15432
|
-
// }, []);
|
|
15433
|
-
|
|
15420
|
+
const [isTapLoaded, setIsTapLoaded] = React.useState(Boolean(window.Tapjsli));
|
|
15421
|
+
React.useEffect(() => {
|
|
15422
|
+
whenUserReady(() => {
|
|
15423
|
+
if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
15424
|
+
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
15425
|
+
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
15426
|
+
setIsTapLoaded(true);
|
|
15427
|
+
}
|
|
15428
|
+
});
|
|
15429
|
+
}, [isTapLoaded]);
|
|
15434
15430
|
React.useEffect(() => {
|
|
15435
15431
|
if (window.Pelcro.coupon.getFromUrl()) {
|
|
15436
15432
|
dispatch({
|
|
@@ -15917,7 +15913,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15917
15913
|
if (cardProcessor === "tap" && !selectedPaymentMethodId && window.Tapjsli) {
|
|
15918
15914
|
var _window$Pelcro$site$r3;
|
|
15919
15915
|
|
|
15920
|
-
console.log("
|
|
15916
|
+
console.log("window.Tapjsli script is loaded");
|
|
15921
15917
|
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);
|
|
15922
15918
|
let elements = tapKey.elements({});
|
|
15923
15919
|
let style = {
|
|
@@ -15980,9 +15976,30 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15980
15976
|
tapInstanceRef.current = tapKey;
|
|
15981
15977
|
tapInstanceCard.current = card;
|
|
15982
15978
|
} else if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
15983
|
-
|
|
15984
|
-
|
|
15985
|
-
|
|
15979
|
+
console.log("window.Tapjsli script is NOT loaded");
|
|
15980
|
+
setIsTapLoaded(false); // whenUserReady(() => {
|
|
15981
|
+
// console.log(
|
|
15982
|
+
// "Site is ready and trying to load window.Tapjsli script"
|
|
15983
|
+
// );
|
|
15984
|
+
// window.Pelcro.helpers.loadSDK(
|
|
15985
|
+
// "https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js",
|
|
15986
|
+
// "tap-bluebird"
|
|
15987
|
+
// );
|
|
15988
|
+
// window.Pelcro.helpers.loadSDK(
|
|
15989
|
+
// "https://secure.gosell.io/js/sdk/tap.min.js",
|
|
15990
|
+
// "tap-sdk"
|
|
15991
|
+
// );
|
|
15992
|
+
// setIsTapLoaded(true);
|
|
15993
|
+
// });
|
|
15994
|
+
// window.Pelcro.helpers.loadSDK(
|
|
15995
|
+
// "https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js",
|
|
15996
|
+
// "tap-bluebird"
|
|
15997
|
+
// );
|
|
15998
|
+
// window.Pelcro.helpers.loadSDK(
|
|
15999
|
+
// "https://secure.gosell.io/js/sdk/tap.min.js",
|
|
16000
|
+
// "tap-sdk"
|
|
16001
|
+
// );
|
|
16002
|
+
// setIsTapLoaded(true);
|
|
15986
16003
|
}
|
|
15987
16004
|
}, [selectedPaymentMethodId, isTapLoaded]);
|
|
15988
16005
|
|
|
@@ -17105,17 +17122,26 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
17105
17122
|
const UnwrappedForm = es_12(PaymentMethodContainerWithoutStripe);
|
|
17106
17123
|
|
|
17107
17124
|
const PaymentMethodContainer = props => {
|
|
17125
|
+
console.log("Inside Payment Method Container");
|
|
17108
17126
|
const [isStripeLoaded, setIsStripeLoaded] = React.useState(Boolean(window.Stripe));
|
|
17109
17127
|
const {
|
|
17110
17128
|
whenUserReady
|
|
17111
17129
|
} = usePelcro.getStore();
|
|
17130
|
+
const cardProcessor = getSiteCardProcessor();
|
|
17112
17131
|
React.useEffect(() => {
|
|
17113
17132
|
whenUserReady(() => {
|
|
17114
17133
|
if (!window.Stripe) {
|
|
17134
|
+
console.log("Inside Payment Method Container and window.Stripe is not loaded");
|
|
17115
17135
|
document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
|
|
17116
17136
|
setIsStripeLoaded(true);
|
|
17117
17137
|
});
|
|
17118
17138
|
}
|
|
17139
|
+
|
|
17140
|
+
if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
17141
|
+
console.log("Inside Payment Method Container and window.Tapjsli is not loaded");
|
|
17142
|
+
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
17143
|
+
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
17144
|
+
}
|
|
17119
17145
|
});
|
|
17120
17146
|
}, []);
|
|
17121
17147
|
|
package/dist/index.esm.js
CHANGED
|
@@ -15375,7 +15375,9 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15375
15375
|
selectedPaymentMethodId,
|
|
15376
15376
|
couponCode
|
|
15377
15377
|
} = usePelcro();
|
|
15378
|
-
|
|
15378
|
+
const {
|
|
15379
|
+
whenUserReady
|
|
15380
|
+
} = usePelcro.getStore();
|
|
15379
15381
|
const product = (_props$product = props.product) !== null && _props$product !== void 0 ? _props$product : pelcroStore.product;
|
|
15380
15382
|
const plan = (_props$plan = props.plan) !== null && _props$plan !== void 0 ? _props$plan : pelcroStore.plan;
|
|
15381
15383
|
const subscriptionIdToRenew = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : pelcroStore.subscriptionIdToRenew;
|
|
@@ -15385,22 +15387,16 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15385
15387
|
const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
|
|
15386
15388
|
const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
|
|
15387
15389
|
const cardProcessor = getSiteCardProcessor();
|
|
15388
|
-
const [isTapLoaded, setIsTapLoaded] = useState(Boolean(window.Tapjsli));
|
|
15389
|
-
|
|
15390
|
-
|
|
15391
|
-
|
|
15392
|
-
|
|
15393
|
-
|
|
15394
|
-
|
|
15395
|
-
|
|
15396
|
-
|
|
15397
|
-
|
|
15398
|
-
// );
|
|
15399
|
-
// setIsTapLoaded(true);
|
|
15400
|
-
// }
|
|
15401
|
-
// });
|
|
15402
|
-
// }, []);
|
|
15403
|
-
|
|
15390
|
+
const [isTapLoaded, setIsTapLoaded] = useState(Boolean(window.Tapjsli));
|
|
15391
|
+
useEffect(() => {
|
|
15392
|
+
whenUserReady(() => {
|
|
15393
|
+
if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
15394
|
+
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
15395
|
+
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
15396
|
+
setIsTapLoaded(true);
|
|
15397
|
+
}
|
|
15398
|
+
});
|
|
15399
|
+
}, [isTapLoaded]);
|
|
15404
15400
|
useEffect(() => {
|
|
15405
15401
|
if (window.Pelcro.coupon.getFromUrl()) {
|
|
15406
15402
|
dispatch({
|
|
@@ -15887,7 +15883,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15887
15883
|
if (cardProcessor === "tap" && !selectedPaymentMethodId && window.Tapjsli) {
|
|
15888
15884
|
var _window$Pelcro$site$r3;
|
|
15889
15885
|
|
|
15890
|
-
console.log("
|
|
15886
|
+
console.log("window.Tapjsli script is loaded");
|
|
15891
15887
|
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);
|
|
15892
15888
|
let elements = tapKey.elements({});
|
|
15893
15889
|
let style = {
|
|
@@ -15950,9 +15946,30 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15950
15946
|
tapInstanceRef.current = tapKey;
|
|
15951
15947
|
tapInstanceCard.current = card;
|
|
15952
15948
|
} else if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
15953
|
-
|
|
15954
|
-
|
|
15955
|
-
|
|
15949
|
+
console.log("window.Tapjsli script is NOT loaded");
|
|
15950
|
+
setIsTapLoaded(false); // whenUserReady(() => {
|
|
15951
|
+
// console.log(
|
|
15952
|
+
// "Site is ready and trying to load window.Tapjsli script"
|
|
15953
|
+
// );
|
|
15954
|
+
// window.Pelcro.helpers.loadSDK(
|
|
15955
|
+
// "https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js",
|
|
15956
|
+
// "tap-bluebird"
|
|
15957
|
+
// );
|
|
15958
|
+
// window.Pelcro.helpers.loadSDK(
|
|
15959
|
+
// "https://secure.gosell.io/js/sdk/tap.min.js",
|
|
15960
|
+
// "tap-sdk"
|
|
15961
|
+
// );
|
|
15962
|
+
// setIsTapLoaded(true);
|
|
15963
|
+
// });
|
|
15964
|
+
// window.Pelcro.helpers.loadSDK(
|
|
15965
|
+
// "https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js",
|
|
15966
|
+
// "tap-bluebird"
|
|
15967
|
+
// );
|
|
15968
|
+
// window.Pelcro.helpers.loadSDK(
|
|
15969
|
+
// "https://secure.gosell.io/js/sdk/tap.min.js",
|
|
15970
|
+
// "tap-sdk"
|
|
15971
|
+
// );
|
|
15972
|
+
// setIsTapLoaded(true);
|
|
15956
15973
|
}
|
|
15957
15974
|
}, [selectedPaymentMethodId, isTapLoaded]);
|
|
15958
15975
|
|
|
@@ -17075,17 +17092,26 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
17075
17092
|
const UnwrappedForm = es_12(PaymentMethodContainerWithoutStripe);
|
|
17076
17093
|
|
|
17077
17094
|
const PaymentMethodContainer = props => {
|
|
17095
|
+
console.log("Inside Payment Method Container");
|
|
17078
17096
|
const [isStripeLoaded, setIsStripeLoaded] = useState(Boolean(window.Stripe));
|
|
17079
17097
|
const {
|
|
17080
17098
|
whenUserReady
|
|
17081
17099
|
} = usePelcro.getStore();
|
|
17100
|
+
const cardProcessor = getSiteCardProcessor();
|
|
17082
17101
|
useEffect(() => {
|
|
17083
17102
|
whenUserReady(() => {
|
|
17084
17103
|
if (!window.Stripe) {
|
|
17104
|
+
console.log("Inside Payment Method Container and window.Stripe is not loaded");
|
|
17085
17105
|
document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
|
|
17086
17106
|
setIsStripeLoaded(true);
|
|
17087
17107
|
});
|
|
17088
17108
|
}
|
|
17109
|
+
|
|
17110
|
+
if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
17111
|
+
console.log("Inside Payment Method Container and window.Tapjsli is not loaded");
|
|
17112
|
+
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
17113
|
+
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
17114
|
+
}
|
|
17089
17115
|
});
|
|
17090
17116
|
}, []);
|
|
17091
17117
|
|