@fractalpay/fractalpay-next-dev 0.0.285 → 0.0.286

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.285",
42
+ version: "0.0.286",
43
43
  private: false,
44
44
  type: "module",
45
45
  scripts: {
@@ -212,6 +212,21 @@ var LoaderStyle = (props) => {
212
212
  }
213
213
  }
214
214
 
215
+
216
+ .loader-text {
217
+ margin-top: 8px;
218
+ color: #1A1226;
219
+ text-transform: uppercase;
220
+ font-weight: 600;
221
+ font-family: 'IBM Plex Mono', monospace;
222
+ }
223
+
224
+ .loader-content {
225
+ display: flex;
226
+ flex-direction: column;
227
+ align-items: center;
228
+ }
229
+
215
230
  ` });
216
231
  };
217
232
  var LoaderStyle_default = LoaderStyle;
@@ -219,14 +234,17 @@ var LoaderStyle_default = LoaderStyle;
219
234
  // src/app/components/Loader/Loader.tsx
220
235
  import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
221
236
  var Loader = (_a) => {
222
- var _b = _a, { intensity = "light" } = _b, props = __objRest(_b, ["intensity"]);
237
+ var _b = _a, { intensity = "light", loaderText } = _b, props = __objRest(_b, ["intensity", "loaderText"]);
223
238
  return /* @__PURE__ */ jsxs(Fragment, { children: [
224
239
  /* @__PURE__ */ jsx2(LoaderStyle_default, {}),
225
- (props == null ? void 0 : props.loading) && /* @__PURE__ */ jsx2("div", { className: `loader-${intensity}`, children: /* @__PURE__ */ jsxs("div", { className: "lds-ellipsis", children: [
226
- /* @__PURE__ */ jsx2("div", {}),
227
- /* @__PURE__ */ jsx2("div", {}),
228
- /* @__PURE__ */ jsx2("div", {}),
229
- /* @__PURE__ */ jsx2("div", {})
240
+ (props == null ? void 0 : props.loading) && /* @__PURE__ */ jsx2("div", { className: `loader-${intensity}`, children: /* @__PURE__ */ jsxs("div", { className: "loader-content", children: [
241
+ /* @__PURE__ */ jsxs("div", { className: "lds-ellipsis", children: [
242
+ /* @__PURE__ */ jsx2("div", {}),
243
+ /* @__PURE__ */ jsx2("div", {}),
244
+ /* @__PURE__ */ jsx2("div", {}),
245
+ /* @__PURE__ */ jsx2("div", {})
246
+ ] }),
247
+ loaderText && /* @__PURE__ */ jsx2("div", { className: "loader-text", children: loaderText })
230
248
  ] }) })
231
249
  ] });
232
250
  };
@@ -236,8 +254,8 @@ var Loader_default = Loader;
236
254
  var { name } = require_package();
237
255
  var S3Url = "https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/";
238
256
  if (name === "@fractalpay/fractalpay-next-dev") {
239
- masterBaseUrl = "https://api.dev.fractalpay.com/";
240
- baseUrl = "https://widget.dev.fractalpay.com/";
257
+ baseUrl = "http://localhost:8082/";
258
+ masterBaseUrl = "http://localhost:8081/";
241
259
  fractalGatewayUrl = "https://api-dev.merchant-trends.com/";
242
260
  datacapUrl = "https://token-cert.dcap.com/v1/client";
243
261
  threedsSecurePublicKey = "pk_test_51RH5Wc2SlJvyNZ80hpUDy88r4rVdpijfKbNaWaUyQEE6rOrPmG2JQyAj7G5amBD5z5daC56WaeT4jfNhrrPcGOEP00UyKu6AOw";
@@ -2473,6 +2491,22 @@ position:relative;
2473
2491
  color: #c62828 !important;
2474
2492
  }
2475
2493
 
2494
+ .surcharge-program-notice-text{
2495
+ margin: 10px 0 4px;
2496
+ padding: 8px 12px;
2497
+ background: #f6f6f7;
2498
+ border-radius: 8px;
2499
+ font-family: 'Inter', sans-serif;
2500
+ font-size: 12px;
2501
+ color: #727272;
2502
+ line-height: 1.5;
2503
+ }
2504
+
2505
+ .surcharge-program-notice-text-att {
2506
+ font-weight: 700;
2507
+ color: #161616;
2508
+ }
2509
+
2476
2510
  ` });
2477
2511
  }
2478
2512
 
@@ -2677,7 +2711,17 @@ function SuccessMszStyle() {
2677
2711
  gap: 6px;
2678
2712
  background-color: #161616;
2679
2713
  color: #fff;
2680
- }` });
2714
+ }
2715
+
2716
+
2717
+ #receipt-debit-note {
2718
+ font-family: 'Inter', sans-serif;
2719
+ font-size: 11px;
2720
+ color: #49B182;
2721
+ margin-top: 2px;
2722
+ }
2723
+
2724
+ ` });
2681
2725
  }
2682
2726
 
2683
2727
  // src/app/components/SuccessMessage/HandleSubmit.tsx
@@ -2701,7 +2745,7 @@ function HandleSubmit(event, key, tranId) {
2701
2745
 
2702
2746
  // src/app/components/SuccessMessage/SuccessMsz.tsx
2703
2747
  import { Fragment as Fragment5, jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
2704
- function SuccessMsz({ onClose, tranId }) {
2748
+ function SuccessMsz({ onClose, tranId, isDebitAdjusted = false }) {
2705
2749
  return /* @__PURE__ */ jsxs5(Fragment5, { children: [
2706
2750
  /* @__PURE__ */ jsx10(SuccessMszStyle, {}),
2707
2751
  /* @__PURE__ */ jsxs5("div", { className: "payment-msg-container", children: [
@@ -2728,7 +2772,20 @@ function SuccessMsz({ onClose, tranId }) {
2728
2772
  /* @__PURE__ */ jsx10("br", {}),
2729
2773
  "was successful"
2730
2774
  ] }),
2731
- /* @__PURE__ */ jsx10("h6", { className: "charge-payment-success-subtext", children: "We\u2019ve processed your charge" }),
2775
+ /* @__PURE__ */ jsxs5("h6", { className: "charge-payment-success-subtext", children: [
2776
+ "We\u2019ve processed your charge",
2777
+ isDebitAdjusted && /* @__PURE__ */ jsxs5(Fragment5, { children: [
2778
+ /* @__PURE__ */ jsx10("br", {}),
2779
+ /* @__PURE__ */ jsx10(
2780
+ "span",
2781
+ {
2782
+ id: "receipt-debit-note",
2783
+ className: "charge-payment-success-subtext",
2784
+ children: "No surcharge \u2014 debit card"
2785
+ }
2786
+ )
2787
+ ] })
2788
+ ] }),
2732
2789
  /* @__PURE__ */ jsxs5("div", { className: "charge-success-payment-button-div", children: [
2733
2790
  /* @__PURE__ */ jsxs5("button", { className: "charge-success-btn1", onClick: (e) => HandleSubmit(e, "print", tranId), children: [
2734
2791
  /* @__PURE__ */ jsxs5(
@@ -3590,6 +3647,7 @@ function GetPaymentPage(props) {
3590
3647
  const [errorBankConsent, setErrorBankConsent] = useState4("");
3591
3648
  const [saveACHConsent1, setSaveACHConsent1] = useState4(false);
3592
3649
  const [errorBankConsentOther, setErrorBankConsentOther] = useState4("");
3650
+ const [loaderText, setLoderText] = useState4("");
3593
3651
  const fractalpayClientKey = props.merchantPublicKey;
3594
3652
  let mastercard2 = S3Url + "widget/mc-img.svg";
3595
3653
  let visa2 = S3Url + "widget/visa-img.svg";
@@ -3614,6 +3672,7 @@ function GetPaymentPage(props) {
3614
3672
  const [bankFeeAmount, setBankFeeAmount] = useState4(0);
3615
3673
  const [paymentData, setPaymentData] = useState4();
3616
3674
  let [tranId, setTranId] = useState4("");
3675
+ let [isDebitAdjusted, setIsDebitAdjusted] = useState4(false);
3617
3676
  const tokenizerRef = useRef3(null);
3618
3677
  const fractalStyles = {
3619
3678
  input: {
@@ -3733,6 +3792,8 @@ function GetPaymentPage(props) {
3733
3792
  setErrorBankConsent("");
3734
3793
  setSaveACHConsent1(false);
3735
3794
  setErrorBankConsentOther("");
3795
+ setLoderText("");
3796
+ setIsDebitAdjusted(false);
3736
3797
  };
3737
3798
  const handleShow = () => setShow(true);
3738
3799
  const handletabchange = (id) => {
@@ -3842,7 +3903,7 @@ function GetPaymentPage(props) {
3842
3903
  return Object.keys(errors).length > 0;
3843
3904
  };
3844
3905
  const submitFunc = async (e) => {
3845
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2;
3906
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2;
3846
3907
  e.preventDefault();
3847
3908
  const el = document.activeElement;
3848
3909
  if (el instanceof HTMLElement) {
@@ -3930,15 +3991,20 @@ function GetPaymentPage(props) {
3930
3991
  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
3992
  setLoading2(false);
3932
3993
  }
3994
+ const card_issue_type = ((_i2 = tokenizeData == null ? void 0 : tokenizeData.bin_lookup_result) == null ? void 0 : _i2.card_issue_type) || null;
3995
+ if (card_issue_type === "Debit" && (props == null ? void 0 : props.pass_fee)) {
3996
+ setLoderText("Processing Debit card without fee");
3997
+ }
3933
3998
  console.log(tokenizeData, "tokenizeData");
3934
3999
  const reqData = JSON.stringify(__spreadProps(__spreadValues({}, tokenizeData), {
3935
4000
  isSaveCardChecked: saveCardInfo,
3936
4001
  name: cardData == null ? void 0 : cardData.cardName,
3937
4002
  postal_code: cardData == null ? void 0 : cardData.zipCode,
3938
- customer_id: props == null ? void 0 : props.customerId
4003
+ customer_id: props == null ? void 0 : props.customerId,
4004
+ card_issue_type
3939
4005
  }));
3940
4006
  const reqData2 = JSON.stringify({
3941
- "pre_sales_id": `${(_j2 = (_i2 = result == null ? void 0 : result.data) == null ? void 0 : _i2.data) == null ? void 0 : _j2.posSalesIdEncode}`,
4007
+ "pre_sales_id": `${(_k2 = (_j2 = result == null ? void 0 : result.data) == null ? void 0 : _j2.data) == null ? void 0 : _k2.posSalesIdEncode}`,
3942
4008
  "token": `${tokenizeData == null ? void 0 : tokenizeData.token}`,
3943
4009
  "json_response": `${reqData}`
3944
4010
  });
@@ -3954,11 +4020,13 @@ function GetPaymentPage(props) {
3954
4020
  };
3955
4021
  socketClient_default.emit("sendMessage", requestOptions2);
3956
4022
  socketClient_default.on("chargeviafractalgateway", (data) => {
3957
- var _a3;
4023
+ var _a3, _b3;
3958
4024
  if (isValidJson(data == null ? void 0 : data.data)) {
3959
4025
  let paymentRes = JSON.parse(data == null ? void 0 : data.data);
4026
+ console.log(paymentRes, "paymentRes");
3960
4027
  if (paymentRes == null ? void 0 : paymentRes.result) {
3961
4028
  setTranId((_a3 = paymentRes == null ? void 0 : paymentRes.data) == null ? void 0 : _a3.transactionId);
4029
+ setIsDebitAdjusted((_b3 = paymentRes == null ? void 0 : paymentRes.data) == null ? void 0 : _b3.is_debit_adjusted);
3962
4030
  setSuccess(true);
3963
4031
  setLoading2(false);
3964
4032
  } else {
@@ -3971,11 +4039,11 @@ function GetPaymentPage(props) {
3971
4039
  });
3972
4040
  } catch (err) {
3973
4041
  setLoading2(false);
3974
- setError(((_l2 = (_k2 = err == null ? void 0 : err.response) == null ? void 0 : _k2.data) == null ? void 0 : _l2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
4042
+ setError(((_m2 = (_l2 = err == null ? void 0 : err.response) == null ? void 0 : _l2.data) == null ? void 0 : _m2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
3975
4043
  }
3976
4044
  } catch (err) {
3977
4045
  setLoading2(false);
3978
- setError(((_n2 = (_m2 = err == null ? void 0 : err.response) == null ? void 0 : _m2.data) == null ? void 0 : _n2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
4046
+ setError(((_o2 = (_n2 = err == null ? void 0 : err.response) == null ? void 0 : _n2.data) == null ? void 0 : _o2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
3979
4047
  }
3980
4048
  } else {
3981
4049
  try {
@@ -3993,7 +4061,7 @@ function GetPaymentPage(props) {
3993
4061
  }
3994
4062
  } catch (err) {
3995
4063
  setLoading2(false);
3996
- setError(((_p2 = (_o2 = err == null ? void 0 : err.response) == null ? void 0 : _o2.data) == null ? void 0 : _p2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
4064
+ setError(((_q2 = (_p2 = err == null ? void 0 : err.response) == null ? void 0 : _p2.data) == null ? void 0 : _q2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
3997
4065
  }
3998
4066
  }
3999
4067
  }
@@ -4086,6 +4154,7 @@ function GetPaymentPage(props) {
4086
4154
  }
4087
4155
  };
4088
4156
  const handlechargeCustomer = async (e) => {
4157
+ var _a2, _b2;
4089
4158
  e.currentTarget.blur();
4090
4159
  if (loading2) return;
4091
4160
  let customer_id = props == null ? void 0 : props.customerId;
@@ -4097,10 +4166,32 @@ function GetPaymentPage(props) {
4097
4166
  let amount = String(props == null ? void 0 : props.amount);
4098
4167
  let card_id = selectedCard == null ? void 0 : selectedCard.id;
4099
4168
  let card_type = selectedCard == null ? void 0 : selectedCard.card_type;
4169
+ let card_issue_type = selectedCard == null ? void 0 : selectedCard.card_issue_type;
4100
4170
  if (fractalpayPublicKey && order_id && amount && bankAmount) {
4101
4171
  if (customer_id) {
4102
4172
  if (card_id) {
4103
- let chargeobj = __spreadValues({
4173
+ setLoading2(true);
4174
+ if (card_issue_type == "Debit" && (props == null ? void 0 : props.pass_fee)) {
4175
+ setLoderText("Processing Debit card without fee");
4176
+ }
4177
+ let resultofOrderCreate;
4178
+ if (!(card_type === "Bank")) {
4179
+ const formData = {
4180
+ amount: `${props.amount || 0}`,
4181
+ fractalpayPublicKey: fractalpayClientKey,
4182
+ orderId: props == null ? void 0 : props.orderID,
4183
+ customer_id: props == null ? void 0 : props.customerId,
4184
+ discount: props == null ? void 0 : props.discount,
4185
+ surcharge: props == null ? void 0 : props.surcharge,
4186
+ tax: props == null ? void 0 : props.tax,
4187
+ pass_fee: props == null ? void 0 : props.pass_fee
4188
+ };
4189
+ resultofOrderCreate = await axios3.post(`${baseUrl}create-widget-order`, formData, {
4190
+ headers: __spreadValues({}, (props == null ? void 0 : props.sessionToken) && { "X-Session-Token": props.sessionToken })
4191
+ });
4192
+ console.log(resultofOrderCreate, "vfndsjkfvhg", resultofOrderCreate == null ? void 0 : resultofOrderCreate.data.data.posSalesIdEncode);
4193
+ }
4194
+ let chargeobj = __spreadValues(__spreadValues({
4104
4195
  amount: card_type === "Bank" ? `${bankAmount}` : amount,
4105
4196
  order_id,
4106
4197
  customer_id,
@@ -4112,19 +4203,19 @@ function GetPaymentPage(props) {
4112
4203
  tax,
4113
4204
  pass_fee: props == null ? void 0 : props.pass_fee,
4114
4205
  require3ds: false
4115
- }, (props == null ? void 0 : props.sessionToken) && { sessionToken: props.sessionToken });
4116
- let _a2 = chargeobj, { isCardSave, pass_fee, require3ds } = _a2, rest = __objRest(_a2, ["isCardSave", "pass_fee", "require3ds"]);
4206
+ }, (props == null ? void 0 : props.sessionToken) && { sessionToken: props.sessionToken }), ((_b2 = (_a2 = resultofOrderCreate == null ? void 0 : resultofOrderCreate.data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.posSalesIdEncode) && { enOrderId: resultofOrderCreate == null ? void 0 : resultofOrderCreate.data.data.posSalesIdEncode });
4207
+ let _c2 = chargeobj, { isCardSave, pass_fee, require3ds } = _c2, rest = __objRest(_c2, ["isCardSave", "pass_fee", "require3ds"]);
4117
4208
  let endpoint = card_type === "Bank" ? "charge-ach" : "charge-by-card";
4118
4209
  let chargeurl = baseUrl + endpoint;
4119
4210
  const headers = {
4120
4211
  "Content-Type": "application/json"
4121
4212
  };
4122
- setLoading2(true);
4123
4213
  socketClient_default.emit("sendMessage", { url: chargeurl, body: card_type == "Bank" ? rest : chargeobj, isChargebycard: true });
4124
4214
  socketClient_default.on("charge-by-card", (response) => {
4125
- var _a3;
4215
+ var _a3, _b3;
4126
4216
  if ((response == null ? void 0 : response.result) == true || (response == null ? void 0 : response.status) == true) {
4127
- setTranId((_a3 = response.data) == null ? void 0 : _a3.transaction_id);
4217
+ setIsDebitAdjusted((_a3 = response.data) == null ? void 0 : _a3.adjustedForDebit);
4218
+ setTranId((_b3 = response.data) == null ? void 0 : _b3.transaction_id);
4128
4219
  setSuccess(true);
4129
4220
  setLoading2(false);
4130
4221
  } else {
@@ -4316,9 +4407,9 @@ function GetPaymentPage(props) {
4316
4407
  errorIframe && /* @__PURE__ */ jsx19("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx19(ErrorCardMessage_default, { error: errorIframe, onClose: () => {
4317
4408
  setErrorIframe("");
4318
4409
  } }) }),
4319
- success && /* @__PURE__ */ jsx19(SuccessMsz, { onClose: handleClose, tranId }),
4410
+ success && /* @__PURE__ */ jsx19(SuccessMsz, { onClose: handleClose, tranId, isDebitAdjusted }),
4320
4411
  !error && !errorIframe && !success && /* @__PURE__ */ jsxs11(Fragment11, { children: [
4321
- (loading || loading2 || loadingIframe) && /* @__PURE__ */ jsx19(Loader_default, { loading: loading || loading2 || loadingIframe }),
4412
+ (loading || loading2 || loadingIframe) && /* @__PURE__ */ jsx19(Loader_default, { loading: loading || loading2 || loadingIframe, loaderText }),
4322
4413
  /* @__PURE__ */ jsx19("div", { className: "frac-card-payment-page frac-form", children: /* @__PURE__ */ jsxs11("div", { className: "parent-pay-container", children: [
4323
4414
  /* @__PURE__ */ jsx19("span", { className: "request-payment-close-popup", onClick: handleClose, children: /* @__PURE__ */ jsxs11("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
4324
4415
  /* @__PURE__ */ jsx19("g", { clipPath: "url(#clip0_12425_52336)", children: /* @__PURE__ */ jsx19("path", { d: "M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z", fill: "#727272" }) }),
@@ -4337,23 +4428,44 @@ function GetPaymentPage(props) {
4337
4428
  ] })
4338
4429
  ] }),
4339
4430
  /* @__PURE__ */ jsxs11("div", { className: "amt-pay-con", children: [
4340
- /* @__PURE__ */ jsx19("div", { className: "pay-amount-conatiner", children: /* @__PURE__ */ jsx19("small", { className: "pay-payment-amount", children: "Select paymet type" }) }),
4431
+ /* @__PURE__ */ jsx19("div", { className: "pay-amount-conatiner", children: /* @__PURE__ */ jsx19("small", { className: "pay-payment-amount", children: "Select payment type" }) }),
4341
4432
  /* @__PURE__ */ jsxs11("div", { className: "frac-card-bank-radio-main", children: [
4342
4433
  /* @__PURE__ */ jsx19(CardBankRadio, { label: "Card", amount: (_a = Number(props == null ? void 0 : props.amount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }),
4343
4434
  (paymentData == null ? void 0 : paymentData.isSkyFiAccount) && /* @__PURE__ */ jsx19(CardBankRadio, { label: "Bank", amount: (_b = Number(bankAmount)) == null ? void 0 : _b.toFixed(2), value: "ach", onChange: handletabchange, activetab }),
4344
4435
  (props == null ? void 0 : props.isReader) && (paymentData == null ? void 0 : paymentData.paymentDeviceList) && ((_c = paymentData == null ? void 0 : paymentData.paymentDeviceList) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ jsx19(CardBankRadio, { label: "Reader", amount: (_d = Number(props == null ? void 0 : props.amount)) == null ? void 0 : _d.toFixed(2), value: "reader", onChange: handletabchange, activetab })
4345
4436
  ] }),
4346
- !loading && /* @__PURE__ */ jsxs11("div", { className: "", children: [
4437
+ !loading && (activetab === "card" || activetab === "reader") && (props == null ? void 0 : props.pass_fee) && cashDiscount && cashDiscount > 0 && /* @__PURE__ */ jsxs11("div", { className: "frac-cash-discount-fee", children: [
4438
+ /* @__PURE__ */ jsx19("small", { children: (paymentData == null ? void 0 : paymentData.surchargeProgram) == 1 ? "Surcharge" : (paymentData == null ? void 0 : paymentData.showSurcharge) ? "3% Card Fee" : "Cash Discount" }),
4439
+ /* @__PURE__ */ jsx19("p", { children: formatUSD((Number(props.amount) - cashDiscount).toFixed(2)) })
4440
+ ] }),
4441
+ !loading && activetab === "ach" && (props == null ? void 0 : props.pass_fee) && cashDiscount && cashDiscount > 0 && /* @__PURE__ */ jsxs11("div", { className: "frac-cash-discount-fee", children: [
4442
+ /* @__PURE__ */ jsx19("small", { children: (paymentData == null ? void 0 : paymentData.surchargeProgram) == 1 ? "Savings" : "Cash Discount Savings" }),
4443
+ /* @__PURE__ */ jsx19("p", { children: formatUSD((Number(props.amount) - cashDiscount).toFixed(2)) })
4444
+ ] }),
4445
+ !loading && (props == null ? void 0 : props.pass_fee) && /* @__PURE__ */ jsxs11("div", { className: "", children: [
4347
4446
  activetab == "ach" && bankFeeAmount > 0 && /* @__PURE__ */ jsxs11("small", { className: "frac-fee-text", children: [
4348
4447
  "There is a processing fee of ",
4349
4448
  /* @__PURE__ */ jsx19("span", { className: "frac-fee-amount", children: formatUSD(bankFeeAmount.toFixed(2)) }),
4350
4449
  "."
4351
4450
  ] }),
4352
- (activetab === "card" || activetab === "reader") && (props == null ? void 0 : props.pass_fee) && cashDiscount && cashDiscount > 0 && /* @__PURE__ */ jsxs11("small", { className: "frac-fee-text", children: [
4353
- "Cards include a fee amount of ",
4354
- /* @__PURE__ */ jsx19("span", { className: "frac-fee-amount", children: formatUSD((Number(props.amount) - cashDiscount).toFixed(2)) }),
4355
- "."
4356
- ] })
4451
+ (activetab === "card" || activetab === "reader") && (props == null ? void 0 : props.pass_fee) && cashDiscount && cashDiscount > 0 && /* @__PURE__ */ jsxs11(
4452
+ "div",
4453
+ {
4454
+ id: "surcharge-program-notice",
4455
+ className: "surcharge-program-notice-text",
4456
+ children: [
4457
+ "A 3% processing surcharge is applied to all credit card transactions. Debit card payments are processed for",
4458
+ " ",
4459
+ /* @__PURE__ */ jsxs11("span", { className: "surcharge-program-notice-text-att", children: [
4460
+ "$",
4461
+ Number(cashDiscount).toLocaleString("en-US", {
4462
+ minimumFractionDigits: 2,
4463
+ maximumFractionDigits: 2
4464
+ })
4465
+ ] })
4466
+ ]
4467
+ }
4468
+ )
4357
4469
  ] })
4358
4470
  ] })
4359
4471
  ] }),
@@ -5424,7 +5536,7 @@ function PreAuthPayment(_a) {
5424
5536
  /* @__PURE__ */ jsxs12("div", { className: "pay-conatiner-one-first", children: [
5425
5537
  /* @__PURE__ */ jsx20("div", { className: "pay-logo-container", children: /* @__PURE__ */ jsx20("div", { className: "pay-main-logo", children: /* @__PURE__ */ jsx20("img", { src: paymentData == null ? void 0 : paymentData.logo, id: "pay-logos" }) }) }),
5426
5538
  /* @__PURE__ */ jsxs12("div", { className: "amt-pay-con", children: [
5427
- /* @__PURE__ */ jsx20("div", { className: "pay-amount-conatiner", children: /* @__PURE__ */ jsx20("small", { className: "pay-payment-amount", children: "Select paymet type" }) }),
5539
+ /* @__PURE__ */ jsx20("div", { className: "pay-amount-conatiner", children: /* @__PURE__ */ jsx20("small", { className: "pay-payment-amount", children: "Select payment type" }) }),
5428
5540
  /* @__PURE__ */ jsxs12("div", { className: "frac-card-bank-radio-main", children: [
5429
5541
  /* @__PURE__ */ jsx20(CardBankRadio, { label: "Card", amount: (_a2 = Number(props == null ? void 0 : props.amount)) == null ? void 0 : _a2.toFixed(2), value: "card", onChange: handletabchange, activetab }),
5430
5542
  (props == null ? void 0 : props.isReader) && (paymentData == null ? void 0 : paymentData.paymentDeviceList) && ((_b2 = paymentData == null ? void 0 : paymentData.paymentDeviceList) == null ? void 0 : _b2.length) > 0 && /* @__PURE__ */ jsx20(CardBankRadio, { label: "Reader", amount: (_c = Number(props == null ? void 0 : props.amount)) == null ? void 0 : _c.toFixed(2), value: "reader", onChange: handletabchange, activetab })
@@ -7566,6 +7678,8 @@ function PartialPayment(props) {
7566
7678
  const [errorBankConsent, setErrorBankConsent] = useState8("");
7567
7679
  const [saveACHConsent1, setSaveACHConsent1] = useState8(false);
7568
7680
  const [errorBankConsentOther, setErrorBankConsentOther] = useState8("");
7681
+ const [loaderText, setLoderText] = useState8("");
7682
+ let [isDebitAdjusted, setIsDebitAdjusted] = useState8(false);
7569
7683
  const tokenizerRef = useRef8(null);
7570
7684
  const fractalStyles = {
7571
7685
  input: {
@@ -7681,6 +7795,7 @@ function PartialPayment(props) {
7681
7795
  setErrorBankConsent("");
7682
7796
  setSaveACHConsent1(false);
7683
7797
  setErrorBankConsentOther("");
7798
+ setLoderText("");
7684
7799
  };
7685
7800
  const handleShow = () => setShow(true);
7686
7801
  const handletabchange = (id) => {
@@ -7791,7 +7906,7 @@ function PartialPayment(props) {
7791
7906
  return Object.keys(errors).length > 0;
7792
7907
  };
7793
7908
  const submitFunc = async (e) => {
7794
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2;
7909
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2;
7795
7910
  e.preventDefault();
7796
7911
  const el = document.activeElement;
7797
7912
  if (el instanceof HTMLElement) {
@@ -7866,15 +7981,20 @@ function PartialPayment(props) {
7866
7981
  public_key_pem: ((_b2 = (_a2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.publicKeyPem) || ((_d2 = (_c2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _c2.data) == null ? void 0 : _d2.public_key_pem),
7867
7982
  session_key: (_f2 = (_e2 = sesionResult == null ? void 0 : sesionResult.data) == null ? void 0 : _e2.data) == null ? void 0 : _f2.session_key
7868
7983
  });
7984
+ const card_issue_type = ((_g2 = tokenizeData == null ? void 0 : tokenizeData.bin_lookup_result) == null ? void 0 : _g2.card_issue_type) || null;
7985
+ if (card_issue_type === "Debit" && (props == null ? void 0 : props.pass_fee)) {
7986
+ setLoderText("Processing Debit card without fee");
7987
+ }
7869
7988
  const reqData = JSON.stringify(__spreadProps(__spreadValues({}, tokenizeData), {
7870
7989
  isSaveCardChecked: saveCardInfo,
7871
7990
  name: cardData == null ? void 0 : cardData.cardName,
7872
7991
  postal_code: cardData == null ? void 0 : cardData.zipCode,
7873
7992
  customer_id: props == null ? void 0 : props.customerId,
7874
- partial_amount: partialAmount && !partialError ? partialAmount : aftertaxAmount
7993
+ partial_amount: partialAmount && !partialError ? partialAmount : aftertaxAmount,
7994
+ card_issue_type
7875
7995
  }));
7876
7996
  const reqData2 = JSON.stringify({
7877
- "pre_sales_id": `${(_g2 = paymentData == null ? void 0 : paymentData.orderDetails) == null ? void 0 : _g2.orderId}`,
7997
+ "pre_sales_id": `${(_h2 = paymentData == null ? void 0 : paymentData.orderDetails) == null ? void 0 : _h2.orderId}`,
7878
7998
  "token": `${tokenizeData == null ? void 0 : tokenizeData.token}`,
7879
7999
  "json_response": `${reqData}`
7880
8000
  });
@@ -7907,11 +8027,11 @@ function PartialPayment(props) {
7907
8027
  });
7908
8028
  } catch (err) {
7909
8029
  setLoading2(false);
7910
- setError(((_i2 = (_h2 = err == null ? void 0 : err.response) == null ? void 0 : _h2.data) == null ? void 0 : _i2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
8030
+ setError(((_j2 = (_i2 = err == null ? void 0 : err.response) == null ? void 0 : _i2.data) == null ? void 0 : _j2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
7911
8031
  }
7912
8032
  } catch (err) {
7913
8033
  setLoading2(false);
7914
- setError(((_k2 = (_j2 = err == null ? void 0 : err.response) == null ? void 0 : _j2.data) == null ? void 0 : _k2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
8034
+ setError(((_l2 = (_k2 = err == null ? void 0 : err.response) == null ? void 0 : _k2.data) == null ? void 0 : _l2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
7915
8035
  }
7916
8036
  } else {
7917
8037
  try {
@@ -7928,7 +8048,7 @@ function PartialPayment(props) {
7928
8048
  }
7929
8049
  } catch (err) {
7930
8050
  setLoading2(false);
7931
- setError(((_m2 = (_l2 = err == null ? void 0 : err.response) == null ? void 0 : _l2.data) == null ? void 0 : _m2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
8051
+ setError(((_n2 = (_m2 = err == null ? void 0 : err.response) == null ? void 0 : _m2.data) == null ? void 0 : _n2.message) || (err == null ? void 0 : err.message) || "Something went wrong.");
7932
8052
  }
7933
8053
  }
7934
8054
  }
@@ -8033,6 +8153,7 @@ function PartialPayment(props) {
8033
8153
  let amount = partialAmount && !partialError ? partialAmount : String(aftertaxAmount);
8034
8154
  let card_id = selectedCard == null ? void 0 : selectedCard.id;
8035
8155
  let card_type = selectedCard == null ? void 0 : selectedCard.card_type;
8156
+ let card_issue_type = selectedCard == null ? void 0 : selectedCard.card_issue_type;
8036
8157
  if (partialError) {
8037
8158
  return;
8038
8159
  }
@@ -8071,11 +8192,15 @@ function PartialPayment(props) {
8071
8192
  "Content-Type": "application/json"
8072
8193
  };
8073
8194
  setLoading2(true);
8195
+ if (card_issue_type == "Debit" && (props == null ? void 0 : props.pass_fee)) {
8196
+ setLoderText("Processing Debit card without fee");
8197
+ }
8074
8198
  socketClient_default.emit("sendMessage", { url: chargeurl, body: card_type == "Bank" ? rest : chargeobj, isChargebycard: true });
8075
8199
  socketClient_default.on("charge-by-card", (response) => {
8076
- var _a3;
8200
+ var _a3, _b2;
8077
8201
  if ((response == null ? void 0 : response.result) == true || (response == null ? void 0 : response.status) == true) {
8078
- setTranId((_a3 = response.data) == null ? void 0 : _a3.transaction_id);
8202
+ setIsDebitAdjusted((_a3 = response.data) == null ? void 0 : _a3.adjustedForDebit);
8203
+ setTranId((_b2 = response.data) == null ? void 0 : _b2.transaction_id);
8079
8204
  setSuccess(true);
8080
8205
  setLoading2(false);
8081
8206
  } else {
@@ -8293,9 +8418,9 @@ function PartialPayment(props) {
8293
8418
  errorIframe && /* @__PURE__ */ jsx28("div", { style: { maxHeight: "606px", minHeight: "60vh", padding: "40px" }, children: /* @__PURE__ */ jsx28(ErrorCardMessage_default, { error: errorIframe, onClose: () => {
8294
8419
  setErrorIframe("");
8295
8420
  } }) }),
8296
- success && /* @__PURE__ */ jsx28(SuccessMsz, { onClose: handleClose, tranId }),
8421
+ success && /* @__PURE__ */ jsx28(SuccessMsz, { onClose: handleClose, tranId, isDebitAdjusted }),
8297
8422
  !error && !success && !errorIframe && /* @__PURE__ */ jsxs17(Fragment17, { children: [
8298
- (loading || loading2 || loadingIframe) && /* @__PURE__ */ jsx28(Loader_default, { loading: loading || loading2 || loadingIframe }),
8423
+ (loading || loading2 || loadingIframe) && /* @__PURE__ */ jsx28(Loader_default, { loading: loading || loading2 || loadingIframe, loaderText }),
8299
8424
  /* @__PURE__ */ jsx28("div", { className: "frac-card-payment-page frac-form", children: /* @__PURE__ */ jsxs17("div", { className: "parent-pay-container", children: [
8300
8425
  /* @__PURE__ */ jsx28("span", { className: "request-payment-close-popup", onClick: handleClose, children: /* @__PURE__ */ jsxs17("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
8301
8426
  /* @__PURE__ */ jsx28("g", { clipPath: "url(#clip0_12425_52336)", children: /* @__PURE__ */ jsx28("path", { d: "M9.46585 8.01168L15.6959 1.7814C16.1014 1.37615 16.1014 0.720912 15.6959 0.315659C15.2907 -0.0895946 14.6354 -0.0895946 14.2302 0.315659L7.99991 6.54593L1.76983 0.315659C1.36438 -0.0895946 0.709336 -0.0895946 0.304082 0.315659C-0.101361 0.720912 -0.101361 1.37615 0.304082 1.7814L6.53416 8.01168L0.304082 14.2419C-0.101361 14.6472 -0.101361 15.3024 0.304082 15.7077C0.506045 15.9098 0.771595 16.0114 1.03695 16.0114C1.30232 16.0114 1.56768 15.9098 1.76983 15.7077L7.99991 9.47742L14.2302 15.7077C14.4323 15.9098 14.6977 16.0114 14.9631 16.0114C15.2284 16.0114 15.4938 15.9098 15.6959 15.7077C16.1014 15.3024 16.1014 14.6472 15.6959 14.2419L9.46585 8.01168Z", fill: "#727272" }) }),
@@ -8316,19 +8441,28 @@ function PartialPayment(props) {
8316
8441
  /* @__PURE__ */ jsxs17("div", { className: "amt-pay-con", children: [
8317
8442
  /* @__PURE__ */ jsx28("div", { className: "pay-amount-conatiner", children: /* @__PURE__ */ jsx28("small", { className: "pay-payment-amount", children: "Select payment type" }) }),
8318
8443
  /* @__PURE__ */ jsx28("div", { className: "frac-card-bank-radio-main", children: /* @__PURE__ */ jsx28(CardBankRadio, { label: "Card", amount: (_a = Number(aftertaxAmount)) == null ? void 0 : _a.toFixed(2), value: "card", onChange: handletabchange, activetab }) }),
8319
- numberToBoolean(paymentData == null ? void 0 : paymentData.showSurcharge) ? cashDiscount && cashDiscount > 0 && (props == null ? void 0 : props.pass_fee) ? /* @__PURE__ */ jsxs17("div", { className: "frac-cash-discount-fee", children: [
8320
- /* @__PURE__ */ jsxs17("small", { children: [
8321
- activetab === "card" ? "Cash Discount" : "Cash Discount Savings",
8322
- " "
8323
- ] }),
8324
- /* @__PURE__ */ jsx28("p", { children: formatUSD((Number(aftertaxAmount) - cashDiscount).toFixed(2)) })
8325
- ] }) : null : cashDiscount && cashDiscount > 0 && (props == null ? void 0 : props.pass_fee) && activetab === "card" ? /* @__PURE__ */ jsxs17("div", { className: "frac-cash-discount-fee", children: [
8326
- /* @__PURE__ */ jsxs17("small", { children: [
8327
- activetab === "card" ? "Surcharge" : null,
8328
- " "
8329
- ] }),
8330
- /* @__PURE__ */ jsx28("p", { children: formatUSD((Number(aftertaxAmount) - cashDiscount).toFixed(2)) })
8331
- ] }) : null,
8444
+ !loading && (activetab === "card" || activetab === "reader") && (props == null ? void 0 : props.pass_fee) && cashDiscount && cashDiscount > 0 && /* @__PURE__ */ jsxs17("div", { className: "frac-cash-discount-fee", children: [
8445
+ /* @__PURE__ */ jsx28("small", { children: (paymentData == null ? void 0 : paymentData.surchargeProgram) == 1 ? "Surcharge" : (paymentData == null ? void 0 : paymentData.showSurcharge) ? "3% Card Fee" : "Cash Discount" }),
8446
+ /* @__PURE__ */ jsx28("p", { children: formatUSD((Number(props.amount) - cashDiscount).toFixed(2)) })
8447
+ ] }),
8448
+ !loading && (props == null ? void 0 : props.pass_fee) && /* @__PURE__ */ jsx28("div", { className: "", children: (activetab === "card" || activetab === "reader") && (props == null ? void 0 : props.pass_fee) && cashDiscount && cashDiscount > 0 && /* @__PURE__ */ jsxs17(
8449
+ "div",
8450
+ {
8451
+ id: "surcharge-program-notice",
8452
+ className: "surcharge-program-notice-text",
8453
+ children: [
8454
+ "A 3% processing surcharge is applied to all credit card transactions. Debit card payments are processed for",
8455
+ " ",
8456
+ /* @__PURE__ */ jsxs17("span", { className: "surcharge-program-notice-text-att", children: [
8457
+ "$",
8458
+ Number(cashDiscount).toLocaleString("en-US", {
8459
+ minimumFractionDigits: 2,
8460
+ maximumFractionDigits: 2
8461
+ })
8462
+ ] })
8463
+ ]
8464
+ }
8465
+ ) }),
8332
8466
  (props == null ? void 0 : props.allowPartial) && /* @__PURE__ */ jsxs17("div", { className: "frac-partial-payment-input", children: [
8333
8467
  /* @__PURE__ */ jsx28("label", { htmlFor: "partialpayment", children: "Partial Payment" }),
8334
8468
  /* @__PURE__ */ jsx28(
@@ -9636,40 +9770,6 @@ padding:0px !important;
9636
9770
  width: 100%;
9637
9771
  }
9638
9772
 
9639
- .gpay-custom-btn {
9640
- height: 48px;
9641
- width: 100%;
9642
-
9643
- background-color: #000;
9644
- background-image: url("https://www.gstatic.com/instantbuy/svg/dark/pay/en.svg");
9645
- background-repeat: no-repeat;
9646
- background-position: center;
9647
- background-size: contain;
9648
-
9649
- border: none;
9650
- border-radius: 8px;
9651
- cursor: pointer;
9652
- }
9653
-
9654
- .gpay-custom-btn {
9655
- background-size: 120px auto; /* tweak 65%\u201375% for perfect match */
9656
- }
9657
-
9658
-
9659
- .gpay-custom-btn:hover {
9660
- opacity: 0.9;
9661
- }
9662
-
9663
- .gpay-custom-btn:active {
9664
- transform: scale(0.98);
9665
- }
9666
-
9667
-
9668
- .gpay-custom-btn:disabled {
9669
- opacity: 0.6;
9670
- cursor: not-allowed;
9671
- }
9672
-
9673
9773
 
9674
9774
  ` });
9675
9775
  }
@@ -9962,7 +10062,7 @@ var ErrorCardOverlay = ({ onClose, error, autoTrigger = false }) => {
9962
10062
  var ErrorCardOverlay_default = ErrorCardOverlay;
9963
10063
 
9964
10064
  // src/app/components/Atoms/Googlepay/Googlepay.tsx
9965
- import { useRef as useRef10, useState as useState10 } from "react";
10065
+ import { useRef as useRef10 } from "react";
9966
10066
 
9967
10067
  // src/app/components/Atoms/Googlepay/GooglePayScriptLoader.tsx
9968
10068
  import { useEffect as useEffect15 } from "react";
@@ -10012,8 +10112,8 @@ function GooglePayComponent({
10012
10112
  completeFractalFlow,
10013
10113
  setLoading
10014
10114
  }) {
10115
+ const containerRef = useRef10(null);
10015
10116
  const paymentsClientRef = useRef10(null);
10016
- const [isReady, setIsReady] = useState10(false);
10017
10117
  const baseRequest = {
10018
10118
  apiVersion: 2,
10019
10119
  apiVersionMinor: 0
@@ -10106,8 +10206,18 @@ function GooglePayComponent({
10106
10206
  const response = await client.isReadyToPay(
10107
10207
  getIsReadyToPayRequest()
10108
10208
  );
10109
- if (response.result) {
10110
- setIsReady(true);
10209
+ if (response.result && containerRef.current) {
10210
+ const button = client.createButton({
10211
+ onClick: onGooglePayClick,
10212
+ allowedPaymentMethods: [baseCardPaymentMethod],
10213
+ buttonType: "pay",
10214
+ buttonColor: "black",
10215
+ buttonRadius: 8
10216
+ });
10217
+ if (containerRef.current) {
10218
+ containerRef.current.innerHTML = "";
10219
+ }
10220
+ containerRef.current.appendChild(button);
10111
10221
  }
10112
10222
  } catch (err) {
10113
10223
  console.error("Google Pay init error:", err);
@@ -10137,14 +10247,7 @@ function GooglePayComponent({
10137
10247
  }, 0);
10138
10248
  };
10139
10249
  return /* @__PURE__ */ jsxs20(Fragment19, { children: [
10140
- isReady && /* @__PURE__ */ jsx34(
10141
- "button",
10142
- {
10143
- className: "gpay-custom-btn",
10144
- onClick: onGooglePayClick,
10145
- disabled: !amount
10146
- }
10147
- ),
10250
+ /* @__PURE__ */ jsx34("div", { ref: containerRef, className: "text-center" }),
10148
10251
  /* @__PURE__ */ jsx34(GooglePayScriptLoader, { onLoad: onScriptLoad })
10149
10252
  ] });
10150
10253
  }