paymob-pixel-alpha 1.1.30 → 1.1.32

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 +5 -1
  2. package/package.json +1 -1
package/main.js CHANGED
@@ -23842,7 +23842,7 @@ const checkDiscount = (payment_token, integration_id, identifier, isSavedCard) =
23842
23842
  identifier: identifier.replace(/\s/g, '')
23843
23843
  }, isSavedCard && {
23844
23844
  saved_card_token: identifier
23845
- }));
23845
+ })).then(res => res).catch(err => err == null ? void 0 : err.response);
23846
23846
  };
23847
23847
  const sendOTP = payload => {
23848
23848
  return lib_axios.post(`/api/acceptance/omannet_callback/otp_verify`, {
@@ -23993,6 +23993,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
23993
23993
  const selectedCardId = selectedCard == null ? void 0 : selectedCard.id;
23994
23994
  const [discountAppliedMessage, setDiscountAppliedMessage] = (0,react.useState)(null);
23995
23995
  const [discountErrorMessage, setDiscountErrorMessage] = (0,react.useState)('');
23996
+ console.log("🚀 ~ discountErrorMessage:", discountErrorMessage);
23996
23997
  const [totalAmount, setTotalAmount] = (0,react.useState)('');
23997
23998
  const {
23998
23999
  displayCurrency,
@@ -24274,9 +24275,11 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
24274
24275
  const discountIntegrationId = discounts == null || (_discounts$data = discounts.data) == null || (_discounts$data = _discounts$data.find(discount => (discount == null ? void 0 : discount.integration_id) === integrationId)) == null ? void 0 : _discounts$data.integration_id;
24275
24276
  if (!hasDiscount || !discountIntegrationId) return;
24276
24277
  const res = await checkDiscount(paymentToken, discountIntegrationId, identifier, savedCardType);
24278
+ console.log("🚀 ~ handleSavedCardDiscount ~ res:", res);
24277
24279
  handleDiscount(res);
24278
24280
  };
24279
24281
  const handleDiscount = res => {
24282
+ console.log("🚀 ~ handleDiscount ~ res:", res);
24280
24283
  handleResetDiscountMessages();
24281
24284
  if (!res) return;
24282
24285
  if (res.status === 200) {
@@ -24307,6 +24310,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
24307
24310
  setTotalAmount(totalAmount);
24308
24311
  }
24309
24312
  } else {
24313
+ console.log("🚀 ~ getErrorMsg(res):", getErrorMsg(res));
24310
24314
  setDiscountErrorMessage(getErrorMsg(res));
24311
24315
  }
24312
24316
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paymob-pixel-alpha",
3
- "version": "1.1.30",
3
+ "version": "1.1.32",
4
4
  "keywords": ["paymob","pixel","paymob-pixel"],
5
5
  "main": "./main.js",
6
6
  "license": "MIT",