Commit bfdb9198 authored by Stephanie Kirtiadi's avatar Stephanie Kirtiadi Committed by peterh-gr
Browse files

Removed donate-single and donate-monthly pages.

Issue #45530
parent f5e303b9
_model: donate-form
---
frequency: monthly
---
section:
---
title: Donate - Monthly
---
_template: layout.html
---
html: donate-form.html
_model: donate-form
---
frequency: single
---
_template: layout.html
---
html: donate-form.html
---
title: Donate - Single
......@@ -8,7 +8,7 @@ export function _ChampionsOfPrivacyGivingForm(props) {
return(
<React.Fragment>
<GivingForm
templateFrequency='champions-of-privacy'
frequencyOptions='champions-of-privacy'
stripe={stripe}
donateProccessorBaseUrl={donateProccessorBaseUrl}
/>
......
......@@ -2,10 +2,10 @@ import React from 'react';
import {FrequencyOptionButton} from './frequency_option_button';
export function FrequencySelector(props) {
const {templateFrequency, frequency, onFrequencySelection} = props;
const {frequencyOptions, frequency, onFrequencySelection} = props;
const renderButtons = () => {
if (templateFrequency != 'both') {
if (frequencyOptions != 'both') {
return null;
}
return (
......
......@@ -16,8 +16,8 @@ import {LoadingDialogReactPages} from './loading_dialog_react_pages';
import {FrequencySelector} from './frequency_selector';
export function _GivingForm(props) {
const {stripe, templateFrequency, donateProccessorBaseUrl} = props;
const [frequency, setFrequency] = useState(initialFrequency[templateFrequency]);
const {stripe, frequencyOptions, donateProccessorBaseUrl} = props;
const [frequency, setFrequency] = useState(initialFrequency[frequencyOptions]);
const displayPerkSelection = displayPerkSelections[frequency];
const [noPerk, setNoPerk] = useState(true);
const [selectedPrice, setSelectedPrice] = useState(initialSelectedPrices[frequency]);
......@@ -268,6 +268,7 @@ export function _GivingForm(props) {
'perk': perkData,
'recurring': recurring,
}),
credentials: 'include',
};
const result = await fetch(donateProccessorBaseUrl + '/process-stripe', options);
const data = await result.json();
......@@ -280,7 +281,7 @@ export function _GivingForm(props) {
setLoading(false);
newErrors.push(new NamedError('stripeError', errorMessage));
} else {
window.location.href = '/thank-you';
window.location.href = donateProccessorBaseUrl + '/thank-you';
}
} else if ('error' in tokenCreated) {
const errorMessage = tokenCreated['error'].message;
......@@ -389,7 +390,7 @@ export function _GivingForm(props) {
return(
<React.Fragment>
<FrequencySelector
templateFrequency={templateFrequency}
frequencyOptions={frequencyOptions}
frequency={frequency}
onFrequencySelection={onFrequencySelection}
/>
......
......@@ -17,7 +17,7 @@
name: 'GivingForm',
props: {
'stripePublishableKey': `{{ bag('donate', envvars('ENV'), 'stripePublishableKey') }}`,
'templateFrequency': `{{ this.frequency }}`,
'frequencyOptions': `{{ this.frequency }}`,
'donateProccessorBaseUrl': `{{ bag('donate', envvars('ENV'), 'donateProccessorBaseUrl') }}`
},
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment