@pelcro/react-pelcro-js 3.2.0-beta.5 → 3.2.0-beta.6

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
@@ -8871,7 +8871,7 @@ const loadPaymentSDKs = () => {
8871
8871
  } // Load Vantiv SDKs
8872
8872
 
8873
8873
 
8874
- const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_pay_page_id);
8874
+ const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
8875
8875
 
8876
8876
  if (supportsVantiv) {
8877
8877
  if (!window.jQuery) {
@@ -8879,7 +8879,10 @@ const loadPaymentSDKs = () => {
8879
8879
  }
8880
8880
 
8881
8881
  if (!window.EprotectIframeClient) {
8882
- window.Pelcro.helpers.loadSDK("https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js", "vantiv-eprotect-sdk");
8882
+ const PRELIVE_URL = "https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js";
8883
+ const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-client4.min.js";
8884
+ const scriptUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? PRODUCTION_URL : PRELIVE_URL;
8885
+ window.Pelcro.helpers.loadSDK(scriptUrlToUse, "vantiv-eprotect-sdk");
8883
8886
  }
8884
8887
  }
8885
8888
  };
@@ -13714,12 +13717,13 @@ const PaymentMethodContainerWithoutStripe = ({
13714
13717
  const cardProcessor = getSiteCardProcessor();
13715
13718
 
13716
13719
  if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
13717
- var _window$Pelcro$site$r;
13720
+ var _window$Pelcro$site$r, _window$Pelcro$site$r2;
13718
13721
 
13719
- const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_pay_page_id;
13722
+ const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings.pay_page_id;
13723
+ const reportGroup = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.vantiv_gateway_settings.report_group;
13720
13724
  vantivInstanceRef.current = new window.EprotectIframeClient({
13721
13725
  paypageId: payPageId,
13722
- reportGroup: payPageId,
13726
+ reportGroup: reportGroup,
13723
13727
  style: "pelcro",
13724
13728
  height: "245",
13725
13729
  timeout: 50000,
@@ -13808,9 +13812,9 @@ const PaymentMethodContainerWithoutStripe = ({
13808
13812
 
13809
13813
 
13810
13814
  const updateTotalAmountWithTax = () => {
13811
- var _window$Pelcro$site$r2;
13815
+ var _window$Pelcro$site$r3;
13812
13816
 
13813
- const taxesEnabled = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.taxes_enabled;
13817
+ const taxesEnabled = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.taxes_enabled;
13814
13818
 
13815
13819
  if (taxesEnabled && type === "createPayment") {
13816
13820
  dispatch({
@@ -14455,13 +14459,13 @@ const PaymentMethodContainerWithoutStripe = ({
14455
14459
 
14456
14460
 
14457
14461
  const resolveTaxCalculation = () => {
14458
- var _window$Pelcro$site$r3;
14462
+ var _window$Pelcro$site$r4;
14459
14463
 
14460
14464
  if (type === "invoicePayment") {
14461
14465
  return new Promise(resolve => resolve());
14462
14466
  }
14463
14467
 
14464
- const taxesEnabled = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.taxes_enabled;
14468
+ const taxesEnabled = (_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.taxes_enabled;
14465
14469
  return new Promise((resolve, reject) => {
14466
14470
  // resolve early if taxes isn't enabled
14467
14471
  if (!taxesEnabled) {
package/dist/index.esm.js CHANGED
@@ -8841,7 +8841,7 @@ const loadPaymentSDKs = () => {
8841
8841
  } // Load Vantiv SDKs
8842
8842
 
8843
8843
 
8844
- const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_pay_page_id);
8844
+ const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
8845
8845
 
8846
8846
  if (supportsVantiv) {
8847
8847
  if (!window.jQuery) {
@@ -8849,7 +8849,10 @@ const loadPaymentSDKs = () => {
8849
8849
  }
8850
8850
 
8851
8851
  if (!window.EprotectIframeClient) {
8852
- window.Pelcro.helpers.loadSDK("https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js", "vantiv-eprotect-sdk");
8852
+ const PRELIVE_URL = "https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js";
8853
+ const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-client4.min.js";
8854
+ const scriptUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? PRODUCTION_URL : PRELIVE_URL;
8855
+ window.Pelcro.helpers.loadSDK(scriptUrlToUse, "vantiv-eprotect-sdk");
8853
8856
  }
8854
8857
  }
8855
8858
  };
@@ -13684,12 +13687,13 @@ const PaymentMethodContainerWithoutStripe = ({
13684
13687
  const cardProcessor = getSiteCardProcessor();
13685
13688
 
13686
13689
  if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
13687
- var _window$Pelcro$site$r;
13690
+ var _window$Pelcro$site$r, _window$Pelcro$site$r2;
13688
13691
 
13689
- const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_pay_page_id;
13692
+ const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings.pay_page_id;
13693
+ const reportGroup = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.vantiv_gateway_settings.report_group;
13690
13694
  vantivInstanceRef.current = new window.EprotectIframeClient({
13691
13695
  paypageId: payPageId,
13692
- reportGroup: payPageId,
13696
+ reportGroup: reportGroup,
13693
13697
  style: "pelcro",
13694
13698
  height: "245",
13695
13699
  timeout: 50000,
@@ -13778,9 +13782,9 @@ const PaymentMethodContainerWithoutStripe = ({
13778
13782
 
13779
13783
 
13780
13784
  const updateTotalAmountWithTax = () => {
13781
- var _window$Pelcro$site$r2;
13785
+ var _window$Pelcro$site$r3;
13782
13786
 
13783
- const taxesEnabled = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.taxes_enabled;
13787
+ const taxesEnabled = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.taxes_enabled;
13784
13788
 
13785
13789
  if (taxesEnabled && type === "createPayment") {
13786
13790
  dispatch({
@@ -14425,13 +14429,13 @@ const PaymentMethodContainerWithoutStripe = ({
14425
14429
 
14426
14430
 
14427
14431
  const resolveTaxCalculation = () => {
14428
- var _window$Pelcro$site$r3;
14432
+ var _window$Pelcro$site$r4;
14429
14433
 
14430
14434
  if (type === "invoicePayment") {
14431
14435
  return new Promise(resolve => resolve());
14432
14436
  }
14433
14437
 
14434
- const taxesEnabled = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.taxes_enabled;
14438
+ const taxesEnabled = (_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.taxes_enabled;
14435
14439
  return new Promise((resolve, reject) => {
14436
14440
  // resolve early if taxes isn't enabled
14437
14441
  if (!taxesEnabled) {
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.2.0-beta.5",
4
+ "version": "3.2.0-beta.6",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",