@pelcro/react-pelcro-js 3.26.0-beta.24 → 3.26.0-beta.26

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
@@ -3460,6 +3460,7 @@ var labels$15 = {
3460
3460
  phone: "Phone",
3461
3461
  freeItems: "Free Items",
3462
3462
  order: "Order",
3463
+ amount: "Amount",
3463
3464
  email: "Email",
3464
3465
  password: "Password"
3465
3466
  };
@@ -4387,6 +4388,7 @@ var labels$P = {
4387
4388
  phone: "Téléphoner",
4388
4389
  freeItems: "Articles gratuits",
4389
4390
  order: "Commande",
4391
+ amount: "Montant",
4390
4392
  email: "Courriel",
4391
4393
  password: "Créer un mot de passe"
4392
4394
  };
@@ -5313,6 +5315,7 @@ var labels$x = {
5313
5315
  phone: "핸드폰",
5314
5316
  freeItems: "무료 아이템",
5315
5317
  order: "주문",
5318
+ amount: "금액",
5316
5319
  email: "이메일",
5317
5320
  password: "비밀번호"
5318
5321
  };
@@ -6344,6 +6347,7 @@ var labels$f = {
6344
6347
  phone: "Teléfono",
6345
6348
  freeItems: "Artículos gratis",
6346
6349
  order: "Pida",
6350
+ amount: "Importe",
6347
6351
  email: "Correo",
6348
6352
  password: "Contraseña"
6349
6353
  };
@@ -9521,43 +9525,6 @@ const calcAndFormatItemsTotal = (items, currency) => {
9521
9525
  }
9522
9526
  return getFormattedPriceByLocal(totalWithoutDividingBy100, currency, getPageOrDefaultLanguage());
9523
9527
  };
9524
- const getOrderInfo = (order, i18n) => {
9525
- if (!order) {
9526
- return {
9527
- price: null,
9528
- currency: null,
9529
- label: null
9530
- };
9531
- }
9532
- const isQuickPurchase = !Array.isArray(order);
9533
- if (isQuickPurchase) {
9534
- return {
9535
- price: order.price * order.quantity,
9536
- currency: order.currency,
9537
- label: order.name
9538
- };
9539
- }
9540
- if (order.length === 0) {
9541
- return {
9542
- price: null,
9543
- currency: null,
9544
- label: null
9545
- };
9546
- }
9547
- if (order.length === 1) {
9548
- return {
9549
- price: order[0].price * order[0].quantity,
9550
- currency: order[0].currency,
9551
- label: order[0].name
9552
- };
9553
- }
9554
- const price = order.reduce((total, item) => total + item.price * item.quantity, 0);
9555
- return {
9556
- price,
9557
- currency: order[0].currency,
9558
- label: price === 0 ? i18n("labels.freeItems") : i18n("labels.order")
9559
- };
9560
- };
9561
9528
 
9562
9529
  /**
9563
9530
  * returns true if the URL contains a supported view trigger URL
@@ -21449,13 +21416,16 @@ const ApplePayButton = _ref => {
21449
21416
  }
21450
21417
  };
21451
21418
  const orderId = `pelcro-${new Date().getTime()}`;
21419
+ const eProtectRequestPreLiveURL = "https://request.eprotect.vantivprelive.com";
21420
+ const eProtectRequestProductionURL = "https://request.eprotect.vantivcnp.com";
21421
+ const eProtectRequestUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? eProtectRequestProductionURL : eProtectRequestPreLiveURL;
21452
21422
  const eProtectRequest = {
21453
21423
  paypageId: payPageId,
21454
21424
  reportGroup: reportGroup,
21455
21425
  orderId: orderId,
21456
21426
  id: orderId,
21457
21427
  applepay: applePayToken,
21458
- url: "https://request.eprotect.vantivprelive.com"
21428
+ url: eProtectRequestUrlToUse
21459
21429
  };
21460
21430
 
21461
21431
  // successCallback function to handle the response from WorldPay.
@@ -21590,7 +21560,7 @@ function PaymentMethodView(_ref) {
21590
21560
  className: "plc-text-gray-600"
21591
21561
  }, /*#__PURE__*/React__default['default'].createElement("span", {
21592
21562
  className: "plc-tracking-wider plc-uppercase"
21593
- }, getOrderInfo(order, t).label), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
21563
+ }, t("labels.amount")), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
21594
21564
  className: "plc-text-xl plc-font-semibold plc-text-primary-600"
