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

Change process-stripe and captcha base url to donate site.

The lektor donate pages should request to the donate site urls
to process payment and get captcha image.
In Progress.

Issue #45530
parent 6a919d73
[prod]
paypalClientId = AbzwWJgUgwGMvTupfvigx1yAj75jNnCj4mFGC_VbiROUi2TfVwPS9IZ5MfqLsSUnXJFSMwaSaTR4FY_A
stripePublishableKey = pk_live_ZJWMhGlkSwhrqFlHisMRAADt
donateProccessorBaseUrl = https://donate.torproject.org
[dev]
paypalClientId = AZc7yGlGGXnOjwt55x4wRGbWHo7Fdj83JAu0lqYruVWVoYa7JfQhy5F_ucy2mR6CjPmpmJwmtHONjTeB
stripePublishableKey = pk_test_80ln4cUc48gRoPbB1SRPeSJr
donateProccessorBaseUrl = https://staging.donate.torproject.org
......@@ -3,13 +3,14 @@ import {injectStripe} from 'react-stripe-elements';
import {GivingForm} from './giving_form';
export function _ChampionsOfPrivacyGivingForm(props) {
const {stripe} = props;
const {stripe, donateProccessorBaseUrl} = props;
return(
<React.Fragment>
<GivingForm
templateFrequency='champions-of-privacy'
stripe={stripe}
donateProccessorBaseUrl={donateProccessorBaseUrl}
/>
</React.Fragment>
);
......
......@@ -16,7 +16,7 @@ import {LoadingDialogReactPages} from './loading_dialog_react_pages';
import {FrequencySelector} from './frequency_selector';
export function _GivingForm(props) {
const {stripe, templateFrequency} = props;
const {stripe, templateFrequency, donateProccessorBaseUrl} = props;
const [frequency, setFrequency] = useState(initialFrequency[templateFrequency]);
const displayPerkSelection = displayPerkSelections[frequency];
const [noPerk, setNoPerk] = useState(true);
......@@ -269,7 +269,7 @@ export function _GivingForm(props) {
'recurring': recurring,
}),
};
const result = await fetch('/process-stripe', options);
const result = await fetch(donateProccessorBaseUrl + '/process-stripe', options);
const data = await result.json();
if (data['errors'].length > 0) {
var errorMsgs = new Array();
......@@ -453,6 +453,7 @@ export function _GivingForm(props) {
onStripeFieldChange={onStripeFieldChange}
addError={addError}
displayPerkSelection={displayPerkSelection}
donateProccessorBaseUrl={donateProccessorBaseUrl}
/>
</div>
<GivingErrorContainer errors={errors} />
......
......@@ -14,7 +14,7 @@ import {StripeCreditCardForm} from './stripe_credit_card_form';
import {DonationInformation} from './donation_information';
export function GivingInfoForm(props) {
const {paymentMethod, mailingListOptIn, onMailingListOptInCheckboxChange, selectedPerk, perkOption, perkOptionProperties, shirtFits, sweatshirtSizes, frequency, selectedPrice, noPerk, selectedPerkFriendlyName, requiredFields, errors, textFields, priceOtherRef, formData, countryChanged, regionChanged, onInputFieldChange, fitsAndSizes, updateFitsAndSizes, stripeSubmitHandle, stripe, isValidEmail, validateRequiredFieldsAndDonationAmount, preparePerkData, prepareFieldsData, createBillingAgreement, onStripeFieldChange, addError, displayPerkSelection} = props;
const {paymentMethod, mailingListOptIn, onMailingListOptInCheckboxChange, selectedPerk, perkOption, perkOptionProperties, shirtFits, sweatshirtSizes, frequency, selectedPrice, noPerk, selectedPerkFriendlyName, requiredFields, errors, textFields, priceOtherRef, formData, countryChanged, regionChanged, onInputFieldChange, fitsAndSizes, updateFitsAndSizes, stripeSubmitHandle, stripe, isValidEmail, validateRequiredFieldsAndDonationAmount, preparePerkData, prepareFieldsData, createBillingAgreement, onStripeFieldChange, addError, displayPerkSelection, donateProccessorBaseUrl} = props;
const donationInformation = () => {
if (displayPerkSelection) {
......@@ -116,7 +116,7 @@ export function GivingInfoForm(props) {
{donationInformation()}
</div>
<div className="captcha">
Enter the following 4 letters (case insensitive) <img src="/captcha" border="0" />
Enter the following 4 letters (case insensitive) <img src={donateProccessorBaseUrl + "/captcha"} border="0" />
{getInputTextField('captcha')}
</div>
<DonateButton
......
......@@ -18,6 +18,7 @@
props: {
'stripePublishableKey': `{{ bag('donate', envvars('ENV'), 'stripePublishableKey') }}`,
'templateFrequency': `{{ 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