@churchapps/apphelper 0.2.30 → 0.2.32
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/.vscode/settings.json +6 -0
- package/dist/components/B1ShareModal.js +9 -12
- package/dist/components/B1ShareModal.js.map +1 -1
- package/dist/components/CreatePerson.js +4 -4
- package/dist/components/CreatePerson.js.map +1 -1
- package/dist/components/FormSubmissionEdit.js +3 -3
- package/dist/components/FormSubmissionEdit.js.map +1 -1
- package/dist/components/ImageEditor.d.ts.map +1 -1
- package/dist/components/ImageEditor.js +2 -1
- package/dist/components/ImageEditor.js.map +1 -1
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +4 -3
- package/dist/components/InputBox.js.map +1 -1
- package/dist/components/PersonAdd.js +1 -1
- package/dist/components/PersonAdd.js.map +1 -1
- package/dist/components/SupportModal.d.ts.map +1 -1
- package/dist/components/SupportModal.js +14 -5
- package/dist/components/SupportModal.js.map +1 -1
- package/dist/components/gallery/GalleryModal.js +6 -5
- package/dist/components/gallery/GalleryModal.js.map +1 -1
- package/dist/components/gallery/StockPhotos.js +4 -3
- package/dist/components/gallery/StockPhotos.js.map +1 -1
- package/dist/components/iconPicker/IconPicker.d.ts.map +1 -1
- package/dist/components/iconPicker/IconPicker.js +10 -3
- package/dist/components/iconPicker/IconPicker.js.map +1 -1
- package/dist/components/markdownEditor/MarkdownModal.d.ts.map +1 -1
- package/dist/components/markdownEditor/MarkdownModal.js +6 -4
- package/dist/components/markdownEditor/MarkdownModal.js.map +1 -1
- package/dist/components/notes/AddNote.js +1 -1
- package/dist/components/notes/AddNote.js.map +1 -1
- package/dist/components/notes/Conversation.js +5 -3
- package/dist/components/notes/Conversation.js.map +1 -1
- package/dist/components/notes/NewConversation.js +2 -2
- package/dist/components/notes/NewConversation.js.map +1 -1
- package/dist/components/notes/Notes.js +1 -1
- package/dist/components/notes/Notes.js.map +1 -1
- package/dist/components/reporting/ChartReport.d.ts.map +1 -1
- package/dist/components/reporting/ChartReport.js +2 -1
- package/dist/components/reporting/ChartReport.js.map +1 -1
- package/dist/components/reporting/ReportFilter.js +1 -1
- package/dist/components/reporting/ReportFilter.js.map +1 -1
- package/dist/components/reporting/ReportFilterField.d.ts.map +1 -1
- package/dist/components/reporting/ReportFilterField.js +2 -2
- package/dist/components/reporting/ReportFilterField.js.map +1 -1
- package/dist/components/reporting/ReportOutput.d.ts.map +1 -1
- package/dist/components/reporting/ReportOutput.js +6 -8
- package/dist/components/reporting/ReportOutput.js.map +1 -1
- package/dist/components/wrapper/ChurchList.d.ts.map +1 -1
- package/dist/components/wrapper/ChurchList.js +4 -2
- package/dist/components/wrapper/ChurchList.js.map +1 -1
- package/dist/components/wrapper/NavItem.d.ts.map +1 -1
- package/dist/components/wrapper/NavItem.js +5 -3
- package/dist/components/wrapper/NavItem.js.map +1 -1
- package/dist/components/wrapper/NewPrivateMessage.js +5 -5
- package/dist/components/wrapper/NewPrivateMessage.js.map +1 -1
- package/dist/components/wrapper/NotificationMenu.d.ts.map +1 -1
- package/dist/components/wrapper/NotificationMenu.js.map +1 -1
- package/dist/components/wrapper/PrivateMessageDetails.d.ts.map +1 -1
- package/dist/components/wrapper/PrivateMessageDetails.js +3 -1
- package/dist/components/wrapper/PrivateMessageDetails.js.map +1 -1
- package/dist/components/wrapper/UserMenu.d.ts.map +1 -1
- package/dist/components/wrapper/UserMenu.js +7 -6
- package/dist/components/wrapper/UserMenu.js.map +1 -1
- package/dist/donationComponents/DonationPage.js +6 -6
- package/dist/donationComponents/DonationPage.js.map +1 -1
- package/dist/donationComponents/components/BankForm.js +15 -15
- package/dist/donationComponents/components/BankForm.js.map +1 -1
- package/dist/donationComponents/components/CardForm.js +5 -5
- package/dist/donationComponents/components/CardForm.js.map +1 -1
- package/dist/donationComponents/components/DonationForm.js +22 -22
- package/dist/donationComponents/components/DonationForm.js.map +1 -1
- package/dist/donationComponents/components/FundDonation.d.ts.map +1 -1
- package/dist/donationComponents/components/FundDonation.js +4 -3
- package/dist/donationComponents/components/FundDonation.js.map +1 -1
- package/dist/donationComponents/components/FundDonations.d.ts.map +1 -1
- package/dist/donationComponents/components/FundDonations.js +2 -1
- package/dist/donationComponents/components/FundDonations.js.map +1 -1
- package/dist/donationComponents/components/NonAuthDonationInner.js +22 -23
- package/dist/donationComponents/components/NonAuthDonationInner.js.map +1 -1
- package/dist/donationComponents/components/PaymentMethods.js +8 -6
- package/dist/donationComponents/components/PaymentMethods.js.map +1 -1
- package/dist/donationComponents/components/RecurringDonations.js +7 -6
- package/dist/donationComponents/components/RecurringDonations.js.map +1 -1
- package/dist/donationComponents/components/RecurringDonationsEdit.js +13 -13
- package/dist/donationComponents/components/RecurringDonationsEdit.js.map +1 -1
- package/dist/donationComponents/modals/DonationPreviewModal.js +32 -12
- package/dist/donationComponents/modals/DonationPreviewModal.js.map +1 -1
- package/dist/helpers/Locale.d.ts +7 -0
- package/dist/helpers/Locale.d.ts.map +1 -0
- package/dist/helpers/Locale.js +56 -0
- package/dist/helpers/Locale.js.map +1 -0
- package/dist/helpers/PersonHelper.d.ts.map +1 -1
- package/dist/helpers/PersonHelper.js +2 -1
- package/dist/helpers/PersonHelper.js.map +1 -1
- package/dist/helpers/ReportHelper.d.ts.map +1 -1
- package/dist/helpers/ReportHelper.js.map +1 -1
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +3 -1
- package/dist/helpers/index.js.map +1 -1
- package/dist/pageComponents/LoginPage.js +5 -8
- package/dist/pageComponents/LoginPage.js.map +1 -1
- package/dist/pageComponents/components/Forgot.js +11 -10
- package/dist/pageComponents/components/Forgot.js.map +1 -1
- package/dist/pageComponents/components/Login.d.ts.map +1 -1
- package/dist/pageComponents/components/Login.js +9 -8
- package/dist/pageComponents/components/Login.js.map +1 -1
- package/dist/pageComponents/components/LoginSetPassword.js +8 -7
- package/dist/pageComponents/components/LoginSetPassword.js.map +1 -1
- package/dist/pageComponents/components/Register.d.ts.map +1 -1
- package/dist/pageComponents/components/Register.js +6 -8
- package/dist/pageComponents/components/Register.js.map +1 -1
- package/dist/pageComponents/components/SelectChurchModal.d.ts.map +1 -1
- package/dist/pageComponents/components/SelectChurchModal.js +3 -2
- package/dist/pageComponents/components/SelectChurchModal.js.map +1 -1
- package/dist/pageComponents/components/SelectChurchRegister.d.ts.map +1 -1
- package/dist/pageComponents/components/SelectChurchRegister.js +14 -19
- package/dist/pageComponents/components/SelectChurchRegister.js.map +1 -1
- package/dist/pageComponents/components/SelectChurchSearch.js +4 -4
- package/dist/pageComponents/components/SelectChurchSearch.js.map +1 -1
- package/dist/public/locales/de.json +271 -0
- package/dist/public/locales/en.json +271 -0
- package/dist/public/locales/es.json +273 -0
- package/dist/public/locales/fr.json +271 -0
- package/dist/public/locales/hi.json +271 -0
- package/dist/public/locales/it.json +271 -0
- package/dist/public/locales/ko.json +271 -0
- package/dist/public/locales/no.json +271 -0
- package/dist/public/locales/pt.json +271 -0
- package/dist/public/locales/ru.json +271 -0
- package/dist/public/locales/tl.json +271 -0
- package/dist/public/locales/zh.json +271 -0
- package/package.json +3 -2
- package/public/locales/de.json +271 -0
- package/public/locales/en.json +271 -0
- package/public/locales/es.json +273 -0
- package/public/locales/fr.json +271 -0
- package/public/locales/hi.json +271 -0
- package/public/locales/it.json +271 -0
- package/public/locales/ko.json +271 -0
- package/public/locales/no.json +271 -0
- package/public/locales/pt.json +271 -0
- package/public/locales/ru.json +271 -0
- package/public/locales/tl.json +271 -0
- package/public/locales/zh.json +271 -0
- package/src/components/B1ShareModal.tsx +10 -10
- package/src/components/CreatePerson.tsx +5 -5
- package/src/components/FormSubmissionEdit.tsx +5 -5
- package/src/components/ImageEditor.tsx +2 -1
- package/src/components/InputBox.tsx +4 -3
- package/src/components/PersonAdd.tsx +3 -3
- package/src/components/SupportModal.tsx +5 -4
- package/src/components/gallery/GalleryModal.tsx +6 -6
- package/src/components/gallery/StockPhotos.tsx +3 -3
- package/src/components/iconPicker/IconPicker.tsx +4 -3
- package/src/components/markdownEditor/MarkdownModal.tsx +5 -4
- package/src/components/notes/AddNote.tsx +2 -2
- package/src/components/notes/Conversation.tsx +3 -3
- package/src/components/notes/NewConversation.tsx +3 -3
- package/src/components/notes/Notes.tsx +2 -2
- package/src/components/reporting/ChartReport.tsx +2 -1
- package/src/components/reporting/ReportFilter.tsx +2 -2
- package/src/components/reporting/ReportFilterField.tsx +4 -3
- package/src/components/reporting/ReportOutput.tsx +6 -8
- package/src/components/wrapper/ChurchList.tsx +13 -11
- package/src/components/wrapper/NavItem.tsx +9 -7
- package/src/components/wrapper/NewPrivateMessage.tsx +6 -6
- package/src/components/wrapper/NotificationMenu.tsx +0 -1
- package/src/components/wrapper/PrivateMessageDetails.tsx +2 -1
- package/src/components/wrapper/UserMenu.tsx +8 -9
- package/src/donationComponents/DonationPage.tsx +7 -7
- package/src/donationComponents/components/BankForm.tsx +16 -16
- package/src/donationComponents/components/CardForm.tsx +6 -6
- package/src/donationComponents/components/DonationForm.tsx +21 -21
- package/src/donationComponents/components/FundDonation.tsx +4 -3
- package/src/donationComponents/components/FundDonations.tsx +2 -1
- package/src/donationComponents/components/NonAuthDonationInner.tsx +22 -22
- package/src/donationComponents/components/PaymentMethods.tsx +7 -7
- package/src/donationComponents/components/RecurringDonations.tsx +4 -4
- package/src/donationComponents/components/RecurringDonationsEdit.tsx +14 -14
- package/src/donationComponents/modals/DonationPreviewModal.tsx +13 -13
- package/src/helpers/Locale.ts +47 -0
- package/src/helpers/PersonHelper.ts +2 -1
- package/src/helpers/ReportHelper.ts +0 -1
- package/src/helpers/index.ts +1 -0
- package/src/pageComponents/LoginPage.tsx +6 -6
- package/src/pageComponents/components/Forgot.tsx +10 -10
- package/src/pageComponents/components/Login.tsx +9 -8
- package/src/pageComponents/components/LoginSetPassword.tsx +8 -8
- package/src/pageComponents/components/Register.tsx +7 -13
- package/src/pageComponents/components/SelectChurchModal.tsx +4 -2
- package/src/pageComponents/components/SelectChurchRegister.tsx +16 -21
- package/src/pageComponents/components/SelectChurchSearch.tsx +5 -5
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { loadStripe, Stripe } from "@stripe/stripe-js";
|
|
3
3
|
import { DonationForm, RecurringDonations, PaymentMethods } from "./components";
|
|
4
4
|
import { DisplayBox, Loading } from "../components";
|
|
5
|
-
import { ApiHelper, DateHelper, UniqueIdHelper, CurrencyHelper } from "../helpers";
|
|
5
|
+
import { ApiHelper, DateHelper, UniqueIdHelper, CurrencyHelper, Locale } from "../helpers";
|
|
6
6
|
import { DonationInterface, PersonInterface, StripePaymentMethod, ChurchInterface } from "@churchapps/helpers";
|
|
7
7
|
import { Link } from "react-router-dom"
|
|
8
8
|
import { Table, TableBody, TableRow, TableCell, TableHead, Alert } from "@mui/material"
|
|
@@ -66,7 +66,7 @@ export const DonationPage: React.FC<Props> = (props) => {
|
|
|
66
66
|
let rows: JSX.Element[] = [];
|
|
67
67
|
|
|
68
68
|
if (donations.length === 0) {
|
|
69
|
-
rows.push(<TableRow key="0"><TableCell>
|
|
69
|
+
rows.push(<TableRow key="0"><TableCell>{Locale.label("donation.page.willAppear")}</TableCell></TableRow>);
|
|
70
70
|
return rows;
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -91,11 +91,11 @@ export const DonationPage: React.FC<Props> = (props) => {
|
|
|
91
91
|
if (donations.length > 0) {
|
|
92
92
|
rows.push(
|
|
93
93
|
<TableRow key="header" sx={{textAlign: "left"}}>
|
|
94
|
-
{appName !== "B1App" && <th>
|
|
95
|
-
<th>
|
|
96
|
-
<th>
|
|
97
|
-
<th>
|
|
98
|
-
<th>
|
|
94
|
+
{appName !== "B1App" && <th>{Locale.label("donation.page.bath")}</th>}
|
|
95
|
+
<th>{Locale.label("donation.page.date")}</th>
|
|
96
|
+
<th>{Locale.label("donation.page.method")}</th>
|
|
97
|
+
<th>{Locale.label("donation.page.fund")}</th>
|
|
98
|
+
<th>{Locale.label("donation.page.amount")}</th>
|
|
99
99
|
</TableRow>
|
|
100
100
|
);
|
|
101
101
|
}
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { FormControl, Grid, InputLabel, MenuItem, Select, SelectChangeEvent, TextField } from "@mui/material"
|
|
3
3
|
import { useStripe } from "@stripe/react-stripe-js";
|
|
4
4
|
import { InputBox, ErrorMessages } from "../../components";
|
|
5
|
-
import { ApiHelper } from "../../helpers";
|
|
5
|
+
import { ApiHelper, Locale } from "../../helpers";
|
|
6
6
|
import { PersonInterface, StripePaymentMethod, PaymentMethodInterface, StripeBankAccountInterface, StripeBankAccountUpdateInterface, StripeBankAccountVerifyInterface } from "@churchapps/helpers";
|
|
7
7
|
|
|
8
8
|
interface Props { bank: StripePaymentMethod, showVerifyForm: boolean, customerId: string, person: PersonInterface, setMode: any, deletePayment: any, updateList: (message?: string) => void }
|
|
@@ -25,7 +25,7 @@ export const BankForm: React.FC<Props> = (props) => {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const createBank = async () => {
|
|
28
|
-
if (!bankAccount.routing_number || !bankAccount.account_number) setErrorMessage("
|
|
28
|
+
if (!bankAccount.routing_number || !bankAccount.account_number) setErrorMessage(Locale.label("donation.bankForm.validate.accountNumber"))
|
|
29
29
|
else {
|
|
30
30
|
await stripe.createToken("bank_account", bankAccount).then(response => {
|
|
31
31
|
if (response?.error?.message) setErrorMessage(response.error.message);
|
|
@@ -35,7 +35,7 @@ export const BankForm: React.FC<Props> = (props) => {
|
|
|
35
35
|
ApiHelper.post("/paymentmethods/addbankaccount", pm, "GivingApi").then(result => {
|
|
36
36
|
if (result?.raw?.message) setErrorMessage(result.raw.message);
|
|
37
37
|
else {
|
|
38
|
-
props.updateList("
|
|
38
|
+
props.updateList(Locale.label("donation.bankForm.added"));
|
|
39
39
|
props.setMode("display");
|
|
40
40
|
}
|
|
41
41
|
});
|
|
@@ -46,7 +46,7 @@ export const BankForm: React.FC<Props> = (props) => {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const updateBank = () => {
|
|
49
|
-
if (bankAccount.account_holder_name === "") setErrorMessage("
|
|
49
|
+
if (bankAccount.account_holder_name === "") setErrorMessage(Locale.label("donation.bankForm.validate.holderName"));
|
|
50
50
|
else {
|
|
51
51
|
let bank = { ...updateBankData };
|
|
52
52
|
bank.bankData.account_holder_name = bankAccount.account_holder_name;
|
|
@@ -54,7 +54,7 @@ export const BankForm: React.FC<Props> = (props) => {
|
|
|
54
54
|
ApiHelper.post("/paymentmethods/updatebank", bank, "GivingApi").then(response => {
|
|
55
55
|
if (response?.raw?.message) setErrorMessage(response.raw.message);
|
|
56
56
|
else {
|
|
57
|
-
props.updateList("
|
|
57
|
+
props.updateList(Locale.label("donation.bankForm.updated"));
|
|
58
58
|
props.setMode("display");
|
|
59
59
|
}
|
|
60
60
|
});
|
|
@@ -68,7 +68,7 @@ export const BankForm: React.FC<Props> = (props) => {
|
|
|
68
68
|
ApiHelper.post("/paymentmethods/verifyBank", verifyBankData, "GivingApi").then(response => {
|
|
69
69
|
if (response?.raw?.message) setErrorMessage(response.raw.message);
|
|
70
70
|
else {
|
|
71
|
-
props.updateList("
|
|
71
|
+
props.updateList(Locale.label("donation.bankForm.verified"));
|
|
72
72
|
props.setMode("display");
|
|
73
73
|
}
|
|
74
74
|
});
|
|
@@ -103,13 +103,13 @@ export const BankForm: React.FC<Props> = (props) => {
|
|
|
103
103
|
const getForm = () => {
|
|
104
104
|
if (props.showVerifyForm) {
|
|
105
105
|
return (<>
|
|
106
|
-
<p>
|
|
106
|
+
<p>{Locale.label("donation.bankForm.twoDeposits")}</p>
|
|
107
107
|
<Grid container columnSpacing={2}>
|
|
108
108
|
<Grid item md={6} xs={12}>
|
|
109
|
-
<TextField fullWidth aria-label="amount1" label="
|
|
109
|
+
<TextField fullWidth aria-label="amount1" label={Locale.label("donation.bankForm.firstDeposit")} name="amount1" placeholder="00" inputProps={{ maxLength: 2 }} onChange={handleVerify} onKeyPress={handleKeyPress} />
|
|
110
110
|
</Grid>
|
|
111
111
|
<Grid item md={6} xs={12}>
|
|
112
|
-
<TextField fullWidth aria-label="amount2" label="
|
|
112
|
+
<TextField fullWidth aria-label="amount2" label={Locale.label("donation.bankForm.secondDeposit")} name="amount2" placeholder="00" inputProps={{ maxLength: 2 }} onChange={handleVerify} onKeyPress={handleKeyPress} />
|
|
113
113
|
</Grid>
|
|
114
114
|
</Grid>
|
|
115
115
|
</>);
|
|
@@ -119,10 +119,10 @@ export const BankForm: React.FC<Props> = (props) => {
|
|
|
119
119
|
if (!props.bank.id) accountDetails = (
|
|
120
120
|
<Grid container spacing={3}>
|
|
121
121
|
<Grid item md={6} xs={12} style={{ marginBottom: "20px" }}>
|
|
122
|
-
<TextField fullWidth label="
|
|
122
|
+
<TextField fullWidth label={Locale.label("donation.bankForm.routingNumber")} type="number" name="routing_number" aria-label="routing-number" placeholder="Routing Number" className="form-control" onChange={handleChange} />
|
|
123
123
|
</Grid>
|
|
124
124
|
<Grid item md={6} xs={12} style={{ marginBottom: "20px" }}>
|
|
125
|
-
<TextField fullWidth label="
|
|
125
|
+
<TextField fullWidth label={Locale.label("donation.bankForm.accountNumber")} type="number" name="account_number" aria-label="account-number" placeholder="Account Number" className="form-control" onChange={handleChange} />
|
|
126
126
|
</Grid>
|
|
127
127
|
</Grid>
|
|
128
128
|
);
|
|
@@ -133,10 +133,10 @@ export const BankForm: React.FC<Props> = (props) => {
|
|
|
133
133
|
</Grid>
|
|
134
134
|
<Grid item md={6} xs={12} style={{ marginBottom: "20px" }}>
|
|
135
135
|
<FormControl fullWidth>
|
|
136
|
-
<InputLabel>
|
|
137
|
-
<Select label="
|
|
138
|
-
<MenuItem value="individual">
|
|
139
|
-
<MenuItem value="company">
|
|
136
|
+
<InputLabel>{Locale.label("donation.bankForm.name")}</InputLabel>
|
|
137
|
+
<Select label={Locale.label("donation.bankForm.name")} name="account_holder_type" aria-label="account-holder-type" value={bankAccount.account_holder_type} onChange={handleChange}>
|
|
138
|
+
<MenuItem value="individual">{Locale.label("donation.bankForm.individual")}</MenuItem>
|
|
139
|
+
<MenuItem value="company">{Locale.label("donation.bankForm.company")}</MenuItem>
|
|
140
140
|
</Select>
|
|
141
141
|
</FormControl>
|
|
142
142
|
</Grid>
|
|
@@ -150,7 +150,7 @@ export const BankForm: React.FC<Props> = (props) => {
|
|
|
150
150
|
<InputBox headerIcon="volunteer_activism" headerText={getHeaderText()} ariaLabelSave="save-button" ariaLabelDelete="delete-button" cancelFunction={handleCancel} saveFunction={showSave ? handleSave : saveDisabled} deleteFunction={props.bank.id && !props.showVerifyForm ? handleDelete : undefined}>
|
|
151
151
|
{errorMessage && <ErrorMessages errors={[errorMessage]}></ErrorMessages>}
|
|
152
152
|
<div>
|
|
153
|
-
{!props.bank.id && <p>
|
|
153
|
+
{!props.bank.id && <p>{Locale.label("donation.bankForm.needVerified")}</p>}
|
|
154
154
|
{getForm()}
|
|
155
155
|
</div>
|
|
156
156
|
</InputBox>
|
|
@@ -2,7 +2,7 @@ import React, { useEffect } from "react";
|
|
|
2
2
|
import { Grid, TextField } from "@mui/material"
|
|
3
3
|
import { CardElement, useStripe, useElements } from "@stripe/react-stripe-js";
|
|
4
4
|
import { InputBox, ErrorMessages } from "../../components";
|
|
5
|
-
import { ApiHelper } from "../../helpers";
|
|
5
|
+
import { ApiHelper, Locale } from "../../helpers";
|
|
6
6
|
import { PersonInterface, StripePaymentMethod, PaymentMethodInterface, StripeCardUpdateInterface } from "@churchapps/helpers";
|
|
7
7
|
|
|
8
8
|
interface Props { card: StripePaymentMethod, customerId: string, person: PersonInterface, setMode: any, deletePayment: any, updateList: (message: string) => void }
|
|
@@ -55,7 +55,7 @@ export const CardForm: React.FC<Props> = (props) => {
|
|
|
55
55
|
setShowSave(true);
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
|
-
props.updateList("
|
|
58
|
+
props.updateList(Locale.label("donation.cardForm.added"));
|
|
59
59
|
props.setMode("display");
|
|
60
60
|
}
|
|
61
61
|
});
|
|
@@ -71,7 +71,7 @@ export const CardForm: React.FC<Props> = (props) => {
|
|
|
71
71
|
setShowSave(true);
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
74
|
-
props.updateList("
|
|
74
|
+
props.updateList(Locale.label("donation.cardForm.updated"));
|
|
75
75
|
props.setMode("display");
|
|
76
76
|
}
|
|
77
77
|
});
|
|
@@ -80,7 +80,7 @@ export const CardForm: React.FC<Props> = (props) => {
|
|
|
80
80
|
|
|
81
81
|
const getHeaderText = () => props.card.id
|
|
82
82
|
? `${props.card.name.toUpperCase()} ****${props.card.last4}`
|
|
83
|
-
: "
|
|
83
|
+
: Locale.label("donation.cardForm.addNew")
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
86
|
<InputBox headerIcon="volunteer_activism" headerText={getHeaderText()} ariaLabelSave="save-button" ariaLabelDelete="delete-button" cancelFunction={handleCancel} saveFunction={showSave ? handleSave : saveDisabled} deleteFunction={props.card.id ? handleDelete : undefined}>
|
|
@@ -90,10 +90,10 @@ export const CardForm: React.FC<Props> = (props) => {
|
|
|
90
90
|
? <CardElement options={formStyling} />
|
|
91
91
|
: <Grid container spacing={3}>
|
|
92
92
|
<Grid item md={6} xs={12}>
|
|
93
|
-
<TextField fullWidth aria-label="card-exp-month" label="
|
|
93
|
+
<TextField fullWidth aria-label="card-exp-month" label={Locale.label("donation.cardForm.expirationMonth")} name="exp_month" value={cardUpdate.cardData.card.exp_month} placeholder="MM" inputProps={{ maxLength: 2 }} onChange={handleChange} onKeyPress={handleKeyPress} />
|
|
94
94
|
</Grid>
|
|
95
95
|
<Grid item md={6} xs={12}>
|
|
96
|
-
<TextField fullWidth aria-label="card-exp-year" label="
|
|
96
|
+
<TextField fullWidth aria-label="card-exp-year" label={Locale.label("donation.cardForm.expirationYear")} name="exp_year" value={cardUpdate.cardData.card.exp_year} placeholder="YY" inputProps={{ maxLength: 2 }} onChange={handleChange} onKeyPress={handleKeyPress} />
|
|
97
97
|
</Grid>
|
|
98
98
|
</Grid>
|
|
99
99
|
}
|
|
@@ -4,7 +4,7 @@ import { Stripe } from "@stripe/stripe-js";
|
|
|
4
4
|
import { InputBox, ErrorMessages } from "../../components";
|
|
5
5
|
import { FundDonations } from ".";
|
|
6
6
|
import { DonationPreviewModal } from "../modals/DonationPreviewModal";
|
|
7
|
-
import { ApiHelper, CurrencyHelper, DateHelper } from "../../helpers";
|
|
7
|
+
import { ApiHelper, CurrencyHelper, DateHelper, Locale } from "../../helpers";
|
|
8
8
|
import { PersonInterface, StripePaymentMethod, StripeDonationInterface, FundDonationInterface, FundInterface, ChurchInterface } from "@churchapps/helpers";
|
|
9
9
|
import { Grid, InputLabel, MenuItem, Select, TextField, FormControl, Button, SelectChangeEvent, FormControlLabel, Checkbox, FormGroup, Typography } from "@mui/material"
|
|
10
10
|
import { DonationHelper } from "../../helpers";
|
|
@@ -102,7 +102,7 @@ export const DonationForm: React.FC<Props> = (props) => {
|
|
|
102
102
|
|
|
103
103
|
const handleCancel = () => { setDonationType(null); }
|
|
104
104
|
const handleSave = () => {
|
|
105
|
-
if (donation.amount < .5) setErrorMessage("
|
|
105
|
+
if (donation.amount < .5) setErrorMessage(Locale.label("donation.donationForm.tooLow"));
|
|
106
106
|
else setShowDonationPreviewModal(true);
|
|
107
107
|
}
|
|
108
108
|
const handleDonationSelect = (type: string) => {
|
|
@@ -130,7 +130,7 @@ export const DonationForm: React.FC<Props> = (props) => {
|
|
|
130
130
|
}
|
|
131
131
|
if (results?.raw?.message) {
|
|
132
132
|
setShowDonationPreviewModal(false);
|
|
133
|
-
setErrorMessage("
|
|
133
|
+
setErrorMessage(Locale.label("donation.common.error") + ": " + results?.raw?.message);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -167,13 +167,13 @@ export const DonationForm: React.FC<Props> = (props) => {
|
|
|
167
167
|
else return (
|
|
168
168
|
<>
|
|
169
169
|
<DonationPreviewModal show={showDonationPreviewModal} onHide={() => setShowDonationPreviewModal(false)} handleDonate={makeDonation} donation={donation} donationType={donationType} payFee={payFee} paymentMethodName={paymentMethodName} funds={funds} />
|
|
170
|
-
<InputBox id="donationBox" aria-label="donation-box" headerIcon="volunteer_activism" headerText="
|
|
170
|
+
<InputBox id="donationBox" aria-label="donation-box" headerIcon="volunteer_activism" headerText={Locale.label("donation.donationForm.donate")} ariaLabelSave="save-button" cancelFunction={donationType ? handleCancel : undefined} saveFunction={donationType ? handleSave : undefined} saveText={Locale.label("donation.donationForm.preview")}>
|
|
171
171
|
<Grid container spacing={3}>
|
|
172
172
|
<Grid item md={6} xs={12}>
|
|
173
|
-
<Button aria-label="single-donation" size="small" fullWidth style={{ minHeight: "50px" }} variant={donationType === "once" ? "contained" : "outlined"} onClick={() => handleDonationSelect("once")}>
|
|
173
|
+
<Button aria-label="single-donation" size="small" fullWidth style={{ minHeight: "50px" }} variant={donationType === "once" ? "contained" : "outlined"} onClick={() => handleDonationSelect("once")}>{Locale.label("donation.donationForm.make")}</Button>
|
|
174
174
|
</Grid>
|
|
175
175
|
<Grid item md={6} xs={12}>
|
|
176
|
-
<Button aria-label="recurring-donation" size="small" fullWidth style={{ minHeight: "50px" }} variant={donationType === "recurring" ? "contained" : "outlined"} onClick={() => handleDonationSelect("recurring")}>
|
|
176
|
+
<Button aria-label="recurring-donation" size="small" fullWidth style={{ minHeight: "50px" }} variant={donationType === "recurring" ? "contained" : "outlined"} onClick={() => handleDonationSelect("recurring")}>{Locale.label("donation.donationForm.makeRecurring")}</Button>
|
|
177
177
|
</Grid>
|
|
178
178
|
</Grid>
|
|
179
179
|
{donationType
|
|
@@ -181,8 +181,8 @@ export const DonationForm: React.FC<Props> = (props) => {
|
|
|
181
181
|
<Grid container spacing={3}>
|
|
182
182
|
<Grid item md={12} xs={12}>
|
|
183
183
|
<FormControl fullWidth>
|
|
184
|
-
<InputLabel>
|
|
185
|
-
<Select label="
|
|
184
|
+
<InputLabel>{Locale.label("donation.donationForm.method")}</InputLabel>
|
|
185
|
+
<Select label={Locale.label("donation.donationForm.method")} name="method" aria-label="method" value={donation.id} className="capitalize" onChange={handleChange}>
|
|
186
186
|
{props.paymentMethods.map((paymentMethod: any, i: number) => <MenuItem key={i} value={paymentMethod.id}>{paymentMethod.name} ****{paymentMethod.last4}</MenuItem>)}
|
|
187
187
|
</Select>
|
|
188
188
|
</FormControl>
|
|
@@ -191,17 +191,17 @@ export const DonationForm: React.FC<Props> = (props) => {
|
|
|
191
191
|
{donationType === "recurring"
|
|
192
192
|
&& <Grid container spacing={3} style={{marginTop:10}}>
|
|
193
193
|
<Grid item md={6} xs={12}>
|
|
194
|
-
<TextField fullWidth name="date" type="date" aria-label="date" label="
|
|
194
|
+
<TextField fullWidth name="date" type="date" aria-label="date" label={Locale.label("donation.donationForm.startDate")} value={DateHelper.formatHtml5Date(new Date(donation.billing_cycle_anchor))} onChange={handleChange} onKeyDown={handleKeyDown} />
|
|
195
195
|
</Grid>
|
|
196
196
|
<Grid item md={6} xs={12}>
|
|
197
197
|
<FormControl fullWidth>
|
|
198
|
-
<InputLabel>
|
|
199
|
-
<Select label="
|
|
200
|
-
<MenuItem value="one_week">
|
|
201
|
-
<MenuItem value="two_week">
|
|
202
|
-
<MenuItem value="one_month">
|
|
203
|
-
<MenuItem value="three_month">
|
|
204
|
-
<MenuItem value="one_year">
|
|
198
|
+
<InputLabel>{Locale.label("donation.donationForm.frequency")}</InputLabel>
|
|
199
|
+
<Select label={Locale.label("donation.donationForm.frequency")} name="interval" aria-label="interval" value={interval} onChange={handleChange}>
|
|
200
|
+
<MenuItem value="one_week">{Locale.label("donation.donationForm.weekly")}</MenuItem>
|
|
201
|
+
<MenuItem value="two_week">{Locale.label("donation.donationForm.biWeekly")}</MenuItem>
|
|
202
|
+
<MenuItem value="one_month">{Locale.label("donation.donationForm.monthly")}</MenuItem>
|
|
203
|
+
<MenuItem value="three_month">{Locale.label("donation.donationForm.quarterly")}</MenuItem>
|
|
204
|
+
<MenuItem value="one_year">{Locale.label("donation.donationForm.annually")}</MenuItem>
|
|
205
205
|
</Select>
|
|
206
206
|
</FormControl>
|
|
207
207
|
</Grid>
|
|
@@ -210,21 +210,21 @@ export const DonationForm: React.FC<Props> = (props) => {
|
|
|
210
210
|
<div className="form-group">
|
|
211
211
|
{funds && fundDonations
|
|
212
212
|
&& <>
|
|
213
|
-
<h4>
|
|
213
|
+
<h4>{Locale.label("donation.donationForm.fund")}</h4>
|
|
214
214
|
<FundDonations fundDonations={fundDonations} funds={funds} updatedFunction={handleFundDonationsChange} />
|
|
215
215
|
</>
|
|
216
216
|
}
|
|
217
217
|
{fundsTotal > 0
|
|
218
218
|
&& <>
|
|
219
|
-
{(gateway && gateway.payFees === true) ? <Typography fontSize={14} fontStyle="italic">*
|
|
219
|
+
{(gateway && gateway.payFees === true) ? <Typography fontSize={14} fontStyle="italic">*{Locale.label("donation.donationForm.fees").replace("{}", CurrencyHelper.formatCurrency(transactionFee))}</Typography> : (
|
|
220
220
|
<FormGroup>
|
|
221
|
-
<FormControlLabel control={<Checkbox />} name="transaction-fee" label={
|
|
221
|
+
<FormControlLabel control={<Checkbox />} name="transaction-fee" label={Locale.label("donation.donationForm.cover").replace("{}", CurrencyHelper.formatCurrency(transactionFee))} onChange={handleCheckChange} />
|
|
222
222
|
</FormGroup>
|
|
223
223
|
)}
|
|
224
|
-
<p>
|
|
224
|
+
<p>{Locale.label("donation.donationForm.total")}: ${total}</p>
|
|
225
225
|
</>
|
|
226
226
|
}
|
|
227
|
-
<TextField fullWidth label="
|
|
227
|
+
<TextField fullWidth label={Locale.label("donation.donationForm.notes")} multiline aria-label="note" name="notes" value={donation.notes || ""} onChange={handleChange} onKeyDown={handleKeyDown} />
|
|
228
228
|
</div>
|
|
229
229
|
{errorMessage && <ErrorMessages errors={[errorMessage]}></ErrorMessages>}
|
|
230
230
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FundDonationInterface, FundInterface } from "@churchapps/helpers";
|
|
3
3
|
import { FormControl, Grid, InputLabel, MenuItem, Select, SelectChangeEvent, TextField } from "@mui/material"
|
|
4
|
+
import { Locale } from "../../helpers";
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
6
7
|
fundDonation: FundDonationInterface,
|
|
@@ -33,12 +34,12 @@ export const FundDonation: React.FC<Props> = (props) => {
|
|
|
33
34
|
return (
|
|
34
35
|
<Grid container spacing={3}>
|
|
35
36
|
<Grid item md={6} xs={12}>
|
|
36
|
-
<TextField fullWidth name="amount" label="
|
|
37
|
+
<TextField fullWidth name="amount" label={Locale.label("donation.fundDonations.amount")} type="number" aria-label="amount" lang="en-150" value={props.fundDonation.amount || ""} onChange={handleChange} />
|
|
37
38
|
</Grid>
|
|
38
39
|
<Grid item md={6} xs={12}>
|
|
39
40
|
<FormControl fullWidth>
|
|
40
|
-
<InputLabel>
|
|
41
|
-
<Select fullWidth label="
|
|
41
|
+
<InputLabel>{Locale.label("donation.fundDonations.fund")}</InputLabel>
|
|
42
|
+
<Select fullWidth label={Locale.label("donation.fundDonations.fund")} name="fund" aria-label="fund" value={props.fundDonation.fundId} onChange={handleChange}>
|
|
42
43
|
{getOptions()}
|
|
43
44
|
</Select>
|
|
44
45
|
</FormControl>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FundDonation } from ".";
|
|
3
3
|
import { FundDonationInterface, FundInterface } from "@churchapps/helpers";
|
|
4
|
+
import { Locale } from "../../helpers";
|
|
4
5
|
|
|
5
6
|
interface Props { fundDonations: FundDonationInterface[], funds: FundInterface[], updatedFunction: (fundDonations: FundDonationInterface[]) => void }
|
|
6
7
|
|
|
@@ -32,7 +33,7 @@ export const FundDonations: React.FC<Props> = (props) => {
|
|
|
32
33
|
return (
|
|
33
34
|
<>
|
|
34
35
|
{getRows()}
|
|
35
|
-
<a href="about:blank" aria-label="add-fund-donation" className="text-decoration" style={{ display: "block", marginBottom: "15px" }} onClick={addRow}>
|
|
36
|
+
<a href="about:blank" aria-label="add-fund-donation" className="text-decoration" style={{ display: "block", marginBottom: "15px" }} onClick={addRow}>{Locale.label("donation.fundDonations.addMore")}</a>
|
|
36
37
|
</>
|
|
37
38
|
);
|
|
38
39
|
}
|
|
@@ -2,7 +2,7 @@ import { CardElement, useElements, useStripe } from "@stripe/react-stripe-js";
|
|
|
2
2
|
import React, { useState, useRef } from "react";
|
|
3
3
|
import ReCAPTCHA from "react-google-recaptcha";
|
|
4
4
|
import { ErrorMessages, InputBox } from "../../components";
|
|
5
|
-
import { ApiHelper, DateHelper, CurrencyHelper } from "../../helpers";
|
|
5
|
+
import { ApiHelper, DateHelper, CurrencyHelper, Locale } from "../../helpers";
|
|
6
6
|
import { FundDonationInterface, FundInterface, PersonInterface, StripeDonationInterface, StripePaymentMethod, UserInterface, ChurchInterface } from "@churchapps/helpers";
|
|
7
7
|
import { FundDonations } from "./FundDonations";
|
|
8
8
|
import { Grid, Alert, TextField, Button, FormControl, InputLabel, Select, MenuItem, PaperProps, FormGroup, FormControlLabel, Checkbox, Typography } from "@mui/material"
|
|
@@ -140,12 +140,12 @@ export const NonAuthDonationInner: React.FC<Props> = ({ mainContainerCssProps, s
|
|
|
140
140
|
|
|
141
141
|
const validate = () => {
|
|
142
142
|
const result = [];
|
|
143
|
-
if (!firstName) result.push("
|
|
144
|
-
if (!lastName) result.push("
|
|
145
|
-
if (!email) result.push("
|
|
146
|
-
if (fundsTotal === 0) result.push("
|
|
143
|
+
if (!firstName) result.push(Locale.label("donation.donationForm.validate.firstName"));
|
|
144
|
+
if (!lastName) result.push(Locale.label("donation.donationForm.validate.lastName"));
|
|
145
|
+
if (!email) result.push(Locale.label("donation.donationForm.validate.email"));
|
|
146
|
+
if (fundsTotal === 0) result.push(Locale.label("donation.donationForm.validate.amount"));
|
|
147
147
|
if (result.length === 0) {
|
|
148
|
-
if (!email.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) result.push("
|
|
148
|
+
if (!email.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) result.push(Locale.label("donation.donationForm.validate.validEmail")); //eslint-disable-line
|
|
149
149
|
}
|
|
150
150
|
//Todo - make sure the account doesn't exist. (loadOrCreate?)
|
|
151
151
|
setErrors(result);
|
|
@@ -186,7 +186,7 @@ export const NonAuthDonationInner: React.FC<Props> = ({ mainContainerCssProps, s
|
|
|
186
186
|
const getFundList = () => {
|
|
187
187
|
if (funds) return (<>
|
|
188
188
|
<hr />
|
|
189
|
-
<h4>
|
|
189
|
+
<h4>{Locale.label("donation.donationForm.funds")}</h4>
|
|
190
190
|
<FundDonations fundDonations={fundDonations} funds={funds} updatedFunction={handleFundDonationsChange} />
|
|
191
191
|
</>);
|
|
192
192
|
}
|
|
@@ -195,25 +195,25 @@ export const NonAuthDonationInner: React.FC<Props> = ({ mainContainerCssProps, s
|
|
|
195
195
|
|
|
196
196
|
React.useEffect(() => { gateway && gateway.payFees === true && handleAutoPayFee() }, [fundDonations]);
|
|
197
197
|
|
|
198
|
-
if (donationComplete) return <Alert severity="success">
|
|
198
|
+
if (donationComplete) return <Alert severity="success">{Locale.label("donation.donationForm.thankYou")}</Alert>
|
|
199
199
|
else return (
|
|
200
200
|
<InputBox headerIcon={showHeader ? "volunteer_activism" : ""} headerText={showHeader ? "Donate" : ""} saveFunction={handleSave} saveText="Donate" isSubmitting={processing || !captchaResponse || captchaResponse === "robot"} mainContainerCssProps={mainContainerCssProps}>
|
|
201
201
|
<ErrorMessages errors={errors} />
|
|
202
202
|
<Grid container spacing={3}>
|
|
203
203
|
<Grid item md={6} xs={12}>
|
|
204
|
-
<Button aria-label="single-donation" size="small" fullWidth style={{ minHeight: "50px" }} variant={donationType === "once" ? "contained" : "outlined"} onClick={() => setDonationType("once")}>
|
|
204
|
+
<Button aria-label="single-donation" size="small" fullWidth style={{ minHeight: "50px" }} variant={donationType === "once" ? "contained" : "outlined"} onClick={() => setDonationType("once")}>{Locale.label("donation.donationForm.make")}</Button>
|
|
205
205
|
</Grid>
|
|
206
206
|
<Grid item md={6} xs={12}>
|
|
207
|
-
<Button aria-label="recurring-donation" size="small" fullWidth style={{ minHeight: "50px" }} variant={donationType === "recurring" ? "contained" : "outlined"} onClick={() => setDonationType("recurring")}>
|
|
207
|
+
<Button aria-label="recurring-donation" size="small" fullWidth style={{ minHeight: "50px" }} variant={donationType === "recurring" ? "contained" : "outlined"} onClick={() => setDonationType("recurring")}>{Locale.label("donation.donationForm.makeRecurring")}</Button>
|
|
208
208
|
</Grid>
|
|
209
209
|
<Grid item md={6} xs={12}>
|
|
210
|
-
<TextField fullWidth label="
|
|
210
|
+
<TextField fullWidth label={Locale.label("person.firstName")} name="firstName" value={firstName} onChange={handleChange} />
|
|
211
211
|
</Grid>
|
|
212
212
|
<Grid item md={6} xs={12}>
|
|
213
|
-
<TextField fullWidth label="
|
|
213
|
+
<TextField fullWidth label={Locale.label("person.lastName")} name="lastName" value={lastName} onChange={handleChange} />
|
|
214
214
|
</Grid>
|
|
215
215
|
<Grid item md={6} xs={12}>
|
|
216
|
-
<TextField fullWidth label="
|
|
216
|
+
<TextField fullWidth label={Locale.label("person.email")} name="email" value={email} onChange={handleChange} />
|
|
217
217
|
</Grid>
|
|
218
218
|
<Grid item md={6} xs={12}>
|
|
219
219
|
<ReCAPTCHA sitekey={props.recaptchaSiteKey} ref={captchaRef} onChange={handleCaptchaChange} />
|
|
@@ -226,18 +226,18 @@ export const NonAuthDonationInner: React.FC<Props> = ({ mainContainerCssProps, s
|
|
|
226
226
|
&& <Grid container spacing={3} style={{marginTop:0}}>
|
|
227
227
|
<Grid item md={6} xs={12}>
|
|
228
228
|
<FormControl fullWidth>
|
|
229
|
-
<InputLabel>
|
|
229
|
+
<InputLabel>{Locale.label("donation.donationForm.frequency")}</InputLabel>
|
|
230
230
|
<Select label="Frequency" name="interval" aria-label="interval" value={interval} onChange={(e) => {setInterval(e.target.value) }}>
|
|
231
|
-
<MenuItem value="one_week">
|
|
232
|
-
<MenuItem value="two_week">
|
|
233
|
-
<MenuItem value="one_month">
|
|
234
|
-
<MenuItem value="three_month">
|
|
235
|
-
<MenuItem value="one_year">
|
|
231
|
+
<MenuItem value="one_week">{Locale.label("donation.donationForm.weekly")}</MenuItem>
|
|
232
|
+
<MenuItem value="two_week">{Locale.label("donation.donationForm.biWeekly")}</MenuItem>
|
|
233
|
+
<MenuItem value="one_month">{Locale.label("donation.donationForm.monthly")}</MenuItem>
|
|
234
|
+
<MenuItem value="three_month">{Locale.label("donation.donationForm.quarterly")}</MenuItem>
|
|
235
|
+
<MenuItem value="one_year">{Locale.label("donation.donationForm.annually")}</MenuItem>
|
|
236
236
|
</Select>
|
|
237
237
|
</FormControl>
|
|
238
238
|
</Grid>
|
|
239
239
|
<Grid item md={6} xs={12}>
|
|
240
|
-
<TextField fullWidth name="startDate" type="date" aria-label="startDate" label="
|
|
240
|
+
<TextField fullWidth name="startDate" type="date" aria-label="startDate" label={Locale.label("donation.donationForm.startDate")} value={DateHelper.formatHtml5Date(new Date(startDate))} onChange={handleChange} />
|
|
241
241
|
</Grid>
|
|
242
242
|
</Grid>
|
|
243
243
|
}
|
|
@@ -246,10 +246,10 @@ export const NonAuthDonationInner: React.FC<Props> = ({ mainContainerCssProps, s
|
|
|
246
246
|
{fundsTotal > 0
|
|
247
247
|
&& <>
|
|
248
248
|
{(gateway && gateway.payFees === true)
|
|
249
|
-
? <Typography fontSize={14} fontStyle="italic">*
|
|
249
|
+
? <Typography fontSize={14} fontStyle="italic">*{Locale.label("donation.donationForm.fees").replace("{}", CurrencyHelper.formatCurrency(transactionFee))}</Typography>
|
|
250
250
|
: (
|
|
251
251
|
<FormGroup>
|
|
252
|
-
<FormControlLabel control={<Checkbox />} name="transaction-fee" label={
|
|
252
|
+
<FormControlLabel control={<Checkbox />} name="transaction-fee" label={Locale.label("donation.donationForm.cover").replace("{}", CurrencyHelper.formatCurrency(transactionFee))} onChange={handleCheckChange} />
|
|
253
253
|
</FormGroup>
|
|
254
254
|
)}
|
|
255
255
|
<p>Total Donation Amount: ${total}</p>
|
|
@@ -3,7 +3,7 @@ import { Stripe } from "@stripe/stripe-js";
|
|
|
3
3
|
import { Elements } from "@stripe/react-stripe-js";
|
|
4
4
|
import { CardForm, BankForm } from ".";
|
|
5
5
|
import { DisplayBox, Loading } from "../../components";
|
|
6
|
-
import { ApiHelper, UserHelper } from "../../helpers";
|
|
6
|
+
import { ApiHelper, Locale, UserHelper } from "../../helpers";
|
|
7
7
|
import { PersonInterface, StripePaymentMethod, Permissions } from "@churchapps/helpers";
|
|
8
8
|
import { Icon, Table, TableBody, TableCell, TableRow, IconButton, Menu, MenuItem } from "@mui/material";
|
|
9
9
|
|
|
@@ -22,11 +22,11 @@ export const PaymentMethods: React.FC<Props> = (props) => {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const handleDelete = async () => {
|
|
25
|
-
let confirmed = window.confirm("
|
|
25
|
+
let confirmed = window.confirm(Locale.label("donation.paymentMethods.confirmDelete"));
|
|
26
26
|
if (confirmed) {
|
|
27
27
|
ApiHelper.delete("/paymentmethods/" + editPaymentMethod.id + "/" + props.customerId, "GivingApi").then(() => {
|
|
28
28
|
setMode("display");
|
|
29
|
-
props.dataUpdate("
|
|
29
|
+
props.dataUpdate(Locale.label("donation.paymentMethods.deleted"));
|
|
30
30
|
})
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -62,10 +62,10 @@ export const PaymentMethods: React.FC<Props> = (props) => {
|
|
|
62
62
|
onClose={handleClose}
|
|
63
63
|
>
|
|
64
64
|
<MenuItem aria-label="add-card" onClick={handleEdit(new StripePaymentMethod({ type: "card" }))}>
|
|
65
|
-
<Icon sx={{mr: "3px"}}>credit_card</Icon>
|
|
65
|
+
<Icon sx={{mr: "3px"}}>credit_card</Icon> {Locale.label("donation.paymentMethods.addCard")}
|
|
66
66
|
</MenuItem>
|
|
67
67
|
<MenuItem aria-label="add-bank" onClick={handleEdit(new StripePaymentMethod({ type: "bank" }))}>
|
|
68
|
-
<Icon sx={{mr: "3px"}}>account_balance</Icon>
|
|
68
|
+
<Icon sx={{mr: "3px"}}>account_balance</Icon> {Locale.label("donation.paymentMethods.addBank")}
|
|
69
69
|
</MenuItem>
|
|
70
70
|
</Menu>
|
|
71
71
|
</>
|
|
@@ -91,7 +91,7 @@ export const PaymentMethods: React.FC<Props> = (props) => {
|
|
|
91
91
|
rows.push(
|
|
92
92
|
<TableRow key={method.id}>
|
|
93
93
|
<TableCell className="capitalize">{getPMIcon(method.type)} {method.name + " ****" + method.last4}</TableCell>
|
|
94
|
-
<TableCell>{method?.status === "new" && <a href="about:blank" aria-label="verify-account" onClick={handleEdit(method, true)}>
|
|
94
|
+
<TableCell>{method?.status === "new" && <a href="about:blank" aria-label="verify-account" onClick={handleEdit(method, true)}>{Locale.label("donation.paymentMethods.verify")}</a>}</TableCell>
|
|
95
95
|
<TableCell align="right">{getEditOptions(method)}</TableCell>
|
|
96
96
|
</TableRow>
|
|
97
97
|
);
|
|
@@ -110,7 +110,7 @@ export const PaymentMethods: React.FC<Props> = (props) => {
|
|
|
110
110
|
</Table>
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
|
-
else return <div>
|
|
113
|
+
else return <div>{Locale.label("donation.paymentMethods.noMethod")}</div>
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
const EditForm = () => (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DisplayBox } from "../../components";
|
|
3
|
-
import { ApiHelper, UserHelper, CurrencyHelper, DateHelper } from "../../helpers";
|
|
3
|
+
import { ApiHelper, UserHelper, CurrencyHelper, DateHelper, Locale } from "../../helpers";
|
|
4
4
|
import { Permissions, SubscriptionInterface } from "@churchapps/helpers";
|
|
5
5
|
import { RecurringDonationsEdit } from ".";
|
|
6
6
|
import { Icon, Table, TableBody, TableCell, TableRow, TableHead } from "@mui/material";
|
|
@@ -41,7 +41,7 @@ export const RecurringDonations: React.FC<Props> = (props) => {
|
|
|
41
41
|
|
|
42
42
|
const getPaymentMethod = (sub: SubscriptionInterface) => {
|
|
43
43
|
const pm = props.paymentMethods.find((pm: any) => pm.id === (sub.default_payment_method || sub.default_source));
|
|
44
|
-
if (!pm) return <span style={{ color: "red" }}>
|
|
44
|
+
if (!pm) return <span style={{ color: "red" }}>{Locale.label("donation.recurring.notFound")}</span>;
|
|
45
45
|
return `${pm.name} ****${pm.last4}`;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -75,7 +75,7 @@ export const RecurringDonations: React.FC<Props> = (props) => {
|
|
|
75
75
|
|
|
76
76
|
const getTableHeader = () => {
|
|
77
77
|
let result: JSX.Element[] = [];
|
|
78
|
-
result.push(<TableRow key="header" sx={{textAlign: "left"}}><TableCell><b>
|
|
78
|
+
result.push(<TableRow key="header" sx={{textAlign: "left"}}><TableCell><b>{Locale.label("donation.recurring.startDate")}</b></TableCell><TableCell><b>{Locale.label("donation.recurring.amount")}</b></TableCell><TableCell><b>{Locale.label("donation.recurring.interval")}</b></TableCell><TableCell><b>{Locale.label("donation.recurring.paymentMethod")}</b></TableCell>{props?.paymentMethods?.length > 0 && <TableCell></TableCell>}</TableRow>);
|
|
79
79
|
return result;
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -87,7 +87,7 @@ export const RecurringDonations: React.FC<Props> = (props) => {
|
|
|
87
87
|
<TableRow key={sub.id}>
|
|
88
88
|
<TableCell>{DateHelper.prettyDate(new Date(sub.billing_cycle_anchor * 1000))}</TableCell>
|
|
89
89
|
<TableCell>{getFunds(sub)}</TableCell>
|
|
90
|
-
<TableCell>
|
|
90
|
+
<TableCell>{Locale.label("donation.recurring.every")} {getInterval(sub)}</TableCell>
|
|
91
91
|
<TableCell className="capitalize">{getPaymentMethod(sub)}</TableCell>
|
|
92
92
|
<TableCell align="right">{getEditOptions(sub)}</TableCell>
|
|
93
93
|
</TableRow>
|