@fractalpay/fractalpay-next-dev 0.0.289 → 0.0.290

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.289",
42
+ version: "0.0.290",
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), {
@@ -10184,8 +10185,13 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10184
10185
  return Object.keys(errors).length > 0;
10185
10186
  };
10186
10187
  const completeFractalFlow = async (tokenizeData, intentid, typeoftoken) => {
10187
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
10188
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
10188
10189
  try {
10190
+ console.log({
10191
+ tokenizeData,
10192
+ intentid,
10193
+ typeoftoken
10194
+ });
10189
10195
  if (typeoftoken == "google_pay" || typeoftoken == "apple_pay") {
10190
10196
  handleCharge({
10191
10197
  Token: tokenizeData,
@@ -10193,39 +10199,28 @@ var ModelContentSky = ({ amount, bankAmount, submitBtnText = "Pay", session_toke
10193
10199
  typeoftoken
10194
10200
  });
10195
10201
  return;
10196
- }
10197
- let token = tokenizeData;
10198
- let verifyandsaveresp = await axios9.post(`${masterBaseUrl}api/v1/gateway/verify-and-save/${session_token}`, {
10199
- token,
10200
- require3ds,
10201
- pass_fee,
10202
- typeoftoken
10203
- });
10204
- if ((verifyandsaveresp == null ? void 0 : verifyandsaveresp.status) == 200) {
10205
- let responsetemp = (_a2 = verifyandsaveresp == null ? void 0 : verifyandsaveresp.data) == null ? void 0 : _a2.data;
10206
- let respData = {
10207
- Token: responsetemp.gateway_token,
10208
- Brand: responsetemp.card_data.brand,
10209
- ExpirationMonth: responsetemp.card_data.expire_mm,
10210
- ExpirationYear: responsetemp.card_data.expire_yy,
10211
- Last4: responsetemp.card_data.last4,
10212
- Bin: responsetemp.card_data.bin,
10213
- postalCode: cardData == null ? void 0 : cardData.zipCode,
10214
- stripe_3ds_auth_id: intentid
10215
- };
10202
+ } else {
10216
10203
  if (isPreAuth) {
10217
- handlePreAuth(respData);
10204
+ handlePreAuth({
10205
+ Token: tokenizeData,
10206
+ postalCode: cardData == null ? void 0 : cardData.zipCode,
10207
+ typeoftoken: "token"
10208
+ });
10218
10209
  } else {
10219
- handleCharge(respData);
10210
+ handleCharge(__spreadValues({
10211
+ Token: tokenizeData,
10212
+ postalCode: cardData == null ? void 0 : cardData.zipCode,
10213
+ typeoftoken: "token"
10214
+ }, intentid && { stripe_3ds_auth_id: intentid }));
10220
10215
  }
10221
10216
  }
10222
10217
  } catch (error2) {
10223
10218
  console.log(error2, "error");
10224
- setError(((_c2 = (_b2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _b2.data) == null ? void 0 : _c2.message) || "Something went wrong!");
10219
+ setError(((_b2 = (_a2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "Something went wrong!");
10225
10220
  callback({
10226
- error: ((_e2 = (_d2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _d2.data) == null ? void 0 : _e2.message) || "Something went wrong!",
10227
- result: (_g2 = (_f2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _f2.data) == null ? void 0 : _g2.result,
10228
- statusCode: (_h2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _h2.status
10221
+ error: ((_d2 = (_c2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || "Something went wrong!",
10222
+ result: (_f2 = (_e2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _e2.data) == null ? void 0 : _f2.result,
10223
+ statusCode: (_g2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _g2.status
10229
10224
  });
10230
10225
  hideLoader();
10231
10226
  }