@fractalpay/fractalpay-next-dev 0.0.238 → 0.0.240

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.js CHANGED
@@ -39,7 +39,7 @@ var require_package = __commonJS({
39
39
  "package.json"(exports, module) {
40
40
  module.exports = {
41
41
  name: "@fractalpay/fractalpay-next-dev",
42
- version: "0.0.238",
42
+ version: "0.0.240",
43
43
  private: false,
44
44
  type: "module",
45
45
  scripts: {
@@ -9385,11 +9385,7 @@ padding:0px !important;
9385
9385
 
9386
9386
 
9387
9387
  .toggle-num-wrapper-new div#card_number {
9388
- padding: 0px 10px;
9389
9388
  display: block !important;
9390
- }
9391
- .toggle-num-wrapper-new .card-crdi.card-expiry-new {
9392
- padding: 0px 10px;
9393
9389
  }
9394
9390
  .toggle-num-wrapper-new .input-main-wrap-frac {
9395
9391
  height: 36px;
@@ -9966,7 +9962,7 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
9966
9962
  }
9967
9963
  };
9968
9964
  const handleFractalTokenFlow = async () => {
9969
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v, _w;
9965
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v, _w, _x, _y, _z, _A;
9970
9966
  try {
9971
9967
  const requestOptions = {
9972
9968
  method: "POST",
@@ -10007,17 +10003,28 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10007
10003
  three_ds_data
10008
10004
  );
10009
10005
  } catch (error2) {
10010
- setErrorIframe(error2);
10006
+ let readableMessage = "Something went wrong!";
10007
+ try {
10008
+ const rawError = ((_n2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _n2.data) || (error2 == null ? void 0 : error2.message) || "";
10009
+ const errorText = typeof rawError === "string" ? rawError : JSON.stringify(rawError);
10010
+ const lines = ((_p2 = (_o2 = errorText.split) == null ? void 0 : _o2.call(errorText, "\n")) == null ? void 0 : _p2.filter(Boolean)) || [];
10011
+ const lastLine = lines.at(-1) || "";
10012
+ const parts = (_q2 = lastLine.split) == null ? void 0 : _q2.call(lastLine, ": ");
10013
+ readableMessage = (parts == null ? void 0 : parts.length) > 1 ? parts.pop().trim() : lastLine.trim() || readableMessage;
10014
+ } catch (e) {
10015
+ readableMessage = "Something went wrong!";
10016
+ }
10017
+ setErrorIframe(readableMessage);
10011
10018
  hideLoader();
10012
10019
  }
10013
10020
  if (tokenizeData == null ? void 0 : tokenizeData.token) {
10014
10021
  let ThreedsData = tokenizeData == null ? void 0 : tokenizeData.stripe_three_ds_response;
10015
- if (require3ds && !ThreedsData && (ThreedsData == null ? void 0 : ThreedsData.status) === "200 OK" && ((_n2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _n2.challenge_url)) {
10022
+ if (require3ds && !ThreedsData && (ThreedsData == null ? void 0 : ThreedsData.status) === "200 OK" && ((_r2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _r2.challenge_url)) {
10016
10023
  setError("Something went wrong. Please try again later.");
10017
10024
  }
10018
10025
  if (require3ds) {
10019
- if (!((_o2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _o2.challenge_url)) {
10020
- completeFractalFlow(tokenizeData == null ? void 0 : tokenizeData.token, (_p2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _p2.id);
10026
+ if (!((_s2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _s2.challenge_url)) {
10027
+ completeFractalFlow(tokenizeData == null ? void 0 : tokenizeData.token, (_t2 = ThreedsData == null ? void 0 : ThreedsData.data) == null ? void 0 : _t2.id);
10021
10028
  } else {
10022
10029
  hideLoader();
10023
10030
  setStripeResponse(__spreadProps(__spreadValues({}, ThreedsData == null ? void 0 : ThreedsData.data), {
@@ -10033,11 +10040,11 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10033
10040
  console.log(error2, "error");
10034
10041
  let readableMessage = "Something went wrong!";
10035
10042
  try {
10036
- const rawError = ((_q2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _q2.data) || (error2 == null ? void 0 : error2.message) || "";
10043
+ const rawError = ((_u2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _u2.data) || (error2 == null ? void 0 : error2.message) || "";
10037
10044
  const errorText = typeof rawError === "string" ? rawError : JSON.stringify(rawError);
10038
- const lines = ((_s2 = (_r2 = errorText.split) == null ? void 0 : _r2.call(errorText, "\n")) == null ? void 0 : _s2.filter(Boolean)) || [];
10045
+ const lines = ((_w = (_v = errorText.split) == null ? void 0 : _v.call(errorText, "\n")) == null ? void 0 : _w.filter(Boolean)) || [];
10039
10046
  const lastLine = lines.at(-1) || "";
10040
- const parts = (_t2 = lastLine.split) == null ? void 0 : _t2.call(lastLine, ": ");
10047
+ const parts = (_x = lastLine.split) == null ? void 0 : _x.call(lastLine, ": ");
10041
10048
  readableMessage = (parts == null ? void 0 : parts.length) > 1 ? parts.pop().trim() : lastLine.trim() || readableMessage;
10042
10049
  } catch (e) {
10043
10050
  readableMessage = "Something went wrong!";
@@ -10045,8 +10052,8 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10045
10052
  setError(readableMessage);
10046
10053
  callback({
10047
10054
  error: readableMessage,
10048
- result: (_v = (_u2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _u2.data) == null ? void 0 : _v.result,
10049
- statusCode: (_w = error2 == null ? void 0 : error2.response) == null ? void 0 : _w.status
10055
+ result: (_z = (_y = error2 == null ? void 0 : error2.response) == null ? void 0 : _y.data) == null ? void 0 : _z.result,
10056
+ statusCode: (_A = error2 == null ? void 0 : error2.response) == null ? void 0 : _A.status
10050
10057
  });
10051
10058
  }
10052
10059
  };