@churchapps/apphelper 1.3.5 → 1.4.0
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/components/ImageEditor.js +2 -2
- package/dist/components/ImageEditor.js.map +1 -1
- package/dist/components/Loading.d.ts.map +1 -1
- package/dist/components/Loading.js +5 -1
- package/dist/components/Loading.js.map +1 -1
- package/dist/donations/helpers/Locale.d.ts.map +1 -1
- package/dist/donations/helpers/Locale.js +1 -0
- package/dist/donations/helpers/Locale.js.map +1 -1
- package/dist/donations/providers/kingdomfunding/KingdomFundingNonAuthDonationInner.d.ts.map +1 -1
- package/dist/donations/providers/kingdomfunding/KingdomFundingNonAuthDonationInner.js +18 -7
- package/dist/donations/providers/kingdomfunding/KingdomFundingNonAuthDonationInner.js.map +1 -1
- package/dist/donations/providers/paypal/PayPalNonAuthDonationInner.d.ts.map +1 -1
- package/dist/donations/providers/paypal/PayPalNonAuthDonationInner.js +20 -9
- package/dist/donations/providers/paypal/PayPalNonAuthDonationInner.js.map +1 -1
- package/dist/donations/providers/paystack/PaystackNonAuthDonationInner.d.ts.map +1 -1
- package/dist/donations/providers/paystack/PaystackNonAuthDonationInner.js +21 -9
- package/dist/donations/providers/paystack/PaystackNonAuthDonationInner.js.map +1 -1
- package/dist/donations/providers/stripe/ExpressCheckout.d.ts +13 -0
- package/dist/donations/providers/stripe/ExpressCheckout.d.ts.map +1 -0
- package/dist/donations/providers/stripe/ExpressCheckout.js +45 -0
- package/dist/donations/providers/stripe/ExpressCheckout.js.map +1 -0
- package/dist/donations/providers/stripe/NonAuthDonationInner.d.ts +2 -0
- package/dist/donations/providers/stripe/NonAuthDonationInner.d.ts.map +1 -1
- package/dist/donations/providers/stripe/NonAuthDonationInner.js +117 -33
- package/dist/donations/providers/stripe/NonAuthDonationInner.js.map +1 -1
- package/dist/donations/providers/stripe/StripeProvider.d.ts.map +1 -1
- package/dist/donations/providers/stripe/StripeProvider.js +1 -1
- package/dist/donations/providers/stripe/StripeProvider.js.map +1 -1
- package/dist/helpers/Locale.d.ts.map +1 -1
- package/dist/helpers/Locale.js +2 -0
- package/dist/helpers/Locale.js.map +1 -1
- package/dist/helpers/SubscriptionManager.d.ts.map +1 -1
- package/dist/helpers/SubscriptionManager.js +6 -0
- package/dist/helpers/SubscriptionManager.js.map +1 -1
- package/dist/login/components/SsoButtons.d.ts.map +1 -1
- package/dist/login/components/SsoButtons.js +4 -3
- package/dist/login/components/SsoButtons.js.map +1 -1
- package/dist/login/helpers/Locale.d.ts.map +1 -1
- package/dist/login/helpers/Locale.js +2 -0
- package/dist/login/helpers/Locale.js.map +1 -1
- package/dist/markdown/components/htmlEditor/HtmlEditorInner.d.ts.map +1 -1
- package/dist/markdown/components/htmlEditor/HtmlEditorInner.js +2 -1
- package/dist/markdown/components/htmlEditor/HtmlEditorInner.js.map +1 -1
- package/dist/markdown/components/markdownEditor/Editor.d.ts.map +1 -1
- package/dist/markdown/components/markdownEditor/Editor.js +4 -1
- package/dist/markdown/components/markdownEditor/Editor.js.map +1 -1
- package/dist/markdown/components/markdownEditor/plugins/MarkdownTransformers.d.ts.map +1 -1
- package/dist/markdown/components/markdownEditor/plugins/MarkdownTransformers.js +2 -0
- package/dist/markdown/components/markdownEditor/plugins/MarkdownTransformers.js.map +1 -1
- package/dist/markdown/components/markdownEditor/plugins/ToolbarPlugin.d.ts.map +1 -1
- package/dist/markdown/components/markdownEditor/plugins/ToolbarPlugin.js +22 -2
- package/dist/markdown/components/markdownEditor/plugins/ToolbarPlugin.js.map +1 -1
- package/dist/markdown/components/markdownEditor/plugins/image/ImageNode.d.ts +30 -0
- package/dist/markdown/components/markdownEditor/plugins/image/ImageNode.d.ts.map +1 -0
- package/dist/markdown/components/markdownEditor/plugins/image/ImageNode.js +81 -0
- package/dist/markdown/components/markdownEditor/plugins/image/ImageNode.js.map +1 -0
- package/dist/markdown/components/markdownEditor/plugins/image/ImageTransformer.d.ts +3 -0
- package/dist/markdown/components/markdownEditor/plugins/image/ImageTransformer.d.ts.map +1 -0
- package/dist/markdown/components/markdownEditor/plugins/image/ImageTransformer.js +20 -0
- package/dist/markdown/components/markdownEditor/plugins/image/ImageTransformer.js.map +1 -0
- package/dist/public/locales/ar.json +298 -339
- package/dist/public/locales/cs.json +298 -339
- package/dist/public/locales/da.json +298 -339
- package/dist/public/locales/de.json +298 -339
- package/dist/public/locales/en.json +303 -392
- package/dist/public/locales/es.json +298 -339
- package/dist/public/locales/fi.json +298 -339
- package/dist/public/locales/fr.json +298 -339
- package/dist/public/locales/hi.json +298 -339
- package/dist/public/locales/hu.json +298 -339
- package/dist/public/locales/id.json +298 -339
- package/dist/public/locales/it.json +298 -339
- package/dist/public/locales/ja.json +298 -339
- package/dist/public/locales/ko.json +298 -339
- package/dist/public/locales/lt.json +298 -333
- package/dist/public/locales/nl.json +298 -339
- package/dist/public/locales/no.json +298 -339
- package/dist/public/locales/pl.json +298 -339
- package/dist/public/locales/pt.json +298 -339
- package/dist/public/locales/ro.json +298 -339
- package/dist/public/locales/ru.json +298 -339
- package/dist/public/locales/sk.json +298 -339
- package/dist/public/locales/sl.json +298 -339
- package/dist/public/locales/sr.json +298 -339
- package/dist/public/locales/sv.json +298 -339
- package/dist/public/locales/tl.json +298 -339
- package/dist/public/locales/tr.json +298 -339
- package/dist/public/locales/uk.json +298 -339
- package/dist/public/locales/vi.json +298 -339
- package/dist/public/locales/zh.json +298 -339
- package/dist/website/components/Theme.d.ts.map +1 -1
- package/dist/website/components/Theme.js +15 -9
- package/dist/website/components/Theme.js.map +1 -1
- package/dist/website/components/elementTypes/MapElement.d.ts +1 -1
- package/dist/website/components/elementTypes/MapElement.d.ts.map +1 -1
- package/dist/website/components/elementTypes/MapElement.js +10 -7
- package/dist/website/components/elementTypes/MapElement.js.map +1 -1
- package/package.json +2 -2
|
@@ -29,6 +29,7 @@ export const PaystackNonAuthDonationInner = ({ mainContainerCssProps, showHeader
|
|
|
29
29
|
const [searchParams, setSearchParams] = useState(null);
|
|
30
30
|
const [notes, setNotes] = useState("");
|
|
31
31
|
const [coverFees, setCoverFees] = useState(false);
|
|
32
|
+
const [anonymous, setAnonymous] = useState(false);
|
|
32
33
|
const captchaRef = useRef(null);
|
|
33
34
|
const currency = gateway?.currency || "ngn";
|
|
34
35
|
const fmt = (amount) => CurrencyHelper.formatCurrencyWithLocale(amount, currency);
|
|
@@ -70,15 +71,20 @@ export const PaystackNonAuthDonationInner = ({ mainContainerCssProps, showHeader
|
|
|
70
71
|
})
|
|
71
72
|
.catch(() => setCaptchaResponse("error"));
|
|
72
73
|
};
|
|
74
|
+
const handleAnonymousChange = (_e, checked) => {
|
|
75
|
+
setAnonymous(checked);
|
|
76
|
+
if (checked)
|
|
77
|
+
setDonationType("once");
|
|
78
|
+
};
|
|
73
79
|
const handleCheckChange = (_e, checked) => {
|
|
74
80
|
setCoverFees(checked);
|
|
75
81
|
setTotal(checked ? fundsTotal + transactionFee : fundsTotal);
|
|
76
82
|
};
|
|
77
83
|
const validate = () => {
|
|
78
84
|
const result = [];
|
|
79
|
-
if (!firstName)
|
|
85
|
+
if (!anonymous && !firstName)
|
|
80
86
|
result.push(Locale.label("donation.donationForm.validate.firstName"));
|
|
81
|
-
if (!lastName)
|
|
87
|
+
if (!anonymous && !lastName)
|
|
82
88
|
result.push(Locale.label("donation.donationForm.validate.lastName"));
|
|
83
89
|
if (!email)
|
|
84
90
|
result.push(Locale.label("donation.donationForm.validate.email"));
|
|
@@ -102,9 +108,14 @@ export const PaystackNonAuthDonationInner = ({ mainContainerCssProps, showHeader
|
|
|
102
108
|
}
|
|
103
109
|
setProcessing(true);
|
|
104
110
|
try {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
111
|
+
if (anonymous) {
|
|
112
|
+
await processDonation(null);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
await ApiHelper.post("/users/loadOrCreate", { userEmail: email, firstName, lastName }, "MembershipApi");
|
|
116
|
+
const person = await ApiHelper.post("/people/loadOrCreate", { churchId: props.churchId, firstName, lastName, email }, "MembershipApi");
|
|
117
|
+
await processDonation(person);
|
|
118
|
+
}
|
|
108
119
|
}
|
|
109
120
|
catch (ex) {
|
|
110
121
|
setErrors([ex.toString()]);
|
|
@@ -115,7 +126,7 @@ export const PaystackNonAuthDonationInner = ({ mainContainerCssProps, showHeader
|
|
|
115
126
|
const compactFunds = fundDonations
|
|
116
127
|
.filter(fd => (fd.amount || 0) > 0 && fd.fundId)
|
|
117
128
|
.map(fd => ({ id: fd.fundId, amount: fd.amount || 0 }));
|
|
118
|
-
const personPayload = { id: person?.id || "", email: person?.contactInfo?.email || email, name: person?.name?.display || `${firstName} ${lastName}` };
|
|
129
|
+
const personPayload = { id: person?.id || "", email: person?.contactInfo?.email || email, name: anonymous ? "" : (person?.name?.display || `${firstName} ${lastName}`) };
|
|
119
130
|
let reference;
|
|
120
131
|
try {
|
|
121
132
|
const result = await openPaystackPopup({
|
|
@@ -143,7 +154,8 @@ export const PaystackNonAuthDonationInner = ({ mainContainerCssProps, showHeader
|
|
|
143
154
|
notes,
|
|
144
155
|
church: { name: church?.name || "", subDomain: church?.subDomain || "", churchURL: typeof window !== "undefined" ? window.location.origin : "", logo: props?.churchLogo || "" },
|
|
145
156
|
type: "card",
|
|
146
|
-
id: reference
|
|
157
|
+
id: reference,
|
|
158
|
+
anonymous
|
|
147
159
|
};
|
|
148
160
|
if (donationType === "recurring") {
|
|
149
161
|
payload.billing_cycle_anchor = startDate ? +new Date(startDate) : +new Date();
|
|
@@ -202,8 +214,8 @@ export const PaystackNonAuthDonationInner = ({ mainContainerCssProps, showHeader
|
|
|
202
214
|
useEffect(init, []);
|
|
203
215
|
if (donationComplete)
|
|
204
216
|
return _jsx(Alert, { severity: "success", children: Locale.label("donation.donationForm.thankYou") });
|
|
205
|
-
return (_jsxs(InputBox, { headerIcon: showHeader ? "volunteer_activism" : "", headerText: showHeader ? Locale.label("donation.donationForm.donate") : "", saveFunction: handleSave, saveText: Locale.label("donation.donationForm.donate"), isSubmitting: processing, mainContainerCssProps: mainContainerCssProps, children: [_jsx(ErrorMessages, { errors: errors }), _jsxs(Grid, { container: true, spacing: 3, children: [props.allowRecurring !== false && (_jsxs(_Fragment, { children: [_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(Button, { "aria-label": "single-donation", size: "small", fullWidth: true, style: { minHeight: "50px" }, variant: donationType === "once" ? "contained" : "outlined", onClick: () => setDonationType("once"), children: Locale.label("donation.donationForm.make") }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(Button, { "aria-label": "recurring-donation", size: "small", fullWidth: true, style: { minHeight: "50px" }, variant: donationType === "recurring" ? "contained" : "outlined", onClick: () => setDonationType("recurring"), children: Locale.label("donation.donationForm.makeRecurring") }) })] })), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, label: Locale.label("person.firstName"), name: "firstName", value: firstName, onChange: handleChange }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, label: Locale.label("person.lastName"), name: "lastName", value: lastName, onChange: handleChange }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, label: Locale.label("person.email"), name: "email", value: email, onChange: handleChange }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(ReCAPTCHA, { sitekey: props.recaptchaSiteKey, ref: captchaRef, onChange: handleCaptchaChange, onExpired: () => setCaptchaResponse(""), onErrored: () => setCaptchaResponse("error") }) })] }), gateway?.publicKey
|
|
217
|
+
return (_jsxs(InputBox, { headerIcon: showHeader ? "volunteer_activism" : "", headerText: showHeader ? Locale.label("donation.donationForm.donate") : "", saveFunction: handleSave, saveText: Locale.label("donation.donationForm.donate"), isSubmitting: processing, mainContainerCssProps: mainContainerCssProps, children: [_jsx(ErrorMessages, { errors: errors }), _jsxs(Grid, { container: true, spacing: 3, children: [props.allowRecurring !== false && !anonymous && (_jsxs(_Fragment, { children: [_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(Button, { "aria-label": "single-donation", size: "small", fullWidth: true, style: { minHeight: "50px" }, variant: donationType === "once" ? "contained" : "outlined", onClick: () => setDonationType("once"), children: Locale.label("donation.donationForm.make") }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(Button, { "aria-label": "recurring-donation", size: "small", fullWidth: true, style: { minHeight: "50px" }, variant: donationType === "recurring" ? "contained" : "outlined", onClick: () => setDonationType("recurring"), children: Locale.label("donation.donationForm.makeRecurring") }) })] })), !anonymous && (_jsxs(_Fragment, { children: [_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, label: Locale.label("person.firstName"), name: "firstName", value: firstName, onChange: handleChange }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, label: Locale.label("person.lastName"), name: "lastName", value: lastName, onChange: handleChange }) })] })), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, label: Locale.label("person.email"), name: "email", value: email, onChange: handleChange }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(ReCAPTCHA, { sitekey: props.recaptchaSiteKey, ref: captchaRef, onChange: handleCaptchaChange, onExpired: () => setCaptchaResponse(""), onErrored: () => setCaptchaResponse("error") }) })] }), gateway?.publicKey
|
|
206
218
|
? _jsx(Typography, { variant: "body2", color: "text.secondary", sx: { mt: 2 }, "data-testid": "paystack-entry", children: Locale.label("donation.paystack.popupHint") })
|
|
207
|
-
: _jsx(Alert, { severity: "warning", sx: { mt: 2 }, children: Locale.label("donation.kingdomFunding.gatewayConfigMissing") }), donationType === "recurring" && (_jsxs(Grid, { container: true, spacing: 3, style: { marginTop: 16 }, children: [_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsxs(FormControl, { fullWidth: true, children: [_jsx(InputLabel, { children: Locale.label("donation.donationForm.frequency") }), _jsxs(Select, { label: "Frequency", name: "interval", "aria-label": "interval", value: interval, onChange: (e) => setInterval(e.target.value), children: [_jsx(MenuItem, { value: "one_week", children: Locale.label("donation.donationForm.weekly") }), _jsx(MenuItem, { value: "one_month", children: Locale.label("donation.donationForm.monthly") }), _jsx(MenuItem, { value: "three_month", children: Locale.label("donation.donationForm.quarterly") }), _jsx(MenuItem, { value: "one_year", children: Locale.label("donation.donationForm.annually") })] })] }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, type: "date", name: "startDate", "aria-label": "startDate", label: Locale.label("donation.donationForm.startDate"), value: DateHelper.formatHtml5Date(startDate ? new Date(startDate) : new Date()), onChange: handleChange }) })] })), funds.length > 0 && props.showFundSelector !== false && (_jsxs(_Fragment, { children: [_jsx("hr", {}), _jsx("h4", { children: Locale.label("donation.donationForm.funds") }), _jsx(FundDonations, { fundDonations: fundDonations, funds: funds, params: searchParams, updatedFunction: handleFundDonationsChange })] })), _jsx(TextField, { fullWidth: true, label: Locale.label("donation.kingdomFunding.memo"), multiline: true, "aria-label": "note", name: "notes", value: notes, onChange: handleChange, style: { marginTop: 10, marginBottom: 10 } }), fundsTotal > 0 && (_jsxs("div", { children: [gateway?.payFees === true ? (_jsxs(Typography, { fontSize: 14, fontStyle: "italic", children: ["*", Locale.label("donation.donationForm.fees").replace("{}", fmt(transactionFee))] })) : (_jsx(FormGroup, { children: _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: coverFees }), name: "transaction-fee", label: Locale.label("donation.donationForm.cover").replace("{}", fmt(transactionFee)), onChange: handleCheckChange }) })), _jsxs("p", { children: [Locale.label("donation.donationForm.total"), ": ", fmt(total)] })] }))] }));
|
|
219
|
+
: _jsx(Alert, { severity: "warning", sx: { mt: 2 }, children: Locale.label("donation.kingdomFunding.gatewayConfigMissing") }), donationType === "recurring" && (_jsxs(Grid, { container: true, spacing: 3, style: { marginTop: 16 }, children: [_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsxs(FormControl, { fullWidth: true, children: [_jsx(InputLabel, { children: Locale.label("donation.donationForm.frequency") }), _jsxs(Select, { label: "Frequency", name: "interval", "aria-label": "interval", value: interval, onChange: (e) => setInterval(e.target.value), children: [_jsx(MenuItem, { value: "one_week", children: Locale.label("donation.donationForm.weekly") }), _jsx(MenuItem, { value: "one_month", children: Locale.label("donation.donationForm.monthly") }), _jsx(MenuItem, { value: "three_month", children: Locale.label("donation.donationForm.quarterly") }), _jsx(MenuItem, { value: "one_year", children: Locale.label("donation.donationForm.annually") })] })] }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, type: "date", name: "startDate", "aria-label": "startDate", label: Locale.label("donation.donationForm.startDate"), value: DateHelper.formatHtml5Date(startDate ? new Date(startDate) : new Date()), onChange: handleChange }) })] })), funds.length > 0 && props.showFundSelector !== false && (_jsxs(_Fragment, { children: [_jsx("hr", {}), _jsx("h4", { children: Locale.label("donation.donationForm.funds") }), _jsx(FundDonations, { fundDonations: fundDonations, funds: funds, params: searchParams, updatedFunction: handleFundDonationsChange })] })), _jsx(TextField, { fullWidth: true, label: Locale.label("donation.kingdomFunding.memo"), multiline: true, "aria-label": "note", name: "notes", value: notes, onChange: handleChange, style: { marginTop: 10, marginBottom: 10 } }), _jsx(FormGroup, { children: _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: anonymous, inputProps: { "aria-label": "anonymous" } }), name: "anonymous", label: Locale.label("donation.donationForm.anonymous"), onChange: handleAnonymousChange }) }), fundsTotal > 0 && (_jsxs("div", { children: [gateway?.payFees === true ? (_jsxs(Typography, { fontSize: 14, fontStyle: "italic", children: ["*", Locale.label("donation.donationForm.fees").replace("{}", fmt(transactionFee))] })) : (_jsx(FormGroup, { children: _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: coverFees }), name: "transaction-fee", label: Locale.label("donation.donationForm.cover").replace("{}", fmt(transactionFee)), onChange: handleCheckChange }) })), _jsxs("p", { children: [Locale.label("donation.donationForm.total"), ": ", fmt(total)] })] }))] }));
|
|
208
220
|
};
|
|
209
221
|
//# sourceMappingURL=PaystackNonAuthDonationInner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaystackNonAuthDonationInner.js","sourceRoot":"","sources":["../../../../src/donations/providers/paystack/PaystackNonAuthDonationInner.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EACL,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EACzE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,EAClD,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAcpD,MAAM,CAAC,MAAM,4BAA4B,GAAoB,CAAC,EAAE,qBAAqB,EAAE,UAAU,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACtH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC7C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAS,CA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AI,EAAE,IAAI,EAAC,WAAW,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,EAAE,QAAQ,EAAE,qBAAqB,GAAI,GAC1M,EAEX,UAAU,GAAG,CAAC,IAAI,CACjB,0BACG,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAC3B,MAAC,UAAU,IAAC,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAC,QAAQ,kBAAG,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC,IAAc,CAC3I,CAAC,CAAC,CAAC,CACF,KAAC,SAAS,cACR,KAAC,gBAAgB,IAAC,OAAO,EAAE,KAAC,QAAQ,IAAC,OAAO,EAAE,SAAS,GAAI,EAAE,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,GAAI,GAChM,CACb,EACD,wBAAI,MAAM,CAAC,KAAK,CAAC,6BAA6B,CAAC,QAAI,GAAG,CAAC,KAAK,CAAC,IAAK,IAC9D,CACP,IACQ,CACZ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Stripe } from "@stripe/stripe-js";
|
|
3
|
+
export type WalletConfirm = (paymentMethodId: string, name: string, email: string) => Promise<boolean>;
|
|
4
|
+
interface Props {
|
|
5
|
+
stripePromise?: Promise<Stripe | null> | null;
|
|
6
|
+
amount: number;
|
|
7
|
+
currency: string;
|
|
8
|
+
onConfirm: WalletConfirm;
|
|
9
|
+
onError: (messages: string[]) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const StripeExpressCheckout: React.FC<Props>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=ExpressCheckout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpressCheckout.d.ts","sourceRoot":"","sources":["../../../../src/donations/providers/stripe/ExpressCheckout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,MAAM,EAA4C,MAAM,mBAAmB,CAAC;AAI1F,MAAM,MAAM,aAAa,GAAG,CAAC,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEvG,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACvC;AA0CD,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAgBjD,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Elements, ExpressCheckoutElement, useElements, useStripe } from "@stripe/react-stripe-js";
|
|
5
|
+
import { Box, Divider } from "@mui/material";
|
|
6
|
+
import { Locale } from "../../helpers";
|
|
7
|
+
const ExpressCheckoutInner = ({ onConfirm, onError }) => {
|
|
8
|
+
const stripe = useStripe();
|
|
9
|
+
const elements = useElements();
|
|
10
|
+
const [available, setAvailable] = useState(false);
|
|
11
|
+
const handleConfirm = async (event) => {
|
|
12
|
+
if (!stripe || !elements)
|
|
13
|
+
return;
|
|
14
|
+
const { error: submitError } = await elements.submit();
|
|
15
|
+
if (submitError) {
|
|
16
|
+
onError([submitError.message || Locale.label("donation.donationForm.walletFailed")]);
|
|
17
|
+
event.paymentFailed({ reason: "fail" });
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const { error, paymentMethod } = await stripe.createPaymentMethod({ elements });
|
|
21
|
+
if (error || !paymentMethod) {
|
|
22
|
+
onError([error?.message || Locale.label("donation.donationForm.walletFailed")]);
|
|
23
|
+
event.paymentFailed({ reason: "invalid_payment_data" });
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const success = await onConfirm(paymentMethod.id, event.billingDetails?.name || "", event.billingDetails?.email || "");
|
|
27
|
+
if (!success)
|
|
28
|
+
event.paymentFailed({ reason: "fail" });
|
|
29
|
+
};
|
|
30
|
+
return (_jsxs(_Fragment, { children: [_jsx(ExpressCheckoutElement, { options: {
|
|
31
|
+
emailRequired: true,
|
|
32
|
+
buttonHeight: 48,
|
|
33
|
+
paymentMethods: { link: "never", amazonPay: "never", paypal: "never", klarna: "never" }
|
|
34
|
+
}, onReady: (event) => setAvailable(!!event.availablePaymentMethods), onConfirm: handleConfirm }), available && _jsx(Divider, { sx: { mt: 2 }, children: Locale.label("donation.donationForm.orPayWith") })] }));
|
|
35
|
+
};
|
|
36
|
+
// Wallets need their own deferred-intent Elements group; the card fields keep the outer one.
|
|
37
|
+
export const StripeExpressCheckout = ({ stripePromise, amount, currency, onConfirm, onError }) => {
|
|
38
|
+
const lower = (currency || "usd").toLowerCase();
|
|
39
|
+
// Stripe wants the smallest currency unit, and zero-decimal currencies are already there.
|
|
40
|
+
const minorAmount = lower === "jpy" ? Math.round(amount) : Math.trunc(Math.round(amount * 100));
|
|
41
|
+
if (!stripePromise || minorAmount < 50)
|
|
42
|
+
return null;
|
|
43
|
+
return (_jsx(Box, { "data-testid": "express-checkout", sx: { mb: 2 }, children: _jsx(Elements, { stripe: stripePromise, options: { mode: "payment", amount: minorAmount, currency: lower, paymentMethodCreation: "manual" }, children: _jsx(ExpressCheckoutInner, { onConfirm: onConfirm, onError: onError }) }) }));
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=ExpressCheckout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpressCheckout.js","sourceRoot":"","sources":["../../../../src/donations/providers/stripe/ExpressCheckout.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEnG,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAYvC,MAAM,oBAAoB,GAAmD,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;IACtG,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,MAAM,aAAa,GAAG,KAAK,EAAE,KAA+C,EAAE,EAAE;QAC9E,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ;YAAE,OAAO;QACjC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAC;QACvD,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,CAAC,CAAC,WAAW,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC,CAAC,CAAC;YACrF,KAAK,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YACxC,OAAO;QACT,CAAC;QACD,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CA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AE,EAAE,EAAE;IAChH,MAAM,KAAK,GAAG,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IAChD,0FAA0F;IAC1F,MAAM,WAAW,GAAG,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC;IAChG,IAAI,CAAC,aAAa,IAAI,WAAW,GAAG,EAAE;QAAE,OAAO,IAAI,CAAC;IAEpD,OAAO,CACL,KAAC,GAAG,mBAAa,kBAAkB,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,YAC/C,KAAC,QAAQ,IACP,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,YAEnG,KAAC,oBAAoB,IAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAI,GACvD,GACP,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { PaperProps } from "@mui/material/Paper";
|
|
3
|
+
import type { Stripe } from "@stripe/stripe-js";
|
|
3
4
|
interface Props {
|
|
4
5
|
churchId: string;
|
|
5
6
|
mainContainerCssProps?: PaperProps;
|
|
@@ -12,6 +13,7 @@ interface Props {
|
|
|
12
13
|
showFundSelector?: boolean;
|
|
13
14
|
allowedFundIds?: string[];
|
|
14
15
|
defaultFundId?: string;
|
|
16
|
+
stripePromise?: Promise<Stripe | null> | null;
|
|
15
17
|
}
|
|
16
18
|
export declare const NonAuthDonationInner: React.FC<Props>;
|
|
17
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonAuthDonationInner.d.ts","sourceRoot":"","sources":["../../../../src/donations/providers/stripe/NonAuthDonationInner.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAS3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,UAAU,KAAK;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,UAAU,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"NonAuthDonationInner.d.ts","sourceRoot":"","sources":["../../../../src/donations/providers/stripe/NonAuthDonationInner.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAS3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,UAAU,KAAK;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,UAAU,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;CAC/C;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAmlBhD,CAAC"}
|
|
@@ -6,10 +6,11 @@ import ReCAPTCHA from "react-google-recaptcha";
|
|
|
6
6
|
import { ErrorMessages, InputBox } from "../../../index";
|
|
7
7
|
import { FundDonations } from "../../components";
|
|
8
8
|
import { ApiHelper, DateHelper, CurrencyHelper } from "@churchapps/helpers";
|
|
9
|
-
import { Locale, DonationHelper } from "../../helpers";
|
|
9
|
+
import { Locale, DonationHelper, StripePaymentMethod } from "../../helpers";
|
|
10
10
|
import { handle3DSIfRequired } from "./stripe3DS";
|
|
11
11
|
import { Grid, Alert, TextField, Button, FormControl, InputLabel, Select, MenuItem, FormGroup, FormControlLabel, Checkbox, Typography, Box, CircularProgress } from "@mui/material";
|
|
12
12
|
import { collectStripeBank } from "./stripeBank";
|
|
13
|
+
import { StripeExpressCheckout } from "./ExpressCheckout";
|
|
13
14
|
export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true, ...props }) => {
|
|
14
15
|
const allowSingleGift = props.allowSingleGift !== false;
|
|
15
16
|
const allowRecurring = props.allowRecurring !== false;
|
|
@@ -39,6 +40,7 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
39
40
|
const [searchParams, setSearchParams] = useState(null);
|
|
40
41
|
const [notes, setNotes] = useState("");
|
|
41
42
|
const [coverFees, setCoverFees] = useState(false);
|
|
43
|
+
const [anonymous, setAnonymous] = useState(false);
|
|
42
44
|
const [bankConnecting, setBankConnecting] = useState(false);
|
|
43
45
|
const captchaRef = useRef(null);
|
|
44
46
|
const paymentType = props.paymentType || "card";
|
|
@@ -71,10 +73,25 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
71
73
|
ApiHelper.get(`/donate/gateways/${props.churchId}`, "GivingApi").then((response) => {
|
|
72
74
|
const gateways = Array.isArray(response?.gateways) ? response.gateways : [];
|
|
73
75
|
const stripeGateway = DonationHelper.findGatewayByProvider(gateways, "stripe");
|
|
74
|
-
if (stripeGateway)
|
|
76
|
+
if (stripeGateway) {
|
|
75
77
|
setGateway(stripeGateway);
|
|
78
|
+
registerWalletDomain();
|
|
79
|
+
}
|
|
76
80
|
});
|
|
77
81
|
};
|
|
82
|
+
// Apple Pay only offers itself on a Stripe-verified domain; Google Pay needs nothing.
|
|
83
|
+
const registerWalletDomain = () => {
|
|
84
|
+
if (typeof window === "undefined")
|
|
85
|
+
return;
|
|
86
|
+
const key = "b1-wallet-domain-" + props.churchId + "-" + window.location.hostname;
|
|
87
|
+
try {
|
|
88
|
+
if (window.sessionStorage.getItem(key))
|
|
89
|
+
return;
|
|
90
|
+
window.sessionStorage.setItem(key, "1");
|
|
91
|
+
}
|
|
92
|
+
catch { /* storage blocked; registering again is harmless */ }
|
|
93
|
+
ApiHelper.postAnonymous("/donate/register-domain", { churchId: props.churchId, domain: window.location.hostname }, "GivingApi").catch(() => { });
|
|
94
|
+
};
|
|
78
95
|
const handleCaptchaChange = (value) => {
|
|
79
96
|
if (value) {
|
|
80
97
|
ApiHelper.postAnonymous("/donate/captcha-verify", { token: value }, "GivingApi")
|
|
@@ -99,45 +116,57 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
99
116
|
setCaptchaResponse("");
|
|
100
117
|
}
|
|
101
118
|
};
|
|
119
|
+
const handleAnonymousChange = (_e, checked) => {
|
|
120
|
+
setAnonymous(checked);
|
|
121
|
+
if (checked)
|
|
122
|
+
setDonationType("once");
|
|
123
|
+
};
|
|
102
124
|
const handleCheckChange = (_e, checked) => {
|
|
103
125
|
setCoverFees(checked);
|
|
104
126
|
const totalPayAmount = checked ? fundsTotal + transactionFee : fundsTotal;
|
|
105
127
|
setTotal(totalPayAmount);
|
|
106
128
|
};
|
|
129
|
+
const captchaError = () => {
|
|
130
|
+
if (!_captchaResponse)
|
|
131
|
+
return "Please complete the reCAPTCHA verification";
|
|
132
|
+
if (_captchaResponse === "robot")
|
|
133
|
+
return "reCAPTCHA verification failed - detected as robot. Please try again.";
|
|
134
|
+
if (_captchaResponse === "error")
|
|
135
|
+
return "reCAPTCHA verification error. Please try again.";
|
|
136
|
+
if (_captchaResponse !== "success")
|
|
137
|
+
return `reCAPTCHA verification unexpected response: ${_captchaResponse}`;
|
|
138
|
+
return null;
|
|
139
|
+
};
|
|
107
140
|
const handleSave = async () => {
|
|
108
141
|
if (validate()) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
if (_captchaResponse === "robot") {
|
|
114
|
-
setErrors(["reCAPTCHA verification failed - detected as robot. Please try again."]);
|
|
142
|
+
const captchaMessage = captchaError();
|
|
143
|
+
if (captchaMessage) {
|
|
144
|
+
setErrors([captchaMessage]);
|
|
115
145
|
return;
|
|
116
146
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
147
|
+
setProcessing(true);
|
|
148
|
+
if (anonymous) {
|
|
149
|
+
if (paymentType === "bank")
|
|
150
|
+
saveBank();
|
|
151
|
+
else
|
|
152
|
+
saveCard();
|
|
123
153
|
return;
|
|
124
154
|
}
|
|
125
|
-
setProcessing(true);
|
|
126
155
|
ApiHelper.post("/users/loadOrCreate", { userEmail: email, firstName, lastName }, "MembershipApi")
|
|
127
156
|
.catch((ex) => { setErrors([ex.toString()]); setProcessing(false); })
|
|
128
|
-
.then(async (
|
|
157
|
+
.then(async () => {
|
|
129
158
|
const personData = { churchId: props.churchId, firstName, lastName, email };
|
|
130
159
|
const person = await ApiHelper.post("/people/loadOrCreate", personData, "MembershipApi");
|
|
131
160
|
if (paymentType === "bank") {
|
|
132
|
-
saveBank(
|
|
161
|
+
saveBank(person);
|
|
133
162
|
}
|
|
134
163
|
else {
|
|
135
|
-
saveCard(
|
|
164
|
+
saveCard(person);
|
|
136
165
|
}
|
|
137
166
|
});
|
|
138
167
|
}
|
|
139
168
|
};
|
|
140
|
-
const saveCard = async (
|
|
169
|
+
const saveCard = async (person) => {
|
|
141
170
|
if (gateway?.provider?.toLowerCase() !== "stripe") {
|
|
142
171
|
setErrors(["Stripe payment processing not available for this gateway"]);
|
|
143
172
|
setProcessing(false);
|
|
@@ -154,8 +183,12 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
154
183
|
setErrors([stripePM.error.message || "Payment method error"]);
|
|
155
184
|
setProcessing(false);
|
|
156
185
|
}
|
|
186
|
+
else if (anonymous) {
|
|
187
|
+
// Nothing is vaulted for an anonymous gift, so the payment method is charged without a customer.
|
|
188
|
+
saveDonation(new StripePaymentMethod({ id: stripePM.paymentMethod.id, type: "card" }));
|
|
189
|
+
}
|
|
157
190
|
else {
|
|
158
|
-
const pm = { id: stripePM.paymentMethod.id, personId: person
|
|
191
|
+
const pm = { id: stripePM.paymentMethod.id, personId: person?.id, email: email, name: person?.name?.display || "", churchId: props.churchId };
|
|
159
192
|
await ApiHelper.post("/paymentmethods/addcard", { ...pm, provider: gateway?.provider || "stripe", gatewayId: gateway?.id }, "GivingApi").then((result) => {
|
|
160
193
|
if (result?.raw?.message) {
|
|
161
194
|
setErrors([result.raw.message]);
|
|
@@ -168,7 +201,7 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
168
201
|
});
|
|
169
202
|
}
|
|
170
203
|
};
|
|
171
|
-
const saveBank = async (
|
|
204
|
+
const saveBank = async (person) => {
|
|
172
205
|
if (!stripe) {
|
|
173
206
|
setErrors(["Payment processing unavailable"]);
|
|
174
207
|
setProcessing(false);
|
|
@@ -179,7 +212,7 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
179
212
|
// Get ACH setup intent from anonymous endpoint
|
|
180
213
|
const setupResponse = await ApiHelper.postAnonymous("/paymentmethods/ach-setup-intent-anon", {
|
|
181
214
|
email,
|
|
182
|
-
name: `${firstName} ${lastName}`,
|
|
215
|
+
name: anonymous ? "Anonymous Donor" : `${firstName} ${lastName}`,
|
|
183
216
|
churchId: props.churchId,
|
|
184
217
|
gatewayId: gateway?.id
|
|
185
218
|
}, "GivingApi");
|
|
@@ -189,7 +222,7 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
189
222
|
setBankConnecting(false);
|
|
190
223
|
return;
|
|
191
224
|
}
|
|
192
|
-
const { error: confirmError, setupIntent } = await collectStripeBank(stripe, setupResponse.clientSecret, gateway?.currency, { name: `${firstName} ${lastName}`, email });
|
|
225
|
+
const { error: confirmError, setupIntent } = await collectStripeBank(stripe, setupResponse.clientSecret, gateway?.currency, { name: anonymous ? "Anonymous Donor" : `${firstName} ${lastName}`, email });
|
|
193
226
|
if (confirmError) {
|
|
194
227
|
setErrors([confirmError.message || "Failed to confirm bank account"]);
|
|
195
228
|
setProcessing(false);
|
|
@@ -206,7 +239,7 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
206
239
|
funds: fundDonations.map(fd => ({ id: fd.fundId || "", amount: fd.amount || 0 })),
|
|
207
240
|
person: {
|
|
208
241
|
id: person?.id || "",
|
|
209
|
-
email: person?.contactInfo?.email ||
|
|
242
|
+
email: person?.contactInfo?.email || email,
|
|
210
243
|
name: person?.name?.display || ""
|
|
211
244
|
},
|
|
212
245
|
notes
|
|
@@ -222,7 +255,8 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
222
255
|
church: churchObj,
|
|
223
256
|
provider: "stripe",
|
|
224
257
|
gatewayId: gateway?.id,
|
|
225
|
-
currency: gateway?.currency || "USD"
|
|
258
|
+
currency: gateway?.currency || "USD",
|
|
259
|
+
anonymous
|
|
226
260
|
}, "GivingApi");
|
|
227
261
|
if (results?.status === "succeeded" || results?.status === "pending" || results?.status === "processing") {
|
|
228
262
|
setDonationComplete(true);
|
|
@@ -237,7 +271,53 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
237
271
|
setProcessing(false);
|
|
238
272
|
setBankConnecting(false);
|
|
239
273
|
};
|
|
240
|
-
|
|
274
|
+
// Wallet sheets supply the donor's name and email, so the form fields above stay optional here.
|
|
275
|
+
const handleWalletConfirm = async (paymentMethodId, walletName, walletEmail) => {
|
|
276
|
+
const donorEmail = walletEmail || email;
|
|
277
|
+
if (!donorEmail) {
|
|
278
|
+
setErrors([Locale.label("donation.donationForm.validate.email")]);
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
const captchaMessage = captchaError();
|
|
282
|
+
if (captchaMessage) {
|
|
283
|
+
setErrors([captchaMessage]);
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
setProcessing(true);
|
|
287
|
+
setErrors([]);
|
|
288
|
+
const nameParts = (walletName || `${firstName} ${lastName}`).trim().split(/\s+/);
|
|
289
|
+
const donorFirst = firstName || nameParts[0] || "";
|
|
290
|
+
const donorLast = lastName || nameParts.slice(1).join(" ") || "";
|
|
291
|
+
try {
|
|
292
|
+
if (anonymous) {
|
|
293
|
+
// Nothing is vaulted for an anonymous gift, so the wallet payment method is charged without a customer or person.
|
|
294
|
+
return await saveDonation(new StripePaymentMethod({ id: paymentMethodId, type: "card" }), undefined, undefined, donorEmail);
|
|
295
|
+
}
|
|
296
|
+
await ApiHelper.post("/users/loadOrCreate", { userEmail: donorEmail, firstName: donorFirst, lastName: donorLast }, "MembershipApi");
|
|
297
|
+
const person = await ApiHelper.post("/people/loadOrCreate", { churchId: props.churchId, firstName: donorFirst, lastName: donorLast, email: donorEmail }, "MembershipApi");
|
|
298
|
+
const result = await ApiHelper.post("/paymentmethods/addcard", {
|
|
299
|
+
id: paymentMethodId,
|
|
300
|
+
personId: person.id,
|
|
301
|
+
email: donorEmail,
|
|
302
|
+
name: person?.name?.display || "",
|
|
303
|
+
churchId: props.churchId,
|
|
304
|
+
provider: gateway?.provider || "stripe",
|
|
305
|
+
gatewayId: gateway?.id
|
|
306
|
+
}, "GivingApi");
|
|
307
|
+
if (result?.raw?.message) {
|
|
308
|
+
setErrors([result.raw.message]);
|
|
309
|
+
setProcessing(false);
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
return await saveDonation(result.paymentMethod, result.customerId, person);
|
|
313
|
+
}
|
|
314
|
+
catch (ex) {
|
|
315
|
+
setErrors([ex?.message || ex?.toString() || "An unexpected error occurred. Please try again."]);
|
|
316
|
+
setProcessing(false);
|
|
317
|
+
return false;
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
const saveDonation = async (paymentMethod, customerId, person, receiptEmail) => {
|
|
241
321
|
const donation = {
|
|
242
322
|
amount: total,
|
|
243
323
|
id: paymentMethod.id,
|
|
@@ -247,7 +327,7 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
247
327
|
funds: [],
|
|
248
328
|
person: {
|
|
249
329
|
id: person?.id || "",
|
|
250
|
-
email: person?.contactInfo?.email ||
|
|
330
|
+
email: person?.contactInfo?.email || receiptEmail || email,
|
|
251
331
|
name: person?.name?.display || ""
|
|
252
332
|
},
|
|
253
333
|
notes: notes
|
|
@@ -273,7 +353,8 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
273
353
|
church: churchObj,
|
|
274
354
|
provider: gateway?.provider || "stripe",
|
|
275
355
|
gatewayId: gateway?.id,
|
|
276
|
-
currency: gateway?.currency || "USD"
|
|
356
|
+
currency: gateway?.currency || "USD",
|
|
357
|
+
anonymous
|
|
277
358
|
};
|
|
278
359
|
if (donationType === "once")
|
|
279
360
|
results = await ApiHelper.post("/donate/charge", donationPayload, "GivingApi");
|
|
@@ -289,12 +370,14 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
289
370
|
setErrors([threeDSResult.error || "Authentication failed."]);
|
|
290
371
|
}
|
|
291
372
|
setProcessing(false);
|
|
292
|
-
return;
|
|
373
|
+
return threeDSResult.success;
|
|
293
374
|
}
|
|
375
|
+
let succeeded = true;
|
|
294
376
|
if (results?.status === "succeeded" || results?.status === "pending" || results?.status === "active" || results?.status === "processing") {
|
|
295
377
|
setDonationComplete(true);
|
|
296
378
|
}
|
|
297
379
|
else {
|
|
380
|
+
succeeded = false;
|
|
298
381
|
// Handle any error case
|
|
299
382
|
if (results?.raw?.message) {
|
|
300
383
|
setErrors([results?.raw?.message]);
|
|
@@ -307,12 +390,13 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
307
390
|
}
|
|
308
391
|
}
|
|
309
392
|
setProcessing(false);
|
|
393
|
+
return succeeded;
|
|
310
394
|
};
|
|
311
395
|
const validate = () => {
|
|
312
396
|
const result = [];
|
|
313
|
-
if (!firstName)
|
|
397
|
+
if (!anonymous && !firstName)
|
|
314
398
|
result.push(Locale.label("donation.donationForm.validate.firstName"));
|
|
315
|
-
if (!lastName)
|
|
399
|
+
if (!anonymous && !lastName)
|
|
316
400
|
result.push(Locale.label("donation.donationForm.validate.lastName"));
|
|
317
401
|
if (!email)
|
|
318
402
|
result.push(Locale.label("donation.donationForm.validate.email"));
|
|
@@ -394,12 +478,12 @@ export const NonAuthDonationInner = ({ mainContainerCssProps, showHeader = true,
|
|
|
394
478
|
if (donationComplete)
|
|
395
479
|
return _jsx(Alert, { severity: "success", children: Locale.label("donation.donationForm.thankYou") });
|
|
396
480
|
else {
|
|
397
|
-
return (_jsxs(InputBox, { headerIcon: showHeader ? "volunteer_activism" : "", headerText: showHeader ? "Donate" : "", saveFunction: handleSave, saveText: "Donate", isSubmitting: processing || bankConnecting, mainContainerCssProps: mainContainerCssProps, children: [_jsx(ErrorMessages, { errors: errors }), _jsxs(Grid, { container: true, spacing: 3, children: [paymentType !== "bank" && allowSingleGift && allowRecurring && (_jsxs(_Fragment, { children: [_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(Button, { "aria-label": "single-donation", size: "small", fullWidth: true, style: { minHeight: "50px" }, variant: donationType === "once" ? "contained" : "outlined", onClick: () => setDonationType("once"), children: Locale.label("donation.donationForm.make") }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(Button, { "aria-label": "recurring-donation", size: "small", fullWidth: true, style: { minHeight: "50px" }, variant: donationType === "recurring" ? "contained" : "outlined", onClick: () => setDonationType("recurring"), children: Locale.label("donation.donationForm.makeRecurring") }) })] })), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, label: Locale.label("person.firstName"), name: "firstName", value: firstName, onChange: handleChange }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, label: Locale.label("person.lastName"), name: "lastName", value: lastName, onChange: handleChange }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, label: Locale.label("person.email"), name: "email", value: email, onChange: handleChange }) }), !bypassRecaptcha && (_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(ReCAPTCHA, { sitekey: props.recaptchaSiteKey, ref: captchaRef, onChange: handleCaptchaChange, onExpired: () => {
|
|
481
|
+
return (_jsxs(InputBox, { headerIcon: showHeader ? "volunteer_activism" : "", headerText: showHeader ? "Donate" : "", saveFunction: handleSave, saveText: "Donate", isSubmitting: processing || bankConnecting, mainContainerCssProps: mainContainerCssProps, children: [_jsx(ErrorMessages, { errors: errors }), donationType === "once" && total > 0 && gateway?.provider?.toLowerCase() === "stripe" && (_jsx(StripeExpressCheckout, { stripePromise: props.stripePromise, amount: total, currency: gateway?.currency || "USD", onConfirm: handleWalletConfirm, onError: setErrors })), _jsxs(Grid, { container: true, spacing: 3, children: [paymentType !== "bank" && allowSingleGift && allowRecurring && !anonymous && (_jsxs(_Fragment, { children: [_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(Button, { "aria-label": "single-donation", size: "small", fullWidth: true, style: { minHeight: "50px" }, variant: donationType === "once" ? "contained" : "outlined", onClick: () => setDonationType("once"), children: Locale.label("donation.donationForm.make") }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(Button, { "aria-label": "recurring-donation", size: "small", fullWidth: true, style: { minHeight: "50px" }, variant: donationType === "recurring" ? "contained" : "outlined", onClick: () => setDonationType("recurring"), children: Locale.label("donation.donationForm.makeRecurring") }) })] })), !anonymous && (_jsxs(_Fragment, { children: [_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, label: Locale.label("person.firstName"), name: "firstName", value: firstName, onChange: handleChange }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, label: Locale.label("person.lastName"), name: "lastName", value: lastName, onChange: handleChange }) })] })), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, label: Locale.label("person.email"), name: "email", value: email, onChange: handleChange }) }), !bypassRecaptcha && (_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(ReCAPTCHA, { sitekey: props.recaptchaSiteKey, ref: captchaRef, onChange: handleCaptchaChange, onExpired: () => {
|
|
398
482
|
setCaptchaResponse("");
|
|
399
483
|
}, onErrored: () => {
|
|
400
484
|
setCaptchaResponse("error");
|
|
401
485
|
} }) }))] }), gateway?.provider?.toLowerCase() === "stripe" && paymentType === "bank" ? (_jsxs(Box, { sx: { textAlign: "center", py: 3, px: 2, mt: 2, border: "1px solid #CCC", borderRadius: 1 }, children: [_jsx(Typography, { variant: "body1", sx: { mb: 2 }, children: "Securely connect your bank account using Stripe Financial Connections." }), _jsx(Typography, { variant: "body2", color: "text.secondary", children: "You'll log in to your bank to authorize the connection. Your credentials are never shared." }), bankConnecting && (_jsxs(Box, { sx: { display: "flex", alignItems: "center", justifyContent: "center", gap: 2, mt: 2 }, children: [_jsx(CircularProgress, { size: 24 }), _jsx(Typography, { children: "Connecting to your bank..." })] }))] })) : gateway?.provider?.toLowerCase() === "stripe" && (_jsxs(Grid, { container: true, spacing: 3, style: { marginTop: 10 }, children: [_jsx(Grid, { size: 12, children: _jsx("div", { style: { padding: 10, border: "1px solid #CCC", borderRadius: 5 }, children: _jsx(CardNumberElement, { options: formStyling }) }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx("div", { style: { padding: 10, border: "1px solid #CCC", borderRadius: 5 }, children: _jsx(CardExpiryElement, { options: formStyling }) }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx("div", { style: { padding: 10, border: "1px solid #CCC", borderRadius: 5 }, children: _jsx(CardCvcElement, { options: formStyling }) }) })] })), donationType === "recurring" && paymentType !== "bank"
|
|
402
|
-
&& _jsxs(Grid, { container: true, spacing: 3, style: { marginTop: 0 }, children: [_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsxs(FormControl, { fullWidth: true, children: [_jsx(InputLabel, { children: Locale.label("donation.donationForm.frequency") }), _jsxs(Select, { label: "Frequency", name: "interval", "aria-label": "interval", value: interval, onChange: (e) => { setInterval(e.target.value); }, children: [_jsx(MenuItem, { value: "one_week", children: Locale.label("donation.donationForm.weekly") }), _jsx(MenuItem, { value: "two_week", children: Locale.label("donation.donationForm.biWeekly") }), _jsx(MenuItem, { value: "one_month", children: Locale.label("donation.donationForm.monthly") }), _jsx(MenuItem, { value: "three_month", children: Locale.label("donation.donationForm.quarterly") }), _jsx(MenuItem, { value: "one_year", children: Locale.label("donation.donationForm.annually") })] })] }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, name: "startDate", type: "date", "aria-label": "startDate", label: Locale.label("donation.donationForm.startDate"), value: DateHelper.formatHtml5Date(startDate ? new Date(startDate) : new Date()), onChange: handleChange }) })] }), getFundList(), _jsx(TextField, { fullWidth: true, label: "Memo (optional)", multiline: true, "aria-label": "note", name: "notes", value: notes, onChange: handleChange, style: { marginTop: 10, marginBottom: 10 } }), _jsx("div", { children: fundsTotal > 0
|
|
486
|
+
&& _jsxs(Grid, { container: true, spacing: 3, style: { marginTop: 0 }, children: [_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsxs(FormControl, { fullWidth: true, children: [_jsx(InputLabel, { children: Locale.label("donation.donationForm.frequency") }), _jsxs(Select, { label: "Frequency", name: "interval", "aria-label": "interval", value: interval, onChange: (e) => { setInterval(e.target.value); }, children: [_jsx(MenuItem, { value: "one_week", children: Locale.label("donation.donationForm.weekly") }), _jsx(MenuItem, { value: "two_week", children: Locale.label("donation.donationForm.biWeekly") }), _jsx(MenuItem, { value: "one_month", children: Locale.label("donation.donationForm.monthly") }), _jsx(MenuItem, { value: "three_month", children: Locale.label("donation.donationForm.quarterly") }), _jsx(MenuItem, { value: "one_year", children: Locale.label("donation.donationForm.annually") })] })] }) }), _jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsx(TextField, { fullWidth: true, name: "startDate", type: "date", "aria-label": "startDate", label: Locale.label("donation.donationForm.startDate"), value: DateHelper.formatHtml5Date(startDate ? new Date(startDate) : new Date()), onChange: handleChange }) })] }), getFundList(), _jsx(TextField, { fullWidth: true, label: "Memo (optional)", multiline: true, "aria-label": "note", name: "notes", value: notes, onChange: handleChange, style: { marginTop: 10, marginBottom: 10 } }), _jsx(FormGroup, { children: _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: anonymous, inputProps: { "aria-label": "anonymous" } }), name: "anonymous", label: Locale.label("donation.donationForm.anonymous"), onChange: handleAnonymousChange }) }), _jsx("div", { children: fundsTotal > 0
|
|
403
487
|
&& _jsxs(_Fragment, { children: [(gateway?.payFees === true)
|
|
404
488
|
? _jsxs(Typography, { fontSize: 14, fontStyle: "italic", children: ["*", Locale.label("donation.donationForm.fees").replace("{}", CurrencyHelper.formatCurrencyWithLocale(transactionFee, gateway?.currency || "USD"))] })
|
|
405
489
|
: (_jsx(FormGroup, { children: _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: coverFees }), name: "transaction-fee", label: Locale.label("donation.donationForm.cover").replace("{}", CurrencyHelper.formatCurrencyWithLocale(transactionFee, gateway?.currency || "USD")), onChange: handleCheckChange }) })), _jsxs("p", { children: ["Total Donation Amount: ", CurrencyHelper.formatCurrencyWithLocale(total, gateway?.currency || "USD")] })] }) })] }));
|