paymob-pixel-alpha 1.1.81 → 1.1.83

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.
Files changed (2) hide show
  1. package/main.js +46 -8
  2. package/package.json +1 -1
package/main.js CHANGED
@@ -10698,6 +10698,31 @@ const Timer = /*#__PURE__*/(0,jsx_runtime.jsx)("svg", {
10698
10698
  fill: "#000"
10699
10699
  })
10700
10700
  });
10701
+ const CoinStack = /*#__PURE__*/(0,jsx_runtime.jsx)("svg", {
10702
+ xmlns: "http://www.w3.org/2000/svg",
10703
+ width: "22",
10704
+ height: "22",
10705
+ viewBox: "0 0 22 22",
10706
+ fill: "none",
10707
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
10708
+ d: "M10.9999 0C5.65265 0 1.46387 2.04401 1.46387 4.65353V17.3461C1.46387 19.9555 5.65269 22 10.9999 22C16.3474 22 20.5364 19.9555 20.5364 17.3461V4.65353C20.5364 2.04401 16.3474 0 10.9999 0ZM19.6564 17.346C19.6564 19.3918 15.6921 21.12 10.9999 21.12C6.30794 21.12 2.34385 19.3918 2.34385 17.346V15.1403C3.84057 16.7351 7.1091 17.82 10.9999 17.82C14.8909 17.82 18.1596 16.7351 19.6564 15.1403V17.346ZM19.6564 13.1665C19.6564 15.2118 15.6921 16.94 10.9999 16.94C6.30794 16.94 2.34385 15.2118 2.34385 13.1665V10.9578C3.84057 12.5526 7.1091 13.6375 10.9999 13.6375C14.8909 13.6375 18.1596 12.5526 19.6564 10.9578V13.1665ZM19.6564 8.98388C19.6564 11.0292 15.6921 12.7574 10.9999 12.7574C6.30794 12.7574 2.34385 11.0292 2.34385 8.98388V6.62738C3.84057 8.22218 7.1091 9.30702 10.9999 9.30702C14.8909 9.30702 18.1596 8.22218 19.6564 6.62733V8.98388ZM10.9999 8.42703C6.30794 8.42703 2.34385 6.69883 2.34385 4.65353C2.34385 2.60823 6.30794 0.88003 10.9999 0.88003C15.6921 0.88003 19.6564 2.60823 19.6564 4.65353C19.6564 6.69883 15.6921 8.42703 10.9999 8.42703Z",
10709
+ fill: "#F59E0B"
10710
+ })
10711
+ });
10712
+ const FileExclamation = /*#__PURE__*/(0,jsx_runtime.jsxs)("svg", {
10713
+ xmlns: "http://www.w3.org/2000/svg",
10714
+ width: "22",
10715
+ height: "22",
10716
+ viewBox: "0 0 22 22",
10717
+ fill: "none",
10718
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("path", {
10719
+ d: "M19.9375 15.0324H16.775V2.46973C16.775 1.71141 16.1583 1.09473 15.4 1.09473H2.0625C1.30419 1.09473 0.6875 1.71141 0.6875 2.46973V17.9247C0.6875 19.5548 2.01369 20.881 3.64375 20.881C8.55044 20.8824 13.4606 20.9374 18.3666 20.8789C19.1484 20.8756 19.8972 20.563 20.4492 20.0093C21.0012 19.4556 21.3116 18.7059 21.3125 17.924V16.4074C21.3125 15.6491 20.6958 15.0324 19.9375 15.0324ZM3.64375 19.506C3.22454 19.5054 2.82266 19.3387 2.52624 19.0422C2.22982 18.7458 2.06305 18.3439 2.0625 17.9247V2.46973H15.4V17.9247C15.4 18.5064 15.5684 19.0488 15.8593 19.506H3.64375ZM19.9375 17.924C19.937 18.3432 19.7702 18.745 19.4737 19.0413C19.1773 19.3376 18.7754 19.5042 18.3563 19.5046L18.3528 19.5053C17.9341 19.504 17.533 19.3369 17.2373 19.0405C16.9416 18.7442 16.7754 18.3427 16.775 17.924V16.4067H19.9375V17.924Z",
10720
+ fill: "#F43F5E"
10721
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
10722
+ d: "M6.62083 6.5791C6.70333 6.61416 6.79271 6.6341 6.88896 6.6341C6.97882 6.63319 7.06761 6.6145 7.15021 6.5791C7.23281 6.5437 7.30758 6.49229 7.37021 6.42785C7.43468 6.3656 7.48565 6.29075 7.51995 6.20796C7.55425 6.12517 7.57114 6.0362 7.56958 5.9466C7.56958 5.89916 7.56958 5.85722 7.56271 5.80979C7.54896 5.76785 7.53521 5.71972 7.52146 5.67916C7.50083 5.63791 7.48021 5.60354 7.45958 5.56229C7.43208 5.52791 7.40458 5.49354 7.37021 5.45916C7.30833 5.39729 7.23271 5.34229 7.15021 5.30791C6.97833 5.23916 6.79271 5.23916 6.62083 5.30791C6.53833 5.34229 6.46271 5.39729 6.40083 5.45847C6.36646 5.49354 6.33896 5.52791 6.31146 5.56229C6.29083 5.60285 6.27021 5.63791 6.24958 5.67916C6.23583 5.72041 6.22208 5.76854 6.20833 5.80979C6.20146 5.85791 6.19458 5.89916 6.19458 5.9466C6.19458 6.13291 6.27021 6.30479 6.40083 6.42785C6.46271 6.49729 6.53833 6.54541 6.62083 6.5791ZM10.3127 8.99979C10.2302 9.04104 10.1546 9.08916 10.0927 9.15104C10.0308 9.21291 9.97583 9.28854 9.94146 9.37791C9.90708 9.46041 9.89333 9.54979 9.89333 9.63916C9.89333 9.82547 9.96208 9.99735 10.0927 10.1204C10.1564 10.1854 10.2323 10.2371 10.3161 10.2725C10.3999 10.3079 10.4899 10.3263 10.5808 10.3267C10.6707 10.3258 10.7595 10.3071 10.8421 10.2717C10.9247 10.2363 10.9995 10.1849 11.0621 10.1204C11.1308 10.0585 11.179 9.98291 11.2133 9.90041C11.2477 9.8186 11.2683 9.72854 11.2683 9.63916C11.2683 9.46041 11.1927 9.28166 11.0621 9.15104C10.8696 8.95854 10.5671 8.89597 10.3127 8.99979ZM6.67996 9.84335C6.74366 9.90741 6.81939 9.95825 6.90281 9.99294C6.98622 10.0276 7.07568 10.0455 7.16602 10.0455C7.25636 10.0455 7.34581 10.0276 7.42923 9.99294C7.51265 9.95825 7.58838 9.90741 7.65208 9.84335L10.783 6.71179C10.8468 6.64795 10.8974 6.57218 10.932 6.48878C10.9665 6.40538 10.9843 6.31599 10.9843 6.22572C10.9843 6.13545 10.9665 6.04607 10.932 5.96267C10.8974 5.87927 10.8468 5.80349 10.783 5.73966C10.7191 5.67583 10.6433 5.6252 10.5599 5.59065C10.4766 5.55611 10.3872 5.53833 10.2969 5.53833C10.2066 5.53833 10.1172 5.55611 10.0338 5.59065C9.95044 5.6252 9.87466 5.67583 9.81083 5.73966L6.67996 8.87122C6.55107 9.00015 6.47867 9.17498 6.47867 9.35729C6.47867 9.53959 6.55107 9.71442 6.67996 9.84335ZM12.4976 12.3273H8.10033C7.918 12.3273 7.74313 12.3997 7.6142 12.5286C7.48526 12.6576 7.41283 12.8324 7.41283 13.0148C7.41283 13.1971 7.48526 13.372 7.6142 13.5009C7.74313 13.6299 7.918 13.7023 8.10033 13.7023H12.4976C12.6799 13.7023 12.8548 13.6299 12.9837 13.5009C13.1126 13.372 13.1851 13.1971 13.1851 13.0148C13.1851 12.8324 13.1126 12.6576 12.9837 12.5286C12.8548 12.3997 12.6799 12.3273 12.4976 12.3273ZM4.96533 13.7023H5.55727C5.73961 13.7023 5.91447 13.6299 6.04341 13.5009C6.17234 13.372 6.24477 13.1971 6.24477 13.0148C6.24477 12.8324 6.17234 12.6576 6.04341 12.5286C5.91447 12.3997 5.73961 12.3273 5.55727 12.3273H4.96533C4.783 12.3273 4.60813 12.3997 4.4792 12.5286C4.35026 12.6576 4.27783 12.8324 4.27783 13.0148C4.27783 13.1971 4.35026 13.372 4.4792 13.5009C4.60813 13.6299 4.783 13.7023 4.96533 13.7023ZM9.36327 15.3681H4.96533C4.783 15.3681 4.60813 15.4405 4.4792 15.5695C4.35026 15.6984 4.27783 15.8733 4.27783 16.0556C4.27783 16.2379 4.35026 16.4128 4.4792 16.5417C4.60813 16.6707 4.783 16.7431 4.96533 16.7431H9.36258C9.54492 16.7432 9.71982 16.6708 9.84882 16.542C9.97781 16.4131 10.0503 16.2383 10.0504 16.0559C10.0505 15.8736 9.97817 15.6987 9.8493 15.5697C9.72044 15.4407 9.54561 15.3682 9.36327 15.3681ZM12.4976 15.3681H11.9056C11.7233 15.3681 11.5484 15.4405 11.4195 15.5695C11.2906 15.6984 11.2181 15.8733 11.2181 16.0556C11.2181 16.2379 11.2906 16.4128 11.4195 16.5417C11.5484 16.6707 11.7233 16.7431 11.9056 16.7431H12.4976C12.6799 16.7431 12.8548 16.6707 12.9837 16.5417C13.1126 16.4128 13.1851 16.2379 13.1851 16.0556C13.1851 15.8733 13.1126 15.6984 12.9837 15.5695C12.8548 15.4405 12.6799 15.3681 12.4976 15.3681Z",
10723
+ fill: "#F43F5E"
10724
+ })]
10725
+ });
10701
10726
  // EXTERNAL MODULE: ../../node_modules/card-validator/dist/index.js
10702
10727
  var dist = __webpack_require__(9344);
10703
10728
  var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
@@ -16829,7 +16854,8 @@ const Modal_Modal = props => {
16829
16854
  isOverlayAboveModal = false,
16830
16855
  isTopLayer = true,
16831
16856
  containerRef,
16832
- children
16857
+ children,
16858
+ customStyles
16833
16859
  } = props;
16834
16860
  const dialogRef = containerRef || (0,react.useRef)(null);
16835
16861
  (0,react.useEffect)(() => {
@@ -16882,10 +16908,10 @@ const Modal_Modal = props => {
16882
16908
  "data-modal-position": position,
16883
16909
  "data-modal-is-top-layer": isTopLayer,
16884
16910
  className: modal_module['modal'] + (wrapperClassName ? ` ${wrapperClassName}` : ''),
16885
- style: {
16911
+ style: Object.assign({
16886
16912
  maxWidth,
16887
16913
  width
16888
- },
16914
+ }, customStyles),
16889
16915
  children: [hasCloseIcon && /*#__PURE__*/(0,jsx_runtime.jsx)("button", {
16890
16916
  className: modal_module['modal__close-icon'],
16891
16917
  onClick: onCloseHandler,
@@ -17077,6 +17103,7 @@ function InstantRefundToggle(instantRefundToggleProps) {
17077
17103
  children: ["Get your refund instantly.", ' ', /*#__PURE__*/(0,jsx_runtime.jsx)("button", {
17078
17104
  className: "text-[#101828] border-none outline-none",
17079
17105
  onClick: handleOpenRefundGuideModal,
17106
+ disabled: instantRefundData && !isEligible,
17080
17107
  children: "Learn more"
17081
17108
  })]
17082
17109
  }), instantRefundData && !isEligible && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
@@ -17788,7 +17815,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
17788
17815
  const hasDiscountForPayment = !!(discounts != null && discounts.count && getDiscountIntegrationId());
17789
17816
  (0,react.useEffect)(() => {
17790
17817
  const handleDataFromIframe = event => {
17791
- var _iframeRef$current, _event$data, _event$data2, _event$data3, _event$data4, _event$data5, _event$data6, _event$data7, _event$data9, _event$data0, _event$data1, _event$data10;
17818
+ var _iframeRef$current, _event$data, _event$data2, _event$data3, _event$data4, _event$data5, _event$data6, _event$data7, _event$data9, _event$data0, _event$data1, _event$data10, _event$data11;
17792
17819
  if (!event.data) return;
17793
17820
  if (!event.data.type) return;
17794
17821
  const isFromCVVIframe = Object.values(iframeCVVRefs.current).some(ref => (ref == null || ref.getContentWindow == null ? void 0 : ref.getContentWindow()) === event.source);
@@ -17885,6 +17912,9 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
17885
17912
  handleResetEppState();
17886
17913
  setBankInstallmentErrorMessage('');
17887
17914
  }
17915
+ if ((event == null || (_event$data11 = event.data) == null ? void 0 : _event$data11.type) === 'instantRefundEligibilityCardChanged') {
17916
+ resetInstantRefundState();
17917
+ }
17888
17918
  };
17889
17919
  const handlePaymentResponse = ({
17890
17920
  res,
@@ -18627,6 +18657,14 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
18627
18657
  }
18628
18658
  }
18629
18659
  };
18660
+ const parseAmount = value => {
18661
+ if (!value || !(value != null && value.trim())) return undefined;
18662
+ const parsed = Number(value);
18663
+ return Number.isNaN(parsed) ? undefined : parsed;
18664
+ };
18665
+ const transactionAmount = parseAmount(totalAmount);
18666
+ const orderAmount = parseAmount(`${amount}`);
18667
+ const shouldShowStrikethrough = transactionAmount !== undefined && orderAmount !== undefined && transactionAmount < orderAmount;
18630
18668
  const showOrderDetails = discountedAmount || showFeesDetails && feesAmount || isInstantRefundActive && isInstantRefundChecked && instantRefundAmount || isEppEnabled && selectedInstallmentPlan || tenure;
18631
18669
  const orderDetailsContent = showOrderDetails ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
18632
18670
  className: "flex flex-col gap-3 text-sm leading-4",
@@ -18931,12 +18969,12 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
18931
18969
  fontFamily: currencyFontFamily
18932
18970
  },
18933
18971
  children: displayCurrency
18934
- }), ' ', totalAmount || amount, totalAmount && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
18972
+ }), ' ', totalAmount || formattedAmount, totalAmount && shouldShowStrikethrough && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
18935
18973
  className: "opacity-50 ml-2 text-white text-sm font-semibold leading-6 tracking-[0.16px]",
18936
18974
  style: {
18937
18975
  textDecoration: 'line-through'
18938
18976
  },
18939
- children: amount
18977
+ children: formattedAmount
18940
18978
  })]
18941
18979
  }) : tenure ? /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
18942
18980
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
@@ -19050,12 +19088,12 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
19050
19088
  fontFamily: currencyFontFamily
19051
19089
  },
19052
19090
  children: displayCurrency
19053
- }), ' ', totalAmount || amount, totalAmount && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
19091
+ }), ' ', totalAmount || formattedAmount, totalAmount && shouldShowStrikethrough && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
19054
19092
  className: "opacity-50 ml-2 text-white text-sm font-semibold leading-6 tracking-[0.16px]",
19055
19093
  style: {
19056
19094
  textDecoration: 'line-through'
19057
19095
  },
19058
- children: amount
19096
+ children: formattedAmount
19059
19097
  })]
19060
19098
  }) : /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
19061
19099
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paymob-pixel-alpha",
3
- "version": "1.1.81",
3
+ "version": "1.1.83",
4
4
  "keywords": ["paymob","pixel","paymob-pixel"],
5
5
  "main": "./main.js",
6
6
  "license": "MIT",