mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-10 15:03:12 -04:00
* feat: unify post payment actions * feat: handle stripe card error and add donation after auth * feat: add donation saga stripe test * feat: add more coverage to stripe tests * feat: add initial stripe card saga test * feat: finalize initial stripe card saga test * feat: add patreon test saga * feat: test clean up * feat: do not show processing for Patreon * feat: normalize donation settings * feat: turn payment provider/contex to enum * feat: remove donation-settings.js * fix: git ignore generated config * fix: ignore the generate config from everything * fix: remove types.js * fix: update linting to include types.js Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
16 lines
470 B
TypeScript
16 lines
470 B
TypeScript
import { PaymentContext, PaymentProvider } from '../components/Donation/types';
|
|
|
|
export function stringifyDonationEvents(
|
|
paymentContext: PaymentContext,
|
|
paymentProvider: PaymentProvider
|
|
): string {
|
|
const donationString = `${paymentContext} ${paymentProvider} payment ${
|
|
paymentProvider === 'patreon' ? 'redirection' : 'submission'
|
|
}`;
|
|
|
|
// return title case
|
|
return donationString.replace(/(^\w{1})|(\s+\w{1})/g, letter =>
|
|
letter.toUpperCase()
|
|
);
|
|
}
|