paymob-pixel-alpha 1.1.62 → 1.1.63

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 +30 -32
  2. package/package.json +1 -1
package/main.js CHANGED
@@ -59647,32 +59647,30 @@ const components_Modal_Modal = props => {
59647
59647
  }
59648
59648
  };
59649
59649
  onCloseHandler && useClickOutside(dialogRef, onCloseHandler, open && closeOnClickOutside, true);
59650
- return /*#__PURE__*/_jsx("section", {
59651
- children: /*#__PURE__*/_jsxs("dialog", {
59652
- ref: dialogRef,
59653
- "data-modal-is-mobile": isMobile,
59654
- "data-modal-position": position,
59655
- className: styles['modal'] + (wrapperClassName ? ` ${wrapperClassName}` : ''),
59656
- style: {
59657
- maxWidth,
59658
- width
59659
- },
59660
- children: [hasCloseIcon && /*#__PURE__*/_jsx("button", {
59661
- className: styles['modal__close-icon'],
59662
- onClick: onCloseHandler,
59663
- children: Xmark
59664
- }), /*#__PURE__*/_jsx(ModalHeader, {
59665
- state: state,
59666
- headerIcon: headerIcon,
59667
- title: title,
59668
- supportingText: supportingText,
59669
- keepIconDefaultColors: keepHeaderIconDefaultColors
59670
- }), children, /*#__PURE__*/_jsx(ModalFooter, {
59671
- btnsProps: btnsProps,
59672
- isMobile: isMobile,
59673
- errorMsg: errorMsg
59674
- })]
59675
- })
59650
+ return /*#__PURE__*/_jsxs("dialog", {
59651
+ ref: dialogRef,
59652
+ "data-modal-is-mobile": isMobile,
59653
+ "data-modal-position": position,
59654
+ className: styles['modal'] + (wrapperClassName ? ` ${wrapperClassName}` : ''),
59655
+ style: {
59656
+ maxWidth,
59657
+ width
59658
+ },
59659
+ children: [hasCloseIcon && /*#__PURE__*/_jsx("button", {
59660
+ className: styles['modal__close-icon'],
59661
+ onClick: onCloseHandler,
59662
+ children: Xmark
59663
+ }), /*#__PURE__*/_jsx(ModalHeader, {
59664
+ state: state,
59665
+ headerIcon: headerIcon,
59666
+ title: title,
59667
+ supportingText: supportingText,
59668
+ keepIconDefaultColors: keepHeaderIconDefaultColors
59669
+ }), children, /*#__PURE__*/_jsx(ModalFooter, {
59670
+ btnsProps: btnsProps,
59671
+ isMobile: isMobile,
59672
+ errorMsg: errorMsg
59673
+ })]
59676
59674
  });
59677
59675
  };
59678
59676
  ;// ../../libs/design-system/src/assets/Icons/files_types/index.tsx
@@ -73950,6 +73948,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
73950
73948
  paymentMethodType,
73951
73949
  useCvv
73952
73950
  } = payment;
73951
+ const formattedAmount = formatAmountBasedOnCurrency_formatAmountBasedOnCurrency(String(amount), currency);
73953
73952
  const {
73954
73953
  t
73955
73954
  } = useTranslation_useTranslation('card');
@@ -73996,7 +73995,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
73996
73995
  } = formatCurrencyForDisplay_formatCurrencyForDisplay(currency);
73997
73996
  const [showFeesDetails, setShowFeesDetails] = (0,react.useState)(false);
73998
73997
  const [discountedAmount, setDiscountedAmount] = (0,react.useState)('');
73999
- const [feesAmount, setFeesAmount] = (0,react.useState)((payment == null ? void 0 : payment.feesAmount) || '');
73998
+ const [feesAmount, setFeesAmount] = (0,react.useState)(payment != null && payment.feesAmount ? formatAmountBasedOnCurrency_formatAmountBasedOnCurrency(String(payment.feesAmount), currency) : '');
74000
73999
  const [updatedPaymentToken, setUpdatedPaymentToken] = (0,react.useState)('');
74001
74000
  const showCvvInput = paymentMethodType === constants_PAYMENT_METHODS_TYPES.MOTO && useCvv || paymentMethodType === constants_PAYMENT_METHODS_TYPES.ONLINE;
74002
74001
  const shouldDisablePayBtn = showCvvInput ? loading || (isAmexCardSelected ? selectedCardCvvLength !== src_constants_AMEX_CVV_LENGTH : selectedCardCvvLength !== constants_CVV_LENGTH) : !selectedCardId;
@@ -74331,7 +74330,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
74331
74330
  };
74332
74331
  const handleFeesReset = () => {
74333
74332
  setTotalAmount("");
74334
- setFeesAmount((payment == null ? void 0 : payment.feesAmount) || '');
74333
+ setFeesAmount(payment != null && payment.feesAmount ? formatAmountBasedOnCurrency_formatAmountBasedOnCurrency(String(payment.feesAmount), currency) : '');
74335
74334
  setShowFeesDetails(false);
74336
74335
  setUpdatedPaymentToken("");
74337
74336
  handleResetDiscountMessages();
@@ -74530,7 +74529,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
74530
74529
  fontFamily: currencyFontFamily
74531
74530
  },
74532
74531
  children: displayCurrency
74533
- }), ' ', amount]
74532
+ }), ' ', totalAmount || formattedAmount]
74534
74533
  })]
74535
74534
  }), discountedAmount && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
74536
74535
  className: "flex justify-between items-center text-green-600",
@@ -74737,7 +74736,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
74737
74736
  style: {
74738
74737
  textDecoration: 'line-through'
74739
74738
  },
74740
- children: amount
74739
+ children: formattedAmount
74741
74740
  })]
74742
74741
  }),
74743
74742
  onClick: () => setShouldSubmitData(true),
@@ -74818,7 +74817,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
74818
74817
  style: {
74819
74818
  textDecoration: 'line-through'
74820
74819
  },
74821
- children: amount
74820
+ children: formattedAmount
74822
74821
  })]
74823
74822
  }),
74824
74823
  customStyle: customStyle == null ? void 0 : customStyle.button,
@@ -83080,7 +83079,6 @@ const PaymentsList = /*#__PURE__*/(0,react.forwardRef)((props, ref) => {
83080
83079
  if (a.type === 'knet-apple-pay' && b.type === 'knet') return 1;
83081
83080
  return 0;
83082
83081
  });
83083
- console.log('paymentMethods list', paymentMethods);
83084
83082
  const isApplePay = () => {
83085
83083
  const hasApplePay = !!filteredPaymentList.find(item => item.name === 'apple-pay');
83086
83084
  return hasApplePay && isApplePaySupported();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paymob-pixel-alpha",
3
- "version": "1.1.62",
3
+ "version": "1.1.63",
4
4
  "keywords": ["paymob","pixel","paymob-pixel"],
5
5
  "main": "./main.js",
6
6
  "license": "MIT",