21595
21565
  }, (_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage())))), cardProcessor === "stripe" && !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default['default'].createElement("div", {
21596
21566
  className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50"
package/dist/index.esm.js CHANGED
@@ -3430,6 +3430,7 @@ var labels$15 = {
3430
3430
  phone: "Phone",
3431
3431
  freeItems: "Free Items",
3432
3432
  order: "Order",
3433
+ amount: "Amount",
3433
3434
  email: "Email",
3434
3435
  password: "Password"
3435
3436
  };
@@ -4357,6 +4358,7 @@ var labels$P = {
4357
4358
  phone: "Téléphoner",
4358
4359
  freeItems: "Articles gratuits",
4359
4360
  order: "Commande",
4361
+ amount: "Montant",
4360
4362
  email: "Courriel",
4361
4363
  password: "Créer un mot de passe"
4362
4364
  };
@@ -5283,6 +5285,7 @@ var labels$x = {
5283
5285
  phone: "핸드폰",
5284
5286
  freeItems: "무료 아이템",
5285
5287
  order: "주문",
5288
+ amount: "금액",
5286
5289
  email: "이메일",
5287
5290
  password: "비밀번호"
5288
5291
  };
@@ -6314,6 +6317,7 @@ var labels$f = {
6314
6317
  phone: "Teléfono",
6315
6318
  freeItems: "Artículos gratis",
6316
6319
  order: "Pida",
6320
+ amount: "Importe",
6317
6321
  email: "Correo",
6318
6322
  password: "Contraseña"
6319
6323
  };
@@ -9491,43 +9495,6 @@ const calcAndFormatItemsTotal = (items, currency) => {
9491
9495
  }
9492
9496
  return getFormattedPriceByLocal(totalWithoutDividingBy100, currency, getPageOrDefaultLanguage());
9493
9497
  };
9494
- const getOrderInfo = (order, i18n) => {
9495
- if (!order) {
9496
- return {
9497
- price: null,
9498
- currency: null,
9499
- label: null
9500
- };
9501
- }
9502
- const isQuickPurchase = !Array.isArray(order);
9503
- if (isQuickPurchase) {
9504
- return {
9505
- price: order.price * order.quantity,
9506
- currency: order.currency,
9507
- label: order.name
9508
- };
9509
- }
9510
- if (order.length === 0) {
9511
- return {
9512
- price: null,
9513
- currency: null,
9514
- label: null
9515
- };
9516
- }
9517
- if (order.length === 1) {
9518
- return {
9519
- price: order[0].price * order[0].quantity,
9520
- currency: order[0].currency,
9521
- label: order[0].name
9522
- };
9523
- }
9524
- const price = order.reduce((total, item) => total + item.price * item.quantity, 0);
9525
- return {
9526
- price,
9527
- currency: order[0].currency,
9528
- label: price === 0 ? i18n("labels.freeItems") : i18n("labels.order")
9529
- };
9530
- };
9531
9498
 
9532
9499
  /**
9533
9500
  * returns true if the URL contains a supported view trigger URL
@@ -21419,13 +21386,16 @@ const ApplePayButton = _ref => {
21419
21386
  }
21420
21387
  };
21421
21388
  const orderId = `pelcro-${new Date().getTime()}`;
21389
+ const eProtectRequestPreLiveURL = "https://request.eprotect.vantivprelive.com";
21390
+ const eProtectRequestProductionURL = "https://request.eprotect.vantivcnp.com";
21391
+ const eProtectRequestUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? eProtectRequestProductionURL : eProtectRequestPreLiveURL;
21422
21392
  const eProtectRequest = {
21423
21393
  paypageId: payPageId,
21424
21394
  reportGroup: reportGroup,
21425
21395
  orderId: orderId,
21426
21396
  id: orderId,
21427
21397
  applepay: applePayToken,
21428
- url: "https://request.eprotect.vantivprelive.com"
21398
+ url: eProtectRequestUrlToUse
21429
21399
  };
21430
21400
 
21431
21401
  // successCallback function to handle the response from WorldPay.
@@ -21560,7 +21530,7 @@ function PaymentMethodView(_ref) {
21560
21530
  className: "plc-text-gray-600"
21561
21531
  }, /*#__PURE__*/React__default.createElement("span", {
21562
21532
  className: "plc-tracking-wider plc-uppercase"
21563
- }, getOrderInfo(order, t).label), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
21533
+ }, t("labels.amount")), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
21564
21534
  className: "plc-text-xl plc-font-semibold plc-text-primary-600"
21565
21535
  }, (_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage())))), cardProcessor === "stripe" && !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default.createElement("div", {
21566
21536
  className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50"
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.26.0-beta.24",
4
+ "version": "3.26.0-beta.26",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",