@pinerohit11/testwidget 0.1.87 → 0.1.88

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 CHANGED
@@ -48,4 +48,11 @@ type Props = {
48
48
  };
49
49
  declare function GetPaymentPage(props: Props): React.JSX.Element;
50
50
 
51
- export { GetPaymentPage, RequestPayment, RequestPreAuthPayment };
51
+ declare global {
52
+ interface Window {
53
+ DatacapWebToken: any;
54
+ }
55
+ }
56
+ declare function DataScript(): null;
57
+
58
+ export { DataScript, GetPaymentPage, RequestPayment, RequestPreAuthPayment };
package/dist/index.d.ts CHANGED
@@ -48,4 +48,11 @@ type Props = {
48
48
  };
49
49
  declare function GetPaymentPage(props: Props): React.JSX.Element;
50
50
 
51
- export { GetPaymentPage, RequestPayment, RequestPreAuthPayment };
51
+ declare global {
52
+ interface Window {
53
+ DatacapWebToken: any;
54
+ }
55
+ }
56
+ declare function DataScript(): null;
57
+
58
+ export { DataScript, GetPaymentPage, RequestPayment, RequestPreAuthPayment };
package/dist/index.js CHANGED
@@ -47,6 +47,7 @@ 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,
50
51
  GetPaymentPage: () => GetPaymentPage,
51
52
  RequestPayment: () => RequestPayment,
52
53
  RequestPreAuthPayment: () => RequestPreAuthPayment
@@ -2377,8 +2378,42 @@ function GetPaymentPage(props) {
2377
2378
  ), (achError == null ? void 0 : achError.bankName) && /* @__PURE__ */ import_react11.default.createElement("span", { className: "error-span" }, achError == null ? void 0 : achError.bankName)), /* @__PURE__ */ import_react11.default.createElement("div", { className: "form-group mb-4" }, /* @__PURE__ */ import_react11.default.createElement("label", { htmlFor: "accounttype" }, "Select account type"), /* @__PURE__ */ import_react11.default.createElement("select", { name: "accountType", id: "accounttype", className: "form-control", value: (_h = achData == null ? void 0 : achData.accountType) != null ? _h : "", onChange: handleChangeAch }, /* @__PURE__ */ import_react11.default.createElement("option", { value: "" }, "Select account"), /* @__PURE__ */ import_react11.default.createElement("option", { value: "Personal Saving" }, "Personal Saving"), /* @__PURE__ */ import_react11.default.createElement("option", { value: "Business Saving" }, "Business Saving"), /* @__PURE__ */ import_react11.default.createElement("option", { value: "Personal Checking" }, "Personal Checking"), /* @__PURE__ */ import_react11.default.createElement("option", { value: "Business Checking" }, "Business Checking"))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "form-group mb-4", style: { paddingTop: "5px" } }, /* @__PURE__ */ import_react11.default.createElement("input", { type: "checkbox", id: "saveACH", className: "", maxLength: 100, placeholder: "My Bank", checked: saveACHinfo, onChange: (e) => setSaveACHinfo(e.target.checked) }), /* @__PURE__ */ import_react11.default.createElement("label", { htmlFor: "saveACH" }, "Save ACH")), saveACHinfo && /* @__PURE__ */ import_react11.default.createElement("div", { className: "form-group mb-4", style: { fontSize: "12px", color: "#727272" } }, /* @__PURE__ */ import_react11.default.createElement("p", null, "If checked, I agree for ", /* @__PURE__ */ import_react11.default.createElement("b", null, "ecommerce"), " to have my permission to charge this credit card for agreed upon purchases in the future."))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "form-group" }, /* @__PURE__ */ import_react11.default.createElement("button", { className: "pay-button", style: { margin: "20px 0 0" }, type: "submit" }, "$1.35"))))))))))
2378
2379
  )));
2379
2380
  }
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
+ }
2380
2414
  // Annotate the CommonJS export names for ESM import in node:
2381
2415
  0 && (module.exports = {
2416
+ DataScript,
2382
2417
  GetPaymentPage,
2383
2418
  RequestPayment,
2384
2419
  RequestPreAuthPayment
package/dist/index.mjs CHANGED
@@ -2342,7 +2342,41 @@ function GetPaymentPage(props) {
2342
2342
  ), (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
2343
  )));
2344
2344
  }
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
+ }
2345
2378
  export {
2379
+ DataScript,
2346
2380
  GetPaymentPage,
2347
2381
  RequestPayment,
2348
2382
  RequestPreAuthPayment
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinerohit11/testwidget",
3
- "version": "0.1.87",
3
+ "version": "0.1.88",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "next dev -p 4001",