@pelcro/react-pelcro-js 3.10.1-beta.10 → 3.10.1-beta.12

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
@@ -15405,6 +15405,9 @@ const PaymentMethodContainerWithoutStripe = ({
15405
15405
  selectedPaymentMethodId,
15406
15406
  couponCode
15407
15407
  } = usePelcro();
15408
+ const {
15409
+ whenUserReady
15410
+ } = usePelcro.getStore();
15408
15411
  const product = (_props$product = props.product) !== null && _props$product !== void 0 ? _props$product : pelcroStore.product;
15409
15412
  const plan = (_props$plan = props.plan) !== null && _props$plan !== void 0 ? _props$plan : pelcroStore.plan;
15410
15413
  const subscriptionIdToRenew = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : pelcroStore.subscriptionIdToRenew;
@@ -15413,7 +15416,17 @@ const PaymentMethodContainerWithoutStripe = ({
15413
15416
  const isGift = (_props$isGift = props.isGift) !== null && _props$isGift !== void 0 ? _props$isGift : pelcroStore.isGift;
15414
15417
  const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
15415
15418
  const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
15419
+ const cardProcessor = getSiteCardProcessor();
15416
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
+ }, []);
15417
15430
  React.useEffect(() => {
15418
15431
  if (window.Pelcro.coupon.getFromUrl()) {
15419
15432
  dispatch({
@@ -15868,7 +15881,6 @@ const PaymentMethodContainerWithoutStripe = ({
15868
15881
  const vantivInstanceRef = React__default['default'].useRef(null);
15869
15882
  const tapInstanceRef = React__default['default'].useRef(null);
15870
15883
  const tapInstanceCard = React__default['default'].useRef(null);
15871
- const cardProcessor = getSiteCardProcessor();
15872
15884
  React.useEffect(() => {
15873
15885
  if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
15874
15886
  var _window$Pelcro$site$r, _window$Pelcro$site$r2;
@@ -15898,17 +15910,11 @@ const PaymentMethodContainerWithoutStripe = ({
15898
15910
  }
15899
15911
  }, [selectedPaymentMethodId]);
15900
15912
  React.useEffect(() => {
15901
- if (cardProcessor === "tap" && !isTapLoaded) {
15902
- window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
15903
- window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
15904
- setIsTapLoaded(true);
15905
- }
15906
-
15907
15913
  if (cardProcessor === "tap" && !selectedPaymentMethodId && isTapLoaded) {
15908
15914
  var _window$Pelcro$site$r3;
15909
15915
 
15910
- console.log("Yes Tap JSLI is enabled and activated");
15911
- 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);
15916
+ console.log("Yes Tap JSLI is enabled and script is loaded");
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);
15912
15918
  let elements = tapKey.elements({});
15913
15919
  let style = {
15914
15920
  base: {
package/dist/index.esm.js CHANGED
@@ -15375,6 +15375,9 @@ const PaymentMethodContainerWithoutStripe = ({
15375
15375
  selectedPaymentMethodId,
15376
15376
  couponCode
15377
15377
  } = usePelcro();
15378
+ const {
15379
+ whenUserReady
15380
+ } = usePelcro.getStore();
15378
15381
  const product = (_props$product = props.product) !== null && _props$product !== void 0 ? _props$product : pelcroStore.product;
15379
15382
  const plan = (_props$plan = props.plan) !== null && _props$plan !== void 0 ? _props$plan : pelcroStore.plan;
15380
15383
  const subscriptionIdToRenew = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : pelcroStore.subscriptionIdToRenew;
@@ -15383,7 +15386,17 @@ const PaymentMethodContainerWithoutStripe = ({
15383
15386
  const isGift = (_props$isGift = props.isGift) !== null && _props$isGift !== void 0 ? _props$isGift : pelcroStore.isGift;
15384
15387
  const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
15385
15388
  const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
15389
+ const cardProcessor = getSiteCardProcessor();
15386
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
+ }, []);
15387
15400
  useEffect(() => {
15388
15401
  if (window.Pelcro.coupon.getFromUrl()) {
15389
15402
  dispatch({
@@ -15838,7 +15851,6 @@ const PaymentMethodContainerWithoutStripe = ({
15838
15851
  const vantivInstanceRef = React__default.useRef(null);
15839
15852
  const tapInstanceRef = React__default.useRef(null);
15840
15853
  const tapInstanceCard = React__default.useRef(null);
15841
- const cardProcessor = getSiteCardProcessor();
15842
15854
  useEffect(() => {
15843
15855
  if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
15844
15856
  var _window$Pelcro$site$r, _window$Pelcro$site$r2;
@@ -15868,17 +15880,11 @@ const PaymentMethodContainerWithoutStripe = ({
15868
15880
  }
15869
15881
  }, [selectedPaymentMethodId]);
15870
15882
  useEffect(() => {
15871
- if (cardProcessor === "tap" && !isTapLoaded) {
15872
- window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
15873
- window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
15874
- setIsTapLoaded(true);
15875
- }
15876
-
15877
15883
  if (cardProcessor === "tap" && !selectedPaymentMethodId && isTapLoaded) {
15878
15884
  var _window$Pelcro$site$r3;
15879
15885
 
15880
- console.log("Yes Tap JSLI is enabled and activated");
15881
- 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);
15886
+ console.log("Yes Tap JSLI is enabled and script is loaded");
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);
15882
15888
  let elements = tapKey.elements({});
15883
15889
  let style = {
15884
15890
  base: {
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.10",
4
+ "version": "3.10.1-beta.12",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",