@fractalpay/fractalpay-next-dev 0.0.274 → 0.0.276

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.274",
42
+ version: "0.0.276",
43
43
  private: false,
44
44
  type: "module",
45
45
  scripts: {
@@ -3929,6 +3929,7 @@ function GetPaymentPage(props) {
3929
3929
  } catch (err) {
3930
3930
  setErrorIframe(((_h2 = (_g2 = err == null ? void 0 : err.response) == null ? void 0 : _g2.data) == null ? void 0 : _h2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
3931
3931
  setLoading2(false);
3932
+ return;
3932
3933
  }
3933
3934
  console.log(tokenizeData, "tokenizeData");
3934
3935
  const reqData = JSON.stringify(__spreadProps(__spreadValues({}, tokenizeData), {
@@ -10511,8 +10512,13 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10511
10512
  return Object.keys(errors).length > 0;
10512
10513
  };
10513
10514
  const completeFractalFlow = async (tokenizeData, intentid, typeoftoken) => {
10514
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
10515
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
10515
10516
  try {
10517
+ console.log({
10518
+ tokenizeData,
10519
+ intentid,
10520
+ typeoftoken
10521
+ });
10516
10522
  if (typeoftoken == "google_pay" || typeoftoken == "apple_pay") {
10517
10523
  handleCharge({
10518
10524
  Token: tokenizeData,
@@ -10520,39 +10526,28 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10520
10526
  typeoftoken
10521
10527
  });
10522
10528
  return;
10523
- }
10524
- let token = tokenizeData;
10525
- let verifyandsaveresp = await axios9.post(`${masterBaseUrl}api/v1/gateway/verify-and-save/${session_token}`, {
10526
- token,
10527
- require3ds,
10528
- pass_fee,
10529
- typeoftoken
10530
- });
10531
- if ((verifyandsaveresp == null ? void 0 : verifyandsaveresp.status) == 200) {
10532
- let responsetemp = (_a2 = verifyandsaveresp == null ? void 0 : verifyandsaveresp.data) == null ? void 0 : _a2.data;
10533
- let respData = {
10534
- Token: responsetemp.gateway_token,
10535
- Brand: responsetemp.card_data.brand,
10536
- ExpirationMonth: responsetemp.card_data.expire_mm,
10537
- ExpirationYear: responsetemp.card_data.expire_yy,
10538
- Last4: responsetemp.card_data.last4,
10539
- Bin: responsetemp.card_data.bin,
10540
- postalCode: cardData == null ? void 0 : cardData.zipCode,
10541
- stripe_3ds_auth_id: intentid
10542
- };
10529
+ } else {
10543
10530
  if (isPreAuth) {
10544
- handlePreAuth(respData);
10531
+ handlePreAuth({
10532
+ Token: tokenizeData,
10533
+ postalCode: cardData == null ? void 0 : cardData.zipCode,
10534
+ typeoftoken: "token"
10535
+ });
10545
10536
  } else {
10546
- handleCharge(respData);
10537
+ handleCharge(__spreadValues({
10538
+ Token: tokenizeData,
10539
+ postalCode: cardData == null ? void 0 : cardData.zipCode,
10540
+ typeoftoken: "token"
10541
+ }, intentid && { stripe_3ds_auth_id: intentid }));
10547
10542
  }
10548
10543
  }
10549
10544
  } catch (error2) {
10550
10545
  console.log(error2, "error");
10551
- setError(((_c2 = (_b2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _b2.data) == null ? void 0 : _c2.message) || "Something went wrong!");
10546
+ setError(((_b2 = (_a2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "Something went wrong!");
10552
10547
  callback({
10553
- error: ((_e2 = (_d2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _d2.data) == null ? void 0 : _e2.message) || "Something went wrong!",
10554
- result: (_g2 = (_f2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _f2.data) == null ? void 0 : _g2.result,
10555
- statusCode: (_h2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _h2.status
10548
+ error: ((_d2 = (_c2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || "Something went wrong!",
10549
+ result: (_f2 = (_e2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _e2.data) == null ? void 0 : _f2.result,
10550
+ statusCode: (_g2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _g2.status
10556
10551
  });
10557
10552
  hideLoader();
10558
10553
  }