@pinerohit11/testwidget 0.1.88 → 0.1.90
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.d.mts +1 -8
- package/dist/index.d.ts +1 -8
- package/dist/index.js +68 -67
- package/dist/index.mjs +38 -36
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
@@ -48,11 +48,4 @@ type Props = {
|
|
48
48
|
};
|
49
49
|
declare function GetPaymentPage(props: Props): React.JSX.Element;
|
50
50
|
|
51
|
-
|
52
|
-
interface Window {
|
53
|
-
DatacapWebToken: any;
|
54
|
-
}
|
55
|
-
}
|
56
|
-
declare function DataScript(): null;
|
57
|
-
|
58
|
-
export { DataScript, GetPaymentPage, RequestPayment, RequestPreAuthPayment };
|
51
|
+
export { GetPaymentPage, RequestPayment, RequestPreAuthPayment };
|
package/dist/index.d.ts
CHANGED
@@ -48,11 +48,4 @@ type Props = {
|
|
48
48
|
};
|
49
49
|
declare function GetPaymentPage(props: Props): React.JSX.Element;
|
50
50
|
|
51
|
-
|
52
|
-
interface Window {
|
53
|
-
DatacapWebToken: any;
|
54
|
-
}
|
55
|
-
}
|
56
|
-
declare function DataScript(): null;
|
57
|
-
|
58
|
-
export { DataScript, GetPaymentPage, RequestPayment, RequestPreAuthPayment };
|
51
|
+
export { GetPaymentPage, RequestPayment, RequestPreAuthPayment };
|
package/dist/index.js
CHANGED
@@ -47,7 +47,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
47
47
|
// src/app/index.ts
|
48
48
|
var index_exports = {};
|
49
49
|
__export(index_exports, {
|
50
|
-
DataScript: () => DataScript,
|
51
50
|
GetPaymentPage: () => GetPaymentPage,
|
52
51
|
RequestPayment: () => RequestPayment,
|
53
52
|
RequestPreAuthPayment: () => RequestPreAuthPayment
|
@@ -1183,7 +1182,7 @@ function RequestPreAuthPayment(props) {
|
|
1183
1182
|
}
|
1184
1183
|
|
1185
1184
|
// src/app/components/Charge/GetPaymentPage.tsx
|
1186
|
-
var
|
1185
|
+
var import_react12 = __toESM(require("react"));
|
1187
1186
|
|
1188
1187
|
// src/app/components/Charge/Chargewidgetstyles.tsx
|
1189
1188
|
var import_react8 = __toESM(require("react"));
|
@@ -1635,7 +1634,8 @@ function Chargewidgetstyles() {
|
|
1635
1634
|
background: #FFF;
|
1636
1635
|
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
1637
1636
|
font-size:16px;
|
1638
|
-
curso:pointer
|
1637
|
+
curso:pointer;
|
1638
|
+
color:black
|
1639
1639
|
}
|
1640
1640
|
.btn {
|
1641
1641
|
padding: 11px 23px;
|
@@ -1941,20 +1941,55 @@ function SuccessMsz({ onClose }) {
|
|
1941
1941
|
// src/app/components/Charge/GetPaymentPage.tsx
|
1942
1942
|
var import_sweetalert2 = __toESM(require("sweetalert2"));
|
1943
1943
|
var import_io5 = require("react-icons/io5");
|
1944
|
+
|
1945
|
+
// src/app/components/Datascript.tsx
|
1946
|
+
var import_react11 = require("react");
|
1947
|
+
function DataScript() {
|
1948
|
+
(0, import_react11.useEffect)(() => {
|
1949
|
+
const src = "https://token-cert.dcap.com/v1/client";
|
1950
|
+
if (typeof window === "undefined") return;
|
1951
|
+
if (window.DatacapWebToken) {
|
1952
|
+
console.log("\u2705 Datacap already available");
|
1953
|
+
return;
|
1954
|
+
}
|
1955
|
+
if (!document.querySelector(`script[src="${src}"]`)) {
|
1956
|
+
const script = document.createElement("script");
|
1957
|
+
script.src = src;
|
1958
|
+
script.async = true;
|
1959
|
+
script.onload = () => {
|
1960
|
+
console.log("\u2705 Datacap script loaded");
|
1961
|
+
if (window.DatacapWebToken) {
|
1962
|
+
console.log("\u2705 DatacapWebToken is ready:", window.DatacapWebToken);
|
1963
|
+
} else {
|
1964
|
+
console.warn("\u26A0\uFE0F Script loaded, but DatacapWebToken not found");
|
1965
|
+
}
|
1966
|
+
};
|
1967
|
+
script.onerror = (err) => {
|
1968
|
+
console.error("\u274C Failed to load Datacap script", err);
|
1969
|
+
};
|
1970
|
+
document.head.appendChild(script);
|
1971
|
+
} else {
|
1972
|
+
console.log("\u2139\uFE0F Script already in DOM, waiting for Datacap...");
|
1973
|
+
}
|
1974
|
+
}, []);
|
1975
|
+
return null;
|
1976
|
+
}
|
1977
|
+
|
1978
|
+
// src/app/components/Charge/GetPaymentPage.tsx
|
1944
1979
|
function GetPaymentPage(props) {
|
1945
1980
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
1946
|
-
const [loading, setLoading] = (0,
|
1947
|
-
const [success, setSuccess] = (0,
|
1948
|
-
const [show, setShow] = (0,
|
1949
|
-
const [activetab, setActive] = (0,
|
1950
|
-
const [saveCardInfo, setSaveCardInfo] = (0,
|
1951
|
-
const [saveACHinfo, setSaveACHinfo] = (0,
|
1981
|
+
const [loading, setLoading] = (0, import_react12.useState)(false);
|
1982
|
+
const [success, setSuccess] = (0, import_react12.useState)(false);
|
1983
|
+
const [show, setShow] = (0, import_react12.useState)(false);
|
1984
|
+
const [activetab, setActive] = (0, import_react12.useState)("cardList");
|
1985
|
+
const [saveCardInfo, setSaveCardInfo] = (0, import_react12.useState)(false);
|
1986
|
+
const [saveACHinfo, setSaveACHinfo] = (0, import_react12.useState)(false);
|
1952
1987
|
const fractalpayClientKey = props.fractalpayClientKey;
|
1953
|
-
const [cardData, setCardData] = (0,
|
1954
|
-
const [cardError, setCardError] = (0,
|
1955
|
-
const [achData, setAchData] = (0,
|
1956
|
-
const [achError, setAchError] = (0,
|
1957
|
-
const [cardList, setCardList] = (0,
|
1988
|
+
const [cardData, setCardData] = (0, import_react12.useState)();
|
1989
|
+
const [cardError, setCardError] = (0, import_react12.useState)({});
|
1990
|
+
const [achData, setAchData] = (0, import_react12.useState)();
|
1991
|
+
const [achError, setAchError] = (0, import_react12.useState)({});
|
1992
|
+
const [cardList, setCardList] = (0, import_react12.useState)([
|
1958
1993
|
{ cardNumber: "9876789878999878", expMonth: "06", expYear: "2026", cardType: "visa" },
|
1959
1994
|
{ cardNumber: "9876789878999868", expMonth: "04", expYear: "2027", cardType: "visa" },
|
1960
1995
|
{ cardNumber: "9876789878999874", expMonth: "11", expYear: "2028", cardType: "visa" },
|
@@ -2222,27 +2257,27 @@ function GetPaymentPage(props) {
|
|
2222
2257
|
}
|
2223
2258
|
}
|
2224
2259
|
};
|
2225
|
-
return /* @__PURE__ */
|
2260
|
+
return /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement(DataScript, null), /* @__PURE__ */ import_react12.default.createElement(Chargewidgetstyles, null), /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement(
|
2226
2261
|
"button",
|
2227
2262
|
{
|
2228
2263
|
className: "paymentBtn",
|
2229
2264
|
onClick: handleShow
|
2230
2265
|
},
|
2231
2266
|
"Pay"
|
2232
|
-
), /* @__PURE__ */
|
2267
|
+
), /* @__PURE__ */ import_react12.default.createElement(
|
2233
2268
|
CustomModal2_default,
|
2234
2269
|
{
|
2235
2270
|
open: show,
|
2236
2271
|
onClose: handleClose
|
2237
2272
|
},
|
2238
|
-
/* @__PURE__ */
|
2239
|
-
success ? /* @__PURE__ */
|
2273
|
+
/* @__PURE__ */ import_react12.default.createElement(Loader_default, { loading }),
|
2274
|
+
success ? /* @__PURE__ */ import_react12.default.createElement(SuccessMsz, { onClose: handleCloseSeccess }) : /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("span", { className: "request-payment-close-popup", onClick: handleClose }, /* @__PURE__ */ import_react12.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ import_react12.default.createElement("g", { "clip-path": "url(#clip0_12425_52336)" }, /* @__PURE__ */ import_react12.default.createElement("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" })), /* @__PURE__ */ import_react12.default.createElement("defs", null, /* @__PURE__ */ import_react12.default.createElement("clipPath", { id: "clip0_12425_52336" }, /* @__PURE__ */ import_react12.default.createElement("rect", { width: "16", height: "16", fill: "white" }))))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-container" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-header pay-conatiner-one" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-logo-container" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-main-logo" }, /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://fractal-userdata-upload.s3.us-east-1.amazonaws.com/uploaded/merchant_logo/20250311131124_merchant_logo.png", id: "pay-logos" })), /* @__PURE__ */ import_react12.default.createElement("h1", { className: "pay-heading" }, "Pay")), /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-amount-conatiner" }, /* @__PURE__ */ import_react12.default.createElement("small", { className: "pay-payment-amount" }, "Payment Amount"), /* @__PURE__ */ import_react12.default.createElement("strong", { className: "pay-amount" }, "$1.35")), activetab != "ach" && /* @__PURE__ */ import_react12.default.createElement("div", { style: { display: "flex", gap: "8px", margin: "8px 0" } }, /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/visa-img.svg", alt: "", width: 33 }), /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/mc-img.svg", width: 33, alt: "" }), /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/ae-img.svg", alt: "", width: 33 }), /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/discover-img.svg", width: 33, alt: "" }))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-tab pay-conatiner-two" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "col-md-12" }, /* @__PURE__ */ import_react12.default.createElement("div", { id: "payment-form-div" }, activetab !== "cardList" ? /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("button", { className: "charge-payment-back-btn ", onClick: () => setActive("cardList") }, " ", /* @__PURE__ */ import_react12.default.createElement(import_io5.IoArrowBack, null), " Back"), /* @__PURE__ */ import_react12.default.createElement("div", { className: "tab" }, /* @__PURE__ */ import_react12.default.createElement("button", { className: "tablinks", onClick: (e) => {
|
2240
2275
|
handletabchange("card");
|
2241
|
-
}, style: { backgroundColor: activetab === "card" ? "#fff" : "inherit" } }, "Card"), /* @__PURE__ */
|
2276
|
+
}, style: { backgroundColor: activetab === "card" ? "#fff" : "inherit" } }, "Card"), /* @__PURE__ */ import_react12.default.createElement("button", { className: "tablinks", onClick: (e) => {
|
2242
2277
|
handletabchange("ach");
|
2243
|
-
}, style: { backgroundColor: activetab === "ach" ? "#fff" : "inherit" } }, "ACH"))) : /* @__PURE__ */
|
2278
|
+
}, style: { backgroundColor: activetab === "ach" ? "#fff" : "inherit" } }, "ACH"))) : /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("p", { className: "charge-customer-name" }, " Charge Mmm"), /* @__PURE__ */ import_react12.default.createElement("p", { className: "card-ach-heading" }, " Cards/ACH")), /* @__PURE__ */ import_react12.default.createElement("div", { id: "ach", style: { display: activetab === "cardList" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "card-lint-div-in" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "card-list-div" }, cardList && cardList.length > 0 && cardList.map((card, index) => {
|
2244
2279
|
var _a2;
|
2245
|
-
return /* @__PURE__ */
|
2280
|
+
return /* @__PURE__ */ import_react12.default.createElement("div", { className: "card-list-single-div" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "card-number-radio" }, /* @__PURE__ */ import_react12.default.createElement("input", { type: "radio", className: "cardRadio", name: "selected_card", id: "" }), /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "", className: "card-number-last-four" }, "**** ", (_a2 = card == null ? void 0 : card.cardNumber) == null ? void 0 : _a2.slice(-4)), /* @__PURE__ */ import_react12.default.createElement("h6", { className: "card-expiry-date" }, card == null ? void 0 : card.expMonth, "/", card == null ? void 0 : card.expYear)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "card-number-radio" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "visa-card" }, /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/visa-img.svg", alt: "" })), /* @__PURE__ */ import_react12.default.createElement("span", { className: "visa-card", style: { cursor: "pointer" }, onClick: () => {
|
2246
2281
|
import_sweetalert2.default.fire({
|
2247
2282
|
icon: "warning",
|
2248
2283
|
text: "Do you want to delete the card?",
|
@@ -2260,8 +2295,8 @@ function GetPaymentPage(props) {
|
|
2260
2295
|
icon: "custom-swal-icon"
|
2261
2296
|
}
|
2262
2297
|
});
|
2263
|
-
} }, /* @__PURE__ */
|
2264
|
-
})), /* @__PURE__ */
|
2298
|
+
} }, /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/Trash.svg", alt: "" }))));
|
2299
|
+
})), /* @__PURE__ */ import_react12.default.createElement("div", { className: "pay-with-other-card ", onClick: () => setActive("card") }, "Pay With Other Card", /* @__PURE__ */ import_react12.default.createElement("img", { src: "https://dev-widget.fractalpay.com/images/card.svg", alt: "" }))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("button", { className: "pay-button", style: { margin: "0px" }, type: "submit" }, "$1.35"))), /* @__PURE__ */ import_react12.default.createElement("div", { id: "card", style: { display: activetab === "card" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ import_react12.default.createElement("form", { id: "PaymentForm", onSubmit: submitFunc }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "cardHolderName" }, "Name on Card"), /* @__PURE__ */ import_react12.default.createElement("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "John Doe", value: cardData == null ? void 0 : cardData.cardName, onChange: (e) => handleCardChange("cardName", e.target.value) }), (cardError == null ? void 0 : cardError.cardName) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cardName)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "cardNumber" }, "Card Number"), /* @__PURE__ */ import_react12.default.createElement("div", { className: "toggle-num-wrapper" }, /* @__PURE__ */ import_react12.default.createElement(
|
2265
2300
|
"input",
|
2266
2301
|
{
|
2267
2302
|
className: "form-control card-number-new",
|
@@ -2273,7 +2308,7 @@ function GetPaymentPage(props) {
|
|
2273
2308
|
onChange: (e) => handleCardNumberChange(e),
|
2274
2309
|
"data-token": "card_number"
|
2275
2310
|
}
|
2276
|
-
), /* @__PURE__ */
|
2311
|
+
), /* @__PURE__ */ import_react12.default.createElement("div", { className: "card-crdi card-expiry-new" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "exp-date-year-container" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "exp-date form-group" }, /* @__PURE__ */ import_react12.default.createElement(
|
2277
2312
|
"input",
|
2278
2313
|
{
|
2279
2314
|
"data-token": "exp_month",
|
@@ -2284,7 +2319,7 @@ function GetPaymentPage(props) {
|
|
2284
2319
|
value: (cardData == null ? void 0 : cardData.expiryMonth) || "",
|
2285
2320
|
onChange: (e) => handleCardChange("expiryMonth", e.target.value)
|
2286
2321
|
}
|
2287
|
-
)), /* @__PURE__ */
|
2322
|
+
)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "exp-year form-group" }, /* @__PURE__ */ import_react12.default.createElement(
|
2288
2323
|
"input",
|
2289
2324
|
{
|
2290
2325
|
"data-token": "exp_year",
|
@@ -2295,7 +2330,7 @@ function GetPaymentPage(props) {
|
|
2295
2330
|
value: (cardData == null ? void 0 : cardData.expiryYear) || "",
|
2296
2331
|
onChange: (e) => handleCardChange("expiryYear", e.target.value)
|
2297
2332
|
}
|
2298
|
-
)), /* @__PURE__ */
|
2333
|
+
)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "security-digit form-group" }, /* @__PURE__ */ import_react12.default.createElement(
|
2299
2334
|
"input",
|
2300
2335
|
{
|
2301
2336
|
"data-token": "cvv",
|
@@ -2306,7 +2341,7 @@ function GetPaymentPage(props) {
|
|
2306
2341
|
value: (cardData == null ? void 0 : cardData.cvv) || "",
|
2307
2342
|
onChange: (e) => handleCardChange("cvv", e.target.value)
|
2308
2343
|
}
|
2309
|
-
)))), (cardError == null ? void 0 : cardError.cardNumber) && /* @__PURE__ */
|
2344
|
+
)))), (cardError == null ? void 0 : cardError.cardNumber) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cardNumber), /* @__PURE__ */ import_react12.default.createElement("p", { style: { margin: "0" } }, (cardError == null ? void 0 : cardError.expiryMonth) || (cardError == null ? void 0 : cardError.expiryYear) ? /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span", style: { paddingRight: "4px" } }, cardError == null ? void 0 : cardError.expiryMonth) : "", (cardError == null ? void 0 : cardError.cvv) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.cvv)))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "OrderId" }, "Order ID / Description"), /* @__PURE__ */ import_react12.default.createElement(
|
2310
2345
|
"input",
|
2311
2346
|
{
|
2312
2347
|
type: "text",
|
@@ -2318,7 +2353,7 @@ function GetPaymentPage(props) {
|
|
2318
2353
|
onChange: (e) => handleCardChange("orderId", e.target.value),
|
2319
2354
|
style: { background: "#F6F6F7", color: "#727272" }
|
2320
2355
|
}
|
2321
|
-
)), /* @__PURE__ */
|
2356
|
+
)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "zip" }, "ZIP"), /* @__PURE__ */ import_react12.default.createElement("input", { type: "text", className: "form-control", maxLength: 100, placeholder: "000000", value: (_b = cardData == null ? void 0 : cardData.zipCode) != null ? _b : "", onChange: (e) => handleCardChange("zipCode", e.target.value) }), (cardError == null ? void 0 : cardError.zipCode) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, cardError == null ? void 0 : cardError.zipCode)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: "10px", paddingTop: "10px" } }, /* @__PURE__ */ import_react12.default.createElement(
|
2322
2357
|
"input",
|
2323
2358
|
{
|
2324
2359
|
type: "checkbox",
|
@@ -2327,7 +2362,7 @@ function GetPaymentPage(props) {
|
|
2327
2362
|
checked: saveCardInfo,
|
2328
2363
|
onChange: (e) => setSaveCardInfo(e.target.checked)
|
2329
2364
|
}
|
2330
|
-
), /* @__PURE__ */
|
2365
|
+
), /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "save_card", className: "toggle-label" }), /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "save_card" }, "Save card for future payments"))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group", style: { marginTop: "20px" } }, /* @__PURE__ */ import_react12.default.createElement("button", { type: "submit", style: { margin: 0 }, className: "pay-button" }, "$1.35")))), /* @__PURE__ */ import_react12.default.createElement("div", { id: "ach", style: { display: activetab === "ach" ? "block" : "none" }, className: "tabcontent" }, /* @__PURE__ */ import_react12.default.createElement("form", { id: "ACHPaymentForm", onSubmit: submitFunc }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ach-scrl" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "nameonaccount" }, "Name on account"), /* @__PURE__ */ import_react12.default.createElement("input", { type: "text", id: "nameonaccount", className: "form-control", maxLength: 100, placeholder: "John Doe", name: "name", value: (_c = achData == null ? void 0 : achData.name) != null ? _c : "", onChange: handleChangeAch }), (achError == null ? void 0 : achError.name) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, achError == null ? void 0 : achError.name)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "routingnumber" }, "Routing number"), /* @__PURE__ */ import_react12.default.createElement(
|
2331
2366
|
"input",
|
2332
2367
|
{
|
2333
2368
|
type: "text",
|
@@ -2339,7 +2374,7 @@ function GetPaymentPage(props) {
|
|
2339
2374
|
value: (_d = achData == null ? void 0 : achData.routingNumber) != null ? _d : "",
|
2340
2375
|
onChange: handleChangeAch
|
2341
2376
|
}
|
2342
|
-
), (achError == null ? void 0 : achError.routingNumber) && /* @__PURE__ */
|
2377
|
+
), (achError == null ? void 0 : achError.routingNumber) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, achError == null ? void 0 : achError.routingNumber)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "accountnumber" }, "Account number"), /* @__PURE__ */ import_react12.default.createElement(
|
2343
2378
|
"input",
|
2344
2379
|
{
|
2345
2380
|
type: "text",
|
@@ -2351,7 +2386,7 @@ function GetPaymentPage(props) {
|
|
2351
2386
|
value: (_e = achData == null ? void 0 : achData.accountNumber) != null ? _e : "",
|
2352
2387
|
onChange: handleChangeAch
|
2353
2388
|
}
|
2354
|
-
), (achError == null ? void 0 : achError.accountNumber) && /* @__PURE__ */
|
2389
|
+
), (achError == null ? void 0 : achError.accountNumber) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, achError == null ? void 0 : achError.accountNumber)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "confirmaccountnumber" }, "Confirm account number"), /* @__PURE__ */ import_react12.default.createElement(
|
2355
2390
|
"input",
|
2356
2391
|
{
|
2357
2392
|
type: "text",
|
@@ -2363,7 +2398,7 @@ function GetPaymentPage(props) {
|
|
2363
2398
|
value: (_f = achData == null ? void 0 : achData.confirmAccountNumber) != null ? _f : "",
|
2364
2399
|
onChange: handleChangeAch
|
2365
2400
|
}
|
2366
|
-
), (achError == null ? void 0 : achError.confirmAccountNumber) && /* @__PURE__ */
|
2401
|
+
), (achError == null ? void 0 : achError.confirmAccountNumber) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, achError == null ? void 0 : achError.confirmAccountNumber)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "bankname" }, "Bank name"), /* @__PURE__ */ import_react12.default.createElement(
|
2367
2402
|
"input",
|
2368
2403
|
{
|
2369
2404
|
type: "text",
|
@@ -2375,45 +2410,11 @@ function GetPaymentPage(props) {
|
|
2375
2410
|
value: (_g = achData == null ? void 0 : achData.bankName) != null ? _g : "",
|
2376
2411
|
onChange: handleChangeAch
|
2377
2412
|
}
|
2378
|
-
), (achError == null ? void 0 : achError.bankName) && /* @__PURE__ */
|
2413
|
+
), (achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ import_react12.default.createElement("span", { className: "error-span" }, achError == null ? void 0 : achError.bankName)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "accounttype" }, "Select account type"), /* @__PURE__ */ import_react12.default.createElement("select", { name: "accountType", id: "accounttype", className: "form-control", value: (_h = achData == null ? void 0 : achData.accountType) != null ? _h : "", onChange: handleChangeAch }, /* @__PURE__ */ import_react12.default.createElement("option", { value: "" }, "Select account"), /* @__PURE__ */ import_react12.default.createElement("option", { value: "Personal Saving" }, "Personal Saving"), /* @__PURE__ */ import_react12.default.createElement("option", { value: "Business Saving" }, "Business Saving"), /* @__PURE__ */ import_react12.default.createElement("option", { value: "Personal Checking" }, "Personal Checking"), /* @__PURE__ */ import_react12.default.createElement("option", { value: "Business Checking" }, "Business Checking"))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4", style: { paddingTop: "5px" } }, /* @__PURE__ */ import_react12.default.createElement("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }), /* @__PURE__ */ import_react12.default.createElement("label", { htmlFor: "saveACH" }, "Save ACH")), saveACHinfo && /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group mb-4", style: { fontSize: "12px", color: "#727272" } }, /* @__PURE__ */ import_react12.default.createElement("p", null, "If checked, I agree for ", /* @__PURE__ */ import_react12.default.createElement("b", null, "ecommerce"), " to have my permission to charge this credit card for agreed upon purchases in the future."))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react12.default.createElement("button", { className: "pay-button", style: { margin: "20px 0 0" }, type: "submit" }, "$1.35"))))))))))
|
2379
2414
|
)));
|
2380
2415
|
}
|
2381
|
-
|
2382
|
-
// src/app/components/Datascript.tsx
|
2383
|
-
var import_react12 = require("react");
|
2384
|
-
function DataScript() {
|
2385
|
-
(0, import_react12.useEffect)(() => {
|
2386
|
-
const src = "https://token-cert.dcap.com/v1/client";
|
2387
|
-
if (typeof window === "undefined") return;
|
2388
|
-
if (window.DatacapWebToken) {
|
2389
|
-
console.log("\u2705 Datacap already available");
|
2390
|
-
return;
|
2391
|
-
}
|
2392
|
-
if (!document.querySelector(`script[src="${src}"]`)) {
|
2393
|
-
const script = document.createElement("script");
|
2394
|
-
script.src = src;
|
2395
|
-
script.async = true;
|
2396
|
-
script.onload = () => {
|
2397
|
-
console.log("\u2705 Datacap script loaded");
|
2398
|
-
if (window.DatacapWebToken) {
|
2399
|
-
console.log("\u2705 DatacapWebToken is ready:", window.DatacapWebToken);
|
2400
|
-
} else {
|
2401
|
-
console.warn("\u26A0\uFE0F Script loaded, but DatacapWebToken not found");
|
2402
|
-
}
|
2403
|
-
};
|
2404
|
-
script.onerror = (err) => {
|
2405
|
-
console.error("\u274C Failed to load Datacap script", err);
|
2406
|
-
};
|
2407
|
-
document.head.appendChild(script);
|
2408
|
-
} else {
|
2409
|
-
console.log("\u2139\uFE0F Script already in DOM, waiting for Datacap...");
|
2410
|
-
}
|
2411
|
-
}, []);
|
2412
|
-
return null;
|
2413
|
-
}
|
2414
2416
|
// Annotate the CommonJS export names for ESM import in node:
|
2415
2417
|
0 && (module.exports = {
|
2416
|
-
DataScript,
|
2417
2418
|
GetPaymentPage,
|
2418
2419
|
RequestPayment,
|
2419
2420
|
RequestPreAuthPayment
|
package/dist/index.mjs
CHANGED
@@ -1599,7 +1599,8 @@ function Chargewidgetstyles() {
|
|
1599
1599
|
background: #FFF;
|
1600
1600
|
box-shadow: 0px 6px 12px 0px rgba(206, 197, 221, 0.31);
|
1601
1601
|
font-size:16px;
|
1602
|
-
curso:pointer
|
1602
|
+
curso:pointer;
|
1603
|
+
color:black
|
1603
1604
|
}
|
1604
1605
|
.btn {
|
1605
1606
|
padding: 11px 23px;
|
@@ -1905,6 +1906,41 @@ function SuccessMsz({ onClose }) {
|
|
1905
1906
|
// src/app/components/Charge/GetPaymentPage.tsx
|
1906
1907
|
import Swal from "sweetalert2";
|
1907
1908
|
import { IoArrowBack } from "react-icons/io5";
|
1909
|
+
|
1910
|
+
// src/app/components/Datascript.tsx
|
1911
|
+
import { useEffect as useEffect3 } from "react";
|
1912
|
+
function DataScript() {
|
1913
|
+
useEffect3(() => {
|
1914
|
+
const src = "https://token-cert.dcap.com/v1/client";
|
1915
|
+
if (typeof window === "undefined") return;
|
1916
|
+
if (window.DatacapWebToken) {
|
1917
|
+
console.log("\u2705 Datacap already available");
|
1918
|
+
return;
|
1919
|
+
}
|
1920
|
+
if (!document.querySelector(`script[src="${src}"]`)) {
|
1921
|
+
const script = document.createElement("script");
|
1922
|
+
script.src = src;
|
1923
|
+
script.async = true;
|
1924
|
+
script.onload = () => {
|
1925
|
+
console.log("\u2705 Datacap script loaded");
|
1926
|
+
if (window.DatacapWebToken) {
|
1927
|
+
console.log("\u2705 DatacapWebToken is ready:", window.DatacapWebToken);
|
1928
|
+
} else {
|
1929
|
+
console.warn("\u26A0\uFE0F Script loaded, but DatacapWebToken not found");
|
1930
|
+
}
|
1931
|
+
};
|
1932
|
+
script.onerror = (err) => {
|
1933
|
+
console.error("\u274C Failed to load Datacap script", err);
|
1934
|
+
};
|
1935
|
+
document.head.appendChild(script);
|
1936
|
+
} else {
|
1937
|
+
console.log("\u2139\uFE0F Script already in DOM, waiting for Datacap...");
|
1938
|
+
}
|
1939
|
+
}, []);
|
1940
|
+
return null;
|
1941
|
+
}
|
1942
|
+
|
1943
|
+
// src/app/components/Charge/GetPaymentPage.tsx
|
1908
1944
|
function GetPaymentPage(props) {
|
1909
1945
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
1910
1946
|
const [loading, setLoading] = useState3(false);
|
@@ -2186,7 +2222,7 @@ function GetPaymentPage(props) {
|
|
2186
2222
|
}
|
2187
2223
|
}
|
2188
2224
|
};
|
2189
|
-
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(Chargewidgetstyles, null), /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
|
2225
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(DataScript, null), /* @__PURE__ */ React11.createElement(Chargewidgetstyles, null), /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
|
2190
2226
|
"button",
|
2191
2227
|
{
|
2192
2228
|
className: "paymentBtn",
|
@@ -2342,41 +2378,7 @@ function GetPaymentPage(props) {
|
|
2342
2378
|
), (achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ React11.createElement("span", { className: "error-span" }, achError == null ? void 0 : achError.bankName)), /* @__PURE__ */ React11.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ React11.createElement("label", { htmlFor: "accounttype" }, "Select account type"), /* @__PURE__ */ React11.createElement("select", { name: "accountType", id: "accounttype", className: "form-control", value: (_h = achData == null ? void 0 : achData.accountType) != null ? _h : "", onChange: handleChangeAch }, /* @__PURE__ */ React11.createElement("option", { value: "" }, "Select account"), /* @__PURE__ */ React11.createElement("option", { value: "Personal Saving" }, "Personal Saving"), /* @__PURE__ */ React11.createElement("option", { value: "Business Saving" }, "Business Saving"), /* @__PURE__ */ React11.createElement("option", { value: "Personal Checking" }, "Personal Checking"), /* @__PURE__ */ React11.createElement("option", { value: "Business Checking" }, "Business Checking"))), /* @__PURE__ */ React11.createElement("div", { className: "form-group mb-4", style: { paddingTop: "5px" } }, /* @__PURE__ */ React11.createElement("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }), /* @__PURE__ */ React11.createElement("label", { htmlFor: "saveACH" }, "Save ACH")), saveACHinfo && /* @__PURE__ */ React11.createElement("div", { className: "form-group mb-4", style: { fontSize: "12px", color: "#727272" } }, /* @__PURE__ */ React11.createElement("p", null, "If checked, I agree for ", /* @__PURE__ */ React11.createElement("b", null, "ecommerce"), " to have my permission to charge this credit card for agreed upon purchases in the future."))), /* @__PURE__ */ React11.createElement("div", { className: "form-group" }, /* @__PURE__ */ React11.createElement("button", { className: "pay-button", style: { margin: "20px 0 0" }, type: "submit" }, "$1.35"))))))))))
|
2343
2379
|
)));
|
2344
2380
|
}
|
2345
|
-
|
2346
|
-
// src/app/components/Datascript.tsx
|
2347
|
-
import { useEffect as useEffect4 } from "react";
|
2348
|
-
function DataScript() {
|
2349
|
-
useEffect4(() => {
|
2350
|
-
const src = "https://token-cert.dcap.com/v1/client";
|
2351
|
-
if (typeof window === "undefined") return;
|
2352
|
-
if (window.DatacapWebToken) {
|
2353
|
-
console.log("\u2705 Datacap already available");
|
2354
|
-
return;
|
2355
|
-
}
|
2356
|
-
if (!document.querySelector(`script[src="${src}"]`)) {
|
2357
|
-
const script = document.createElement("script");
|
2358
|
-
script.src = src;
|
2359
|
-
script.async = true;
|
2360
|
-
script.onload = () => {
|
2361
|
-
console.log("\u2705 Datacap script loaded");
|
2362
|
-
if (window.DatacapWebToken) {
|
2363
|
-
console.log("\u2705 DatacapWebToken is ready:", window.DatacapWebToken);
|
2364
|
-
} else {
|
2365
|
-
console.warn("\u26A0\uFE0F Script loaded, but DatacapWebToken not found");
|
2366
|
-
}
|
2367
|
-
};
|
2368
|
-
script.onerror = (err) => {
|
2369
|
-
console.error("\u274C Failed to load Datacap script", err);
|
2370
|
-
};
|
2371
|
-
document.head.appendChild(script);
|
2372
|
-
} else {
|
2373
|
-
console.log("\u2139\uFE0F Script already in DOM, waiting for Datacap...");
|
2374
|
-
}
|
2375
|
-
}, []);
|
2376
|
-
return null;
|
2377
|
-
}
|
2378
2381
|
export {
|
2379
|
-
DataScript,
|
2380
2382
|
GetPaymentPage,
|
2381
2383
|
RequestPayment,
|
2382
2384
|
RequestPreAuthPayment
|