@pelcro/react-pelcro-js 3.10.1-beta.15 → 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 CHANGED
@@ -15417,22 +15417,16 @@ 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
- const [isTapLoaded, setIsTapLoaded] = React.useState(Boolean(window.Tapjsli)); // useEffect(() => {
15421
- // whenUserReady(() => {
15422
- // if (cardProcessor === "tap" && !window.Tapjsli) {
15423
- // window.Pelcro.helpers.loadSDK(
15424
- // "https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js",
15425
- // "tap-bluebird"
15426
- // );
15427
- // window.Pelcro.helpers.loadSDK(
15428
- // "https://secure.gosell.io/js/sdk/tap.min.js",
15429
- // "tap-sdk"
15430
- // );
15431
- // setIsTapLoaded(true);
15432
- // }
15433
- // });
15434
- // }, []);
15435
-
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]);
15436
15430
  React.useEffect(() => {
15437
15431
  if (window.Pelcro.coupon.getFromUrl()) {
15438
15432
  dispatch({
@@ -15983,12 +15977,21 @@ const PaymentMethodContainerWithoutStripe = ({
15983
15977
  tapInstanceCard.current = card;
15984
15978
  } else if (cardProcessor === "tap" && !window.Tapjsli) {
15985
15979
  console.log("window.Tapjsli script is NOT loaded");
15986
- whenUserReady(() => {
15987
- console.log("Site is ready and trying to load window.Tapjsli script");
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
- }); // window.Pelcro.helpers.loadSDK(
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(
15992
15995
  // "https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js",
15993
15996
  // "tap-bluebird"
15994
15997
  // );
@@ -15996,8 +15999,7 @@ const PaymentMethodContainerWithoutStripe = ({
15996
15999
  // "https://secure.gosell.io/js/sdk/tap.min.js",
15997
16000
  // "tap-sdk"
15998
16001
  // );
15999
-
16000
- setIsTapLoaded(true);
16002
+ // setIsTapLoaded(true);
16001
16003
  }
16002
16004
  }, [selectedPaymentMethodId, isTapLoaded]);
16003
16005
 
@@ -17120,17 +17122,26 @@ const PaymentMethodContainerWithoutStripe = ({
17120
17122
  const UnwrappedForm = es_12(PaymentMethodContainerWithoutStripe);
17121
17123
 
17122
17124
  const PaymentMethodContainer = props => {
17125
+ console.log("Inside Payment Method Container");
17123
17126
  const [isStripeLoaded, setIsStripeLoaded] = React.useState(Boolean(window.Stripe));
17124
17127
  const {
17125
17128
  whenUserReady
17126
17129
  } = usePelcro.getStore();
17130
+ const cardProcessor = getSiteCardProcessor();
17127
17131
  React.useEffect(() => {
17128
17132
  whenUserReady(() => {
17129
17133
  if (!window.Stripe) {
17134
+ console.log("Inside Payment Method Container and window.Stripe is not loaded");
17130
17135
  document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
17131
17136
  setIsStripeLoaded(true);
17132
17137
  });
17133
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
+ }
17134
17145
  });
17135
17146
  }, []);
17136
17147
 
package/dist/index.esm.js CHANGED
@@ -15387,22 +15387,16 @@ 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
- const [isTapLoaded, setIsTapLoaded] = useState(Boolean(window.Tapjsli)); // useEffect(() => {
15391
- // whenUserReady(() => {
15392
- // if (cardProcessor === "tap" && !window.Tapjsli) {
15393
- // window.Pelcro.helpers.loadSDK(
15394
- // "https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js",
15395
- // "tap-bluebird"
15396
- // );
15397
- // window.Pelcro.helpers.loadSDK(
15398
- // "https://secure.gosell.io/js/sdk/tap.min.js",
15399
- // "tap-sdk"
15400
- // );
15401
- // setIsTapLoaded(true);
15402
- // }
15403
- // });
15404
- // }, []);
15405
-
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]);
15406
15400
  useEffect(() => {
15407
15401
  if (window.Pelcro.coupon.getFromUrl()) {
15408
15402
  dispatch({
@@ -15953,12 +15947,21 @@ const PaymentMethodContainerWithoutStripe = ({
15953
15947
  tapInstanceCard.current = card;
15954
15948
  } else if (cardProcessor === "tap" && !window.Tapjsli) {
15955
15949
  console.log("window.Tapjsli script is NOT loaded");
15956
- whenUserReady(() => {
15957
- console.log("Site is ready and trying to load window.Tapjsli script");
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
- }); // window.Pelcro.helpers.loadSDK(
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(
15962
15965
  // "https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js",
15963
15966
  // "tap-bluebird"
15964
15967
  // );
@@ -15966,8 +15969,7 @@ const PaymentMethodContainerWithoutStripe = ({
15966
15969
  // "https://secure.gosell.io/js/sdk/tap.min.js",
15967
15970
  // "tap-sdk"
15968
15971
  // );
15969
-
15970
- setIsTapLoaded(true);
15972
+ // setIsTapLoaded(true);
15971
15973
  }
15972
15974
  }, [selectedPaymentMethodId, isTapLoaded]);
15973
15975
 
@@ -17090,17 +17092,26 @@ const PaymentMethodContainerWithoutStripe = ({
17090
17092
  const UnwrappedForm = es_12(PaymentMethodContainerWithoutStripe);
17091
17093
 
17092
17094
  const PaymentMethodContainer = props => {
17095
+ console.log("Inside Payment Method Container");
17093
17096
  const [isStripeLoaded, setIsStripeLoaded] = useState(Boolean(window.Stripe));
17094
17097
  const {
17095
17098
  whenUserReady
17096
17099
  } = usePelcro.getStore();
17100
+ const cardProcessor = getSiteCardProcessor();
17097
17101
  useEffect(() => {
17098
17102
  whenUserReady(() => {
17099
17103
  if (!window.Stripe) {
17104
+ console.log("Inside Payment Method Container and window.Stripe is not loaded");
17100
17105
  document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
17101
17106
  setIsStripeLoaded(true);
17102
17107
  });
17103
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
+ }
17104
17115
  });
17105
17116
  }, []);
17106
17117
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "3.10.1-beta.15",
4
+ "version": "3.10.1-beta.16",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",