@churchapps/apphelper 0.4.6 → 0.4.8

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.
Files changed (101) hide show
  1. package/CHUMS_COMPONENT_EXTRACTION_CANDIDATES.md +210 -0
  2. package/COMPONENT_USAGE_REPORT.md +322 -0
  3. package/dist/components/header/SecondaryMenu.js +3 -3
  4. package/dist/components/header/SecondaryMenu.js.map +1 -1
  5. package/dist/components/index.d.ts +0 -2
  6. package/dist/components/index.d.ts.map +1 -1
  7. package/dist/components/index.js +1 -5
  8. package/dist/components/index.js.map +1 -1
  9. package/dist/helpers/FileHelper.d.ts +1 -1
  10. package/dist/helpers/FileHelper.d.ts.map +1 -1
  11. package/dist/helpers/FileHelper.js +2 -6
  12. package/dist/helpers/FileHelper.js.map +1 -1
  13. package/dist/index.d.ts +0 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +0 -1
  16. package/dist/index.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/components/header/SecondaryMenu.tsx +3 -3
  19. package/src/components/index.tsx +0 -2
  20. package/src/helpers/FileHelper.ts +3 -6
  21. package/src/index.ts +0 -1
  22. package/dist/components/CreatePerson.d.ts +0 -15
  23. package/dist/components/CreatePerson.d.ts.map +0 -1
  24. package/dist/components/CreatePerson.js +0 -100
  25. package/dist/components/CreatePerson.js.map +0 -1
  26. package/dist/components/PersonAdd.d.ts +0 -16
  27. package/dist/components/PersonAdd.d.ts.map +0 -1
  28. package/dist/components/PersonAdd.js +0 -52
  29. package/dist/components/PersonAdd.js.map +0 -1
  30. package/dist/donationComponents/DonationPage.d.ts +0 -11
  31. package/dist/donationComponents/DonationPage.d.ts.map +0 -1
  32. package/dist/donationComponents/DonationPage.js +0 -149
  33. package/dist/donationComponents/DonationPage.js.map +0 -1
  34. package/dist/donationComponents/components/BankForm.d.ts +0 -14
  35. package/dist/donationComponents/components/BankForm.d.ts.map +0 -1
  36. package/dist/donationComponents/components/BankForm.js +0 -125
  37. package/dist/donationComponents/components/BankForm.js.map +0 -1
  38. package/dist/donationComponents/components/CardForm.d.ts +0 -13
  39. package/dist/donationComponents/components/CardForm.d.ts.map +0 -1
  40. package/dist/donationComponents/components/CardForm.js +0 -122
  41. package/dist/donationComponents/components/CardForm.js.map +0 -1
  42. package/dist/donationComponents/components/DonationForm.d.ts +0 -15
  43. package/dist/donationComponents/components/DonationForm.d.ts.map +0 -1
  44. package/dist/donationComponents/components/DonationForm.js +0 -200
  45. package/dist/donationComponents/components/DonationForm.js.map +0 -1
  46. package/dist/donationComponents/components/FundDonation.d.ts +0 -12
  47. package/dist/donationComponents/components/FundDonation.d.ts.map +0 -1
  48. package/dist/donationComponents/components/FundDonation.js +0 -32
  49. package/dist/donationComponents/components/FundDonation.js.map +0 -1
  50. package/dist/donationComponents/components/FundDonations.d.ts +0 -11
  51. package/dist/donationComponents/components/FundDonations.d.ts.map +0 -1
  52. package/dist/donationComponents/components/FundDonations.js +0 -33
  53. package/dist/donationComponents/components/FundDonations.js.map +0 -1
  54. package/dist/donationComponents/components/NonAuthDonation.d.ts +0 -12
  55. package/dist/donationComponents/components/NonAuthDonation.d.ts.map +0 -1
  56. package/dist/donationComponents/components/NonAuthDonation.js +0 -27
  57. package/dist/donationComponents/components/NonAuthDonation.js.map +0 -1
  58. package/dist/donationComponents/components/NonAuthDonationInner.d.ts +0 -12
  59. package/dist/donationComponents/components/NonAuthDonationInner.d.ts.map +0 -1
  60. package/dist/donationComponents/components/NonAuthDonationInner.js +0 -276
  61. package/dist/donationComponents/components/NonAuthDonationInner.js.map +0 -1
  62. package/dist/donationComponents/components/PaymentMethods.d.ts +0 -14
  63. package/dist/donationComponents/components/PaymentMethods.d.ts.map +0 -1
  64. package/dist/donationComponents/components/PaymentMethods.js +0 -86
  65. package/dist/donationComponents/components/PaymentMethods.js.map +0 -1
  66. package/dist/donationComponents/components/RecurringDonations.d.ts +0 -10
  67. package/dist/donationComponents/components/RecurringDonations.d.ts.map +0 -1
  68. package/dist/donationComponents/components/RecurringDonations.js +0 -93
  69. package/dist/donationComponents/components/RecurringDonations.js.map +0 -1
  70. package/dist/donationComponents/components/RecurringDonationsEdit.d.ts +0 -11
  71. package/dist/donationComponents/components/RecurringDonationsEdit.d.ts.map +0 -1
  72. package/dist/donationComponents/components/RecurringDonationsEdit.js +0 -66
  73. package/dist/donationComponents/components/RecurringDonationsEdit.js.map +0 -1
  74. package/dist/donationComponents/components/index.d.ts +0 -10
  75. package/dist/donationComponents/components/index.d.ts.map +0 -1
  76. package/dist/donationComponents/components/index.js +0 -22
  77. package/dist/donationComponents/components/index.js.map +0 -1
  78. package/dist/donationComponents/index.d.ts +0 -4
  79. package/dist/donationComponents/index.d.ts.map +0 -1
  80. package/dist/donationComponents/index.js +0 -10
  81. package/dist/donationComponents/index.js.map +0 -1
  82. package/dist/donationComponents/modals/DonationPreviewModal.d.ts +0 -15
  83. package/dist/donationComponents/modals/DonationPreviewModal.d.ts.map +0 -1
  84. package/dist/donationComponents/modals/DonationPreviewModal.js +0 -33
  85. package/dist/donationComponents/modals/DonationPreviewModal.js.map +0 -1
  86. package/src/components/CreatePerson.tsx +0 -135
  87. package/src/components/PersonAdd.tsx +0 -81
  88. package/src/donationComponents/DonationPage.tsx +0 -214
  89. package/src/donationComponents/components/BankForm.tsx +0 -161
  90. package/src/donationComponents/components/CardForm.tsx +0 -106
  91. package/src/donationComponents/components/DonationForm.tsx +0 -255
  92. package/src/donationComponents/components/FundDonation.tsx +0 -58
  93. package/src/donationComponents/components/FundDonations.tsx +0 -44
  94. package/src/donationComponents/components/NonAuthDonation.tsx +0 -33
  95. package/src/donationComponents/components/NonAuthDonationInner.tsx +0 -295
  96. package/src/donationComponents/components/PaymentMethods.tsx +0 -137
  97. package/src/donationComponents/components/RecurringDonations.tsx +0 -123
  98. package/src/donationComponents/components/RecurringDonationsEdit.tsx +0 -95
  99. package/src/donationComponents/components/index.tsx +0 -9
  100. package/src/donationComponents/index.ts +0 -3
  101. package/src/donationComponents/modals/DonationPreviewModal.tsx +0 -68
@@ -1 +0,0 @@
1
- {"version":3,"file":"FundDonations.d.ts","sourceRoot":"","sources":["../../../src/donationComponents/components/FundDonations.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAG3E,UAAU,KAAK;IAAG,aAAa,EAAE,qBAAqB,EAAE,CAAC;IAAC,KAAK,EAAE,aAAa,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAC;IAAC,eAAe,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,KAAK,IAAI,CAAA;CAAE;AAEnK,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAiCzC,CAAA"}
@@ -1,33 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.FundDonations = void 0;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const _1 = require(".");
7
- const helpers_1 = require("../../helpers");
8
- const FundDonations = (props) => {
9
- const handleUpdated = (fundDonation, index) => {
10
- let fundDonations = [...props.fundDonations];
11
- fundDonations[index] = fundDonation;
12
- props.updatedFunction(fundDonations);
13
- };
14
- const addRow = (e) => {
15
- e.preventDefault();
16
- let fundDonations = [...props.fundDonations];
17
- let fd = { fundId: props.funds[0].id };
18
- fundDonations.push(fd);
19
- props.updatedFunction(fundDonations);
20
- };
21
- const getRows = () => {
22
- let result = [];
23
- for (let i = 0; i < props.fundDonations.length; i++) {
24
- let fd = props.fundDonations[i];
25
- result.push((0, jsx_runtime_1.jsx)(_1.FundDonation, { fundDonation: fd, funds: props.funds, updatedFunction: handleUpdated, params: props?.params, index: i }, i));
26
- }
27
- return result;
28
- };
29
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [getRows(), (!props?.params?.fundId || props?.params?.fundId === "") &&
30
- (0, jsx_runtime_1.jsx)("a", { href: "about:blank", "aria-label": "add-fund-donation", className: "text-decoration", style: { display: "block", marginBottom: "15px" }, onClick: addRow, children: helpers_1.Locale.label("donation.fundDonations.addMore") })] }));
31
- };
32
- exports.FundDonations = FundDonations;
33
- //# sourceMappingURL=FundDonations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FundDonations.js","sourceRoot":"","sources":["../../../src/donationComponents/components/FundDonations.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAGb,wBAAiC;AAEjC,2CAAuC;AAIhC,MAAM,aAAa,GAAoB,CAAC,KAAK,EAAE,EAAE;IACtD,MAAM,aAAa,GAAG,CAAC,YAAmC,EAAE,KAAa,EAAE,EAAE;QAC3E,IAAI,aAAa,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;QAC7C,aAAa,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC;QACpC,KAAK,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;IACvC,CAAC,CAAA;IAED,MAAM,MAAM,GAAG,CAAC,CAAmB,EAAE,EAAE;QACrC,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,IAAI,aAAa,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;QAC7C,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAA2B,CAAC;QAChE,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvB,KAAK,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;IACvC,CAAC,CAAA;IAED,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACpD,IAAI,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YAChC,MAAM,CAAC,IAAI,CAAC,uBAAC,eAAY,IAAC,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAU,KAAK,EAAE,CAAC,IAAX,CAAC,CAAc,CAAC,CAAA;QAC9I,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAA;IAED,OAAO,CACL,6DACG,OAAO,EAAE,EACT,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,EAAE,CAAC;gBACvD,8BAAG,IAAI,EAAC,aAAa,gBAAY,mBAAmB,EAAC,SAAS,EAAC,iBAAiB,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,YAAG,gBAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,GAAK,IAE1M,CACJ,CAAC;AACJ,CAAC,CAAA;AAjCY,QAAA,aAAa,iBAiCzB"}
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { PaperProps } from "@mui/material";
3
- interface Props {
4
- churchId: string;
5
- mainContainerCssProps?: PaperProps;
6
- showHeader?: boolean;
7
- recaptchaSiteKey: string;
8
- churchLogo?: string;
9
- }
10
- export declare const NonAuthDonation: React.FC<Props>;
11
- export {};
12
- //# sourceMappingURL=NonAuthDonation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NonAuthDonation.d.ts","sourceRoot":"","sources":["../../../src/donationComponents/components/NonAuthDonation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,UAAU,KAAK;IAAG,QAAQ,EAAE,MAAM,CAAC;IAAC,qBAAqB,CAAC,EAAE,UAAU,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE;AAE7I,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAoB3C,CAAA"}
@@ -1,27 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.NonAuthDonation = void 0;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const react_1 = __importDefault(require("react"));
10
- const react_stripe_js_1 = require("@stripe/react-stripe-js");
11
- const stripe_js_1 = require("@stripe/stripe-js");
12
- const helpers_1 = require("../../helpers");
13
- const NonAuthDonationInner_1 = require("./NonAuthDonationInner");
14
- const NonAuthDonation = ({ mainContainerCssProps, showHeader, ...props }) => {
15
- const [stripePromise, setStripe] = react_1.default.useState(null);
16
- const init = () => {
17
- helpers_1.ApiHelper.get("/gateways/churchId/" + props.churchId, "GivingApi").then(data => {
18
- if (data.length && data[0]?.publicKey) {
19
- setStripe((0, stripe_js_1.loadStripe)(data[0].publicKey));
20
- }
21
- });
22
- };
23
- react_1.default.useEffect(init, []); //eslint-disable-line
24
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(react_stripe_js_1.Elements, { stripe: stripePromise, children: (0, jsx_runtime_1.jsx)(NonAuthDonationInner_1.NonAuthDonationInner, { churchId: props.churchId, mainContainerCssProps: mainContainerCssProps, showHeader: showHeader, recaptchaSiteKey: props.recaptchaSiteKey, churchLogo: props?.churchLogo }) }) }));
25
- };
26
- exports.NonAuthDonation = NonAuthDonation;
27
- //# sourceMappingURL=NonAuthDonation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NonAuthDonation.js","sourceRoot":"","sources":["../../../src/donationComponents/components/NonAuthDonation.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,kDAA0B;AAC1B,6DAAmD;AACnD,iDAAuD;AACvD,2CAA0C;AAC1C,iEAA8D;AAKvD,MAAM,eAAe,GAAoB,CAAC,EAAE,qBAAqB,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAClG,MAAM,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAkB,IAAI,CAAC,CAAC;IAEzE,MAAM,IAAI,GAAG,GAAG,EAAE;QAChB,mBAAS,CAAC,GAAG,CAAC,qBAAqB,GAAG,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC7E,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;gBACtC,SAAS,CAAC,IAAA,sBAAU,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAA;IAED,eAAK,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,qBAAqB;IAEhD,OAAO,CACL,2DACE,uBAAC,0BAAQ,IAAC,MAAM,EAAE,aAAa,YAC7B,uBAAC,2CAAoB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAI,GACxL,GACV,CACJ,CAAC;AACJ,CAAC,CAAA;AApBY,QAAA,eAAe,mBAoB3B"}
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { PaperProps } from "@mui/material";
3
- interface Props {
4
- churchId: string;
5
- mainContainerCssProps?: PaperProps;
6
- showHeader?: boolean;
7
- recaptchaSiteKey: string;
8
- churchLogo?: string;
9
- }
10
- export declare const NonAuthDonationInner: React.FC<Props>;
11
- export {};
12
- //# sourceMappingURL=NonAuthDonationInner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NonAuthDonationInner.d.ts","sourceRoot":"","sources":["../../../src/donationComponents/components/NonAuthDonationInner.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAMhD,OAAO,EAA6E,UAAU,EAAqD,MAAM,eAAe,CAAA;AAGxK,UAAU,KAAK;IAAG,QAAQ,EAAE,MAAM,CAAC;IAAC,qBAAqB,CAAC,EAAE,UAAU,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE;AAE7I,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAwRhD,CAAA"}
@@ -1,276 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.NonAuthDonationInner = void 0;
41
- const jsx_runtime_1 = require("react/jsx-runtime");
42
- const react_stripe_js_1 = require("@stripe/react-stripe-js");
43
- const react_1 = __importStar(require("react"));
44
- const react_google_recaptcha_1 = __importDefault(require("react-google-recaptcha"));
45
- const components_1 = require("../../components");
46
- const helpers_1 = require("../../helpers");
47
- const FundDonations_1 = require("./FundDonations");
48
- const material_1 = require("@mui/material");
49
- const DonationHelper_1 = require("../../helpers/DonationHelper");
50
- const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true, ...props }) => {
51
- const stripe = (0, react_stripe_js_1.useStripe)();
52
- const elements = (0, react_stripe_js_1.useElements)();
53
- const formStyling = { style: { base: { fontSize: "18px" } } };
54
- const [firstName, setFirstName] = react_1.default.useState("");
55
- const [lastName, setLastName] = react_1.default.useState("");
56
- const [email, setEmail] = react_1.default.useState("");
57
- const [fundsTotal, setFundsTotal] = react_1.default.useState(0);
58
- const [transactionFee, setTransactionFee] = react_1.default.useState(0);
59
- const [total, setTotal] = react_1.default.useState(0);
60
- const [errors, setErrors] = react_1.default.useState([]);
61
- const [fundDonations, setFundDonations] = react_1.default.useState([]);
62
- const [funds, setFunds] = react_1.default.useState([]);
63
- const [donationComplete, setDonationComplete] = react_1.default.useState(false);
64
- const [processing, setProcessing] = react_1.default.useState(false);
65
- const [donationType, setDonationType] = (0, react_1.useState)("once");
66
- const [interval, setInterval] = (0, react_1.useState)("one_month");
67
- const [startDate, setStartDate] = (0, react_1.useState)(new Date().toDateString());
68
- const [captchaResponse, setCaptchaResponse] = (0, react_1.useState)("");
69
- const [church, setChurch] = (0, react_1.useState)();
70
- const [gateway, setGateway] = react_1.default.useState(null);
71
- const [searchParams, setSearchParams] = react_1.default.useState();
72
- const captchaRef = (0, react_1.useRef)(null);
73
- const getUrlParam = (param) => {
74
- if (typeof window === "undefined")
75
- return null;
76
- const urlParams = new URLSearchParams(window.location.search);
77
- return urlParams.get(param);
78
- };
79
- const init = () => {
80
- const fundId = getUrlParam("fundId");
81
- const amount = getUrlParam("amount");
82
- setSearchParams({ fundId, amount });
83
- helpers_1.ApiHelper.get("/funds/churchId/" + props.churchId, "GivingApi").then(data => {
84
- setFunds(data);
85
- if (fundId && fundId !== "") {
86
- const selectedFund = data.find((f) => f.id === fundId);
87
- if (selectedFund) {
88
- setFundDonations([{ fundId: selectedFund.id, amount: (amount && amount !== "") ? parseFloat(amount) : 0 }]);
89
- }
90
- }
91
- else if (data.length) {
92
- setFundDonations([{ fundId: data[0].id }]);
93
- }
94
- });
95
- helpers_1.ApiHelper.get("/churches/" + props.churchId, "MembershipApi").then(data => {
96
- setChurch(data);
97
- });
98
- helpers_1.ApiHelper.get("/gateways/churchId/" + props.churchId, "GivingApi").then(data => {
99
- if (data.length !== 0)
100
- setGateway(data[0]);
101
- });
102
- };
103
- const handleCaptchaChange = (value) => {
104
- const captchaToken = captchaRef.current.getValue();
105
- helpers_1.ApiHelper.postAnonymous("/donate/captcha-verify", { token: captchaToken }, "GivingApi").then((data) => { setCaptchaResponse(data.response); });
106
- };
107
- const handleCheckChange = (e, checked) => {
108
- let totalPayAmount = checked ? fundsTotal + transactionFee : fundsTotal;
109
- setTotal(totalPayAmount);
110
- };
111
- // const handleAutoPayFee = () => {
112
- // let totalPayAmount = fundsTotal + transactionFee;
113
- // setTotal(totalPayAmount);
114
- // }
115
- const handleSave = async () => {
116
- if (validate()) {
117
- setProcessing(true);
118
- helpers_1.ApiHelper.post("/users/loadOrCreate", { userEmail: email, firstName, lastName }, "MembershipApi")
119
- .catch(ex => { setErrors([ex.toString()]); setProcessing(false); })
120
- .then(async (userData) => {
121
- const personData = { churchId: props.churchId, firstName, lastName, email };
122
- const person = await helpers_1.ApiHelper.post("/people/loadOrCreate", personData, "MembershipApi");
123
- saveCard(userData, person);
124
- });
125
- }
126
- };
127
- const saveCard = async (user, person) => {
128
- const cardData = elements.getElement(react_stripe_js_1.CardElement);
129
- const stripePM = await stripe.createPaymentMethod({ type: "card", card: cardData });
130
- if (stripePM.error) {
131
- setErrors([stripePM.error.message]);
132
- setProcessing(false);
133
- }
134
- else {
135
- const pm = { id: stripePM.paymentMethod.id, personId: person.id, email: email, name: person.name.display, churchId: props.churchId };
136
- await helpers_1.ApiHelper.post("/paymentmethods/addcard", pm, "GivingApi").then(result => {
137
- if (result?.raw?.message) {
138
- setErrors([result.raw.message]);
139
- setProcessing(false);
140
- }
141
- else {
142
- const d = result;
143
- saveDonation(d.paymentMethod, d.customerId, person);
144
- }
145
- });
146
- }
147
- };
148
- const saveDonation = async (paymentMethod, customerId, person) => {
149
- let donation = {
150
- amount: total,
151
- id: paymentMethod.id,
152
- customerId: customerId,
153
- type: paymentMethod.type,
154
- churchId: props.churchId,
155
- funds: [],
156
- person: {
157
- id: person?.id,
158
- email: person?.contactInfo?.email,
159
- name: person?.name?.display
160
- }
161
- };
162
- if (donationType === "recurring") {
163
- donation.billing_cycle_anchor = +new Date(startDate);
164
- donation.interval = DonationHelper_1.DonationHelper.getInterval(interval);
165
- }
166
- for (const fundDonation of fundDonations) {
167
- let fund = funds.find((fund) => fund.id === fundDonation.fundId);
168
- donation.funds.push({ id: fundDonation.fundId, amount: fundDonation.amount || 0, name: fund.name });
169
- }
170
- const churchObj = {
171
- name: church.name,
172
- subDomain: church.subDomain,
173
- churchURL: typeof window !== "undefined" && window.location.origin,
174
- logo: props?.churchLogo
175
- };
176
- let results;
177
- if (donationType === "once")
178
- results = await helpers_1.ApiHelper.post("/donate/charge/", { ...donation, church: churchObj }, "GivingApi");
179
- if (donationType === "recurring")
180
- results = await helpers_1.ApiHelper.post("/donate/subscribe/", { ...donation, church: churchObj }, "GivingApi");
181
- if (results?.status === "succeeded" || results?.status === "pending" || results?.status === "active") {
182
- setDonationComplete(true);
183
- }
184
- if (results?.raw?.message) {
185
- setErrors([results?.raw?.message]);
186
- setProcessing(false);
187
- }
188
- setProcessing(false);
189
- };
190
- const validate = () => {
191
- const result = [];
192
- if (!firstName)
193
- result.push(helpers_1.Locale.label("donation.donationForm.validate.firstName"));
194
- if (!lastName)
195
- result.push(helpers_1.Locale.label("donation.donationForm.validate.lastName"));
196
- if (!email)
197
- result.push(helpers_1.Locale.label("donation.donationForm.validate.email"));
198
- if (fundsTotal === 0)
199
- result.push(helpers_1.Locale.label("donation.donationForm.validate.amount"));
200
- if (result.length === 0) {
201
- if (!email.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/))
202
- result.push(helpers_1.Locale.label("donation.donationForm.validate.validEmail")); //eslint-disable-line
203
- }
204
- //Todo - make sure the account doesn't exist. (loadOrCreate?)
205
- setErrors(result);
206
- return result.length === 0;
207
- };
208
- const handleChange = (e) => {
209
- const val = e.currentTarget.value;
210
- switch (e.currentTarget.name) {
211
- case "firstName":
212
- setFirstName(val);
213
- break;
214
- case "lastName":
215
- setLastName(val);
216
- break;
217
- case "email":
218
- setEmail(val);
219
- break;
220
- case "startDate":
221
- setStartDate(val);
222
- break;
223
- case "interval":
224
- setInterval(val);
225
- break;
226
- }
227
- };
228
- const handleFundDonationsChange = async (fd) => {
229
- setFundDonations(fd);
230
- let totalAmount = 0;
231
- let selectedFunds = [];
232
- for (const fundDonation of fd) {
233
- totalAmount += fundDonation.amount || 0;
234
- let fund = funds.find((fund) => fund.id === fundDonation.fundId);
235
- selectedFunds.push({ id: fundDonation.fundId, amount: fundDonation.amount || 0, name: fund.name });
236
- }
237
- setFundsTotal(totalAmount);
238
- setTotal(totalAmount);
239
- const fee = await getTransactionFee(totalAmount);
240
- setTransactionFee(fee);
241
- if (gateway && gateway.payFees === true) {
242
- setTotal(totalAmount + fee);
243
- }
244
- };
245
- const getTransactionFee = async (amount) => {
246
- if (amount > 0) {
247
- try {
248
- const response = await helpers_1.ApiHelper.post("/donate/fee?churchId=" + props.churchId, { type: "creditCard", amount }, "GivingApi");
249
- return response.calculatedFee;
250
- }
251
- catch (error) {
252
- console.log("Error calculating transaction fee: ", error);
253
- return 0;
254
- }
255
- }
256
- else {
257
- return 0;
258
- }
259
- };
260
- const getFundList = () => {
261
- if (funds)
262
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsx)("h4", { children: helpers_1.Locale.label("donation.donationForm.funds") }), (0, jsx_runtime_1.jsx)(FundDonations_1.FundDonations, { fundDonations: fundDonations, funds: funds, params: searchParams, updatedFunction: handleFundDonationsChange })] }));
263
- };
264
- react_1.default.useEffect(init, []); //eslint-disable-line
265
- // React.useEffect(() => { gateway && gateway.payFees === true && handleAutoPayFee() }, [fundDonations]);
266
- if (donationComplete)
267
- return (0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "success", children: helpers_1.Locale.label("donation.donationForm.thankYou") });
268
- else
269
- return ((0, jsx_runtime_1.jsxs)(components_1.InputBox, { headerIcon: showHeader ? "volunteer_activism" : "", headerText: showHeader ? "Donate" : "", saveFunction: handleSave, saveText: "Donate", isSubmitting: processing || !captchaResponse || captchaResponse === "robot", mainContainerCssProps: mainContainerCssProps, children: [(0, jsx_runtime_1.jsx)(components_1.ErrorMessages, { errors: errors }), (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, spacing: 3, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { size: { xs: 12, md: 6 }, children: (0, jsx_runtime_1.jsx)(material_1.Button, { "aria-label": "single-donation", size: "small", fullWidth: true, style: { minHeight: "50px" }, variant: donationType === "once" ? "contained" : "outlined", onClick: () => setDonationType("once"), children: helpers_1.Locale.label("donation.donationForm.make") }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { size: { xs: 12, md: 6 }, children: (0, jsx_runtime_1.jsx)(material_1.Button, { "aria-label": "recurring-donation", size: "small", fullWidth: true, style: { minHeight: "50px" }, variant: donationType === "recurring" ? "contained" : "outlined", onClick: () => setDonationType("recurring"), children: helpers_1.Locale.label("donation.donationForm.makeRecurring") }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { size: { xs: 12, md: 6 }, children: (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, label: helpers_1.Locale.label("person.firstName"), name: "firstName", value: firstName, onChange: handleChange }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { size: { xs: 12, md: 6 }, children: (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, label: helpers_1.Locale.label("person.lastName"), name: "lastName", value: lastName, onChange: handleChange }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { size: { xs: 12, md: 6 }, children: (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, label: helpers_1.Locale.label("person.email"), name: "email", value: email, onChange: handleChange }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { size: { xs: 12, md: 6 }, children: (0, jsx_runtime_1.jsx)(react_google_recaptcha_1.default, { sitekey: props.recaptchaSiteKey, ref: captchaRef, onChange: handleCaptchaChange }) })] }), (0, jsx_runtime_1.jsx)("div", { style: { padding: 10, border: "1px solid #CCC", borderRadius: 5, marginTop: 10 }, children: (0, jsx_runtime_1.jsx)(react_stripe_js_1.CardElement, { options: formStyling }) }), donationType === "recurring"
270
- && (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, spacing: 3, style: { marginTop: 0 }, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { size: { xs: 12, md: 6 }, children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: helpers_1.Locale.label("donation.donationForm.frequency") }), (0, jsx_runtime_1.jsxs)(material_1.Select, { label: "Frequency", name: "interval", "aria-label": "interval", value: interval, onChange: (e) => { setInterval(e.target.value); }, children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "one_week", children: helpers_1.Locale.label("donation.donationForm.weekly") }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "two_week", children: helpers_1.Locale.label("donation.donationForm.biWeekly") }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "one_month", children: helpers_1.Locale.label("donation.donationForm.monthly") }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "three_month", children: helpers_1.Locale.label("donation.donationForm.quarterly") }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "one_year", children: helpers_1.Locale.label("donation.donationForm.annually") })] })] }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { size: { xs: 12, md: 6 }, children: (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, name: "startDate", type: "date", "aria-label": "startDate", label: helpers_1.Locale.label("donation.donationForm.startDate"), value: helpers_1.DateHelper.formatHtml5Date(new Date(startDate)), onChange: handleChange }) })] }), getFundList(), (0, jsx_runtime_1.jsx)("div", { children: fundsTotal > 0
271
- && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(gateway && gateway.payFees === true)
272
- ? (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 14, fontStyle: "italic", children: ["*", helpers_1.Locale.label("donation.donationForm.fees").replace("{}", helpers_1.CurrencyHelper.formatCurrency(transactionFee))] })
273
- : ((0, jsx_runtime_1.jsx)(material_1.FormGroup, { children: (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, {}), name: "transaction-fee", label: helpers_1.Locale.label("donation.donationForm.cover").replace("{}", helpers_1.CurrencyHelper.formatCurrency(transactionFee)), onChange: handleCheckChange }) })), (0, jsx_runtime_1.jsxs)("p", { children: ["Total Donation Amount: $", total] })] }) })] }));
274
- };
275
- exports.NonAuthDonationInner = NonAuthDonationInner;
276
- //# sourceMappingURL=NonAuthDonationInner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NonAuthDonationInner.js","sourceRoot":"","sources":["../../../src/donationComponents/components/NonAuthDonationInner.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,6DAA8E;AAC9E,+CAAgD;AAChD,oFAA+C;AAC/C,iDAA2D;AAC3D,2CAA8E;AAE9E,mDAAgD;AAChD,4CAAwK;AACxK,iEAA8D;AAIvD,MAAM,oBAAoB,GAAoB,CAAC,EAAE,qBAAqB,EAAE,UAAU,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC9G,MAAM,MAAM,GAAG,IAAA,2BAAS,GAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,IAAA,6BAAW,GAAE,CAAC;IAC/B,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IAC9D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACnD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC7C,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAS,CAAC,CAAC,CAAC;IAC9D,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAS,CAAC,CAAC,CAAC;IACtE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC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CAAC;2BACV,6DACA,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC;oCACpC,CAAC,CAAC,wBAAC,qBAAU,IAAC,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAC,QAAQ,kBAAG,gBAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,wBAAc,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,IAAc;oCACtK,CAAC,CAAC,CACA,uBAAC,oBAAS,cACR,uBAAC,2BAAgB,IAAC,OAAO,EAAE,uBAAC,mBAAQ,KAAG,EAAE,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAE,gBAAM,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,wBAAc,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,GAAI,GACtM,CACb,EACH,sEAA4B,KAAK,IAAK,IACrC,GAED,IACG,CACZ,CAAC;AACJ,CAAC,CAAA;AAxRY,QAAA,oBAAoB,wBAwRhC"}
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- import { Stripe } from "@stripe/stripe-js";
3
- import { PersonInterface, StripePaymentMethod } from "@churchapps/helpers";
4
- interface Props {
5
- person: PersonInterface;
6
- customerId: string;
7
- paymentMethods: StripePaymentMethod[];
8
- stripePromise: Promise<Stripe>;
9
- appName: string;
10
- dataUpdate: (message?: string) => void;
11
- }
12
- export declare const PaymentMethods: React.FC<Props>;
13
- export {};
14
- //# sourceMappingURL=PaymentMethods.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PaymentMethods.d.ts","sourceRoot":"","sources":["../../../src/donationComponents/components/PaymentMethods.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAK3C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAe,MAAM,qBAAqB,CAAC;AAGxF,UAAU,KAAK;IAAG,MAAM,EAAE,eAAe,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,mBAAmB,EAAE,CAAC;IAAC,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE;AAE/L,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA2H1C,CAAA"}
@@ -1,86 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.PaymentMethods = void 0;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const react_1 = __importDefault(require("react"));
10
- const react_stripe_js_1 = require("@stripe/react-stripe-js");
11
- const _1 = require(".");
12
- const components_1 = require("../../components");
13
- const helpers_1 = require("../../helpers");
14
- const helpers_2 = require("@churchapps/helpers");
15
- const material_1 = require("@mui/material");
16
- const PaymentMethods = (props) => {
17
- const [editPaymentMethod, setEditPaymentMethod] = react_1.default.useState(new helpers_2.StripePaymentMethod());
18
- const [mode, setMode] = react_1.default.useState("display");
19
- const [verify, setVerify] = react_1.default.useState(false);
20
- const handleEdit = (pm, verifyAccount) => (e) => {
21
- e.preventDefault();
22
- setEditPaymentMethod(pm);
23
- setVerify(verifyAccount);
24
- setMode("edit");
25
- };
26
- const handleDelete = async () => {
27
- let confirmed = window.confirm(helpers_1.Locale.label("donation.paymentMethods.confirmDelete"));
28
- if (confirmed) {
29
- helpers_1.ApiHelper.delete("/paymentmethods/" + editPaymentMethod.id + "/" + props.customerId, "GivingApi").then(() => {
30
- setMode("display");
31
- props.dataUpdate(helpers_1.Locale.label("donation.paymentMethods.deleted"));
32
- });
33
- }
34
- };
35
- const MenuIcon = () => {
36
- const [anchorEl, setAnchorEl] = react_1.default.useState(null);
37
- const open = Boolean(anchorEl);
38
- const handleClick = (e) => {
39
- setAnchorEl(e.currentTarget);
40
- };
41
- const handleClose = () => {
42
- setAnchorEl(null);
43
- };
44
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": "add-button", id: "addBtnGroup", "aria-controls": open ? "add-menu" : undefined, "aria-expanded": open ? "true" : undefined, "aria-haspopup": "true", onClick: handleClick, children: (0, jsx_runtime_1.jsx)(material_1.Icon, { color: "primary", children: "add" }) }), (0, jsx_runtime_1.jsxs)(material_1.Menu, { id: "add-menu", MenuListProps: {
45
- "aria-labelledby": "addBtnGroup"
46
- }, anchorEl: anchorEl, open: open, onClose: handleClose, children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, { "aria-label": "add-card", onClick: handleEdit(new helpers_2.StripePaymentMethod({ type: "card" })), children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { sx: { mr: "3px" }, children: "credit_card" }), " ", helpers_1.Locale.label("donation.paymentMethods.addCard")] }), (0, jsx_runtime_1.jsxs)(material_1.MenuItem, { "aria-label": "add-bank", onClick: handleEdit(new helpers_2.StripePaymentMethod({ type: "bank" })), children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { sx: { mr: "3px" }, children: "account_balance" }), " ", helpers_1.Locale.label("donation.paymentMethods.addBank")] })] })] }));
47
- };
48
- const getNewContent = () => {
49
- if (!helpers_1.UserHelper.checkAccess(helpers_2.Permissions.givingApi.settings.edit) && props.appName !== "B1App")
50
- return null;
51
- return (0, jsx_runtime_1.jsx)(MenuIcon, {});
52
- };
53
- const getEditOptions = (pm) => {
54
- if (!helpers_1.UserHelper.checkAccess(helpers_2.Permissions.givingApi.settings.edit) && props.appName !== "B1App")
55
- return null;
56
- return (0, jsx_runtime_1.jsx)("a", { "aria-label": "edit-button", onClick: handleEdit(pm), href: "about:blank", children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "edit" }) });
57
- };
58
- const getPMIcon = (type) => (type === "card" ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "credit_card" }) : (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "account_balance" }));
59
- const getPaymentRows = () => {
60
- let rows = [];
61
- props.paymentMethods.forEach((method) => {
62
- rows.push((0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableCell, { className: "capitalize", children: [getPMIcon(method.type), " ", method.name + " ****" + method.last4] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: method?.status === "new" && (0, jsx_runtime_1.jsx)("a", { href: "about:blank", "aria-label": "verify-account", onClick: handleEdit(method, true), children: helpers_1.Locale.label("donation.paymentMethods.verify") }) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: getEditOptions(method) })] }, method.id));
63
- });
64
- return rows;
65
- };
66
- const PaymentMethodsTable = () => {
67
- if (!props.paymentMethods)
68
- return (0, jsx_runtime_1.jsx)(components_1.Loading, {});
69
- if (props.paymentMethods.length) {
70
- return ((0, jsx_runtime_1.jsx)(material_1.Table, { children: (0, jsx_runtime_1.jsx)(material_1.TableBody, { children: getPaymentRows() }) }));
71
- }
72
- else
73
- return (0, jsx_runtime_1.jsx)("div", { children: helpers_1.Locale.label("donation.paymentMethods.noMethod") });
74
- };
75
- const EditForm = () => ((0, jsx_runtime_1.jsxs)(react_stripe_js_1.Elements, { stripe: props.stripePromise, children: [editPaymentMethod.type === "card" && (0, jsx_runtime_1.jsx)(_1.CardForm, { card: editPaymentMethod, customerId: props.customerId, person: props.person, setMode: setMode, deletePayment: handleDelete, updateList: (message) => { props.dataUpdate(message); } }), editPaymentMethod.type === "bank" && (0, jsx_runtime_1.jsx)(_1.BankForm, { bank: editPaymentMethod, showVerifyForm: verify, customerId: props.customerId, person: props.person, setMode: setMode, deletePayment: handleDelete, updateList: (message) => { props.dataUpdate(message); } })] }));
76
- const PaymentMethods = () => {
77
- if (mode === "display") {
78
- return ((0, jsx_runtime_1.jsx)(components_1.DisplayBox, { "aria-label": "payment-methods-box", headerIcon: "credit_card", headerText: "Payment Methods", editContent: getNewContent(), children: (0, jsx_runtime_1.jsx)(PaymentMethodsTable, {}) }));
79
- }
80
- else
81
- return (0, jsx_runtime_1.jsx)(EditForm, {});
82
- };
83
- return props.stripePromise ? (0, jsx_runtime_1.jsx)(PaymentMethods, {}) : null;
84
- };
85
- exports.PaymentMethods = PaymentMethods;
86
- //# sourceMappingURL=PaymentMethods.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PaymentMethods.js","sourceRoot":"","sources":["../../../src/donationComponents/components/PaymentMethods.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,kDAA0B;AAE1B,6DAAmD;AACnD,wBAAuC;AACvC,iDAAuD;AACvD,2CAA8D;AAC9D,iDAAwF;AACxF,4CAAwG;AAIjG,MAAM,cAAc,GAAoB,CAAC,KAAK,EAAE,EAAE;IACvD,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAsB,IAAI,6BAAmB,EAAE,CAAC,CAAC;IACjH,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAE3D,MAAM,UAAU,GAAG,CAAC,EAAwB,EAAE,aAAuB,EAAE,EAAE,CAAC,CAAC,CAAmB,EAAE,EAAE;QAChG,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,oBAAoB,CAAC,EAAE,CAAC,CAAC;QACzB,SAAS,CAAC,aAAa,CAAC,CAAA;QACxB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC,CAAA;IAED,MAAM,YA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C,IAAI,CAAC;AACxE,CAAC,CAAA;AA3HY,QAAA,cAAc,kBA2H1B"}
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- interface Props {
3
- customerId: string;
4
- paymentMethods: any[];
5
- appName: string;
6
- dataUpdate: (message?: string) => void;
7
- }
8
- export declare const RecurringDonations: React.FC<Props>;
9
- export {};
10
- //# sourceMappingURL=RecurringDonations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RecurringDonations.d.ts","sourceRoot":"","sources":["../../../src/donationComponents/components/RecurringDonations.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,KAAK;IAAG,UAAU,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,GAAG,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAAE;AAEvH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA+G9C,CAAA"}