donationForm

Set the structure for the donation form

Parameters

Returns [type] [description]

donationThankYouPage

Donation thank you page set up. donationUrl & donationFormName are set in the wrapper, defined in _scripts.php

Parameters

resolveUrlConflicts

When a thank you page is reloaded it has duplicate parameters in the form ####.donation=xxxx. One parameter is for the doantion form and another one for the thank you page. This presents problems with display & analytics. This function strips out duplicates and redirects a user to the clean donation page.

Parameters

Returns [type] [description]

addCustomPaymentButtons

Adds Donate with ApplePay/Venmo submission buttons for those 2 external payment types. Adding them as separate buttons so it's easier to trigger the custom form submissions for those paymens.

Parameters

addCustomPaymentTypes

Adds custom payment types to the .internal-payment container, if present, otherwise to the .external-payment container, if present

Parameters

addCustomPayments

Adds custom payment types into DOM of the donation forms. Initializes the Braintree scripts and attached handlers

Parameters

fixPaymentMethodToggle

Fixes the payment methods toggle, as higher versions of jQuery break luminate default functionality

handleRecurringClick

Handles the form changes when the recurring payment is selected

Parameters

handleServerErrors

If the server returns an error, scrolls user to an error and records error in analytics

howDidYouHear

Creates the how did you hear drop down. $input is a hidden text input that will be submitted with the form.

Parameters

Returns [type] [description]

ifCheckedThenShow

If a field is checked, then show its content & make sure that hte required fields are validated.

Parameters

modifyCreditCardSection

Makes all the necessary modification to the credit card row

Parameters

modifyExpirationDateRow

Adds "Month" & "Year" to expiration date dropdowns. Updates HTML for ease of styling

modifyHeadings

Adds a custom classes to headings based on it's content, for ease of toggling things with CSS

modifyHonorFields

Modifies the structure of the honor fields, to look as expected. Attaches the handlers to the Dedicate my donation checkbox.

Parameters

modifyOtherInput

Updates the input to number if there is no premium area. Sets up validation on the other input

Parameters

Returns [type] [description]

modifyPaymentTypes

Modifies payment types section

Returns [type] [description]

populateDonationReceipt

Populates the receipt with the information from variables. This is used for 3rd party payment receipts.

Parameters

Returns [type] [description]

prependRequiredLabels

Prepend required field labels with an asterisk for each row, doing this to have an ability to do more complex logic as HTML is not uniform

setActiveDonationLevel

Sets an active class on a donation level label when a donation amount is selected.

Must be called on container that contains both radios and labels, in Luminate Online it's .donation-level-input-container

checkPremiumArea

Checks the premium area and decides if we need to do something about it.

Returns [type] [description]

handleCustomPaymentSubmission

Handles the callback of the successful, validated form submission. Stops the submission of 3rd party payments & calls custom functions from a plugin on those submissions. Allows the standard Luminate submissions to just go through.

Parameters

Returns Boolean True if the form should proceed with a normal submission, false if the form should not submit normally.

modifyDonationRow

consHowDidYouHear is a global variable that is set in reus_how_did_you_hear pagebuilder reusable that's inserted in the wrapper

Parameters

modifyDonationRow

This function is executed on each row of the donaiton form. The necessary styling adjustments are made on each row as needed.

Parameters

Returns [type] [description]

modifyOneHeading

Adds a custom class to a heading based on it's content, for ease of toggling things with CSS

Parameters

setFormValidation

Sets the form validation on the donation form inputs. Sets all the conditional dependencies, so we don't have to do it with JS on our end.

Parameters

setInputValidationAttributes

Sets validation attributes on all inputs of the donation form. This determines the validation logic dependencies for the form.

Parameters

showHideHonorFields

Handles the showing and hiding of the Honor/Tribute elements on page

Parameters

showHidePremiumArea

Shows or hides premium area based on the donation parameters that have been selected

Parameters

updateDonationFormAnalytics

Sets the analytics on the donation form initially and updates it on form changes

Parameters

Returns Object An object with final properties, the value is only used for testing

updateDonationFormAnalytics

donationPrivateFormName is global JS variable, it is set on donation pages in the wrapper, the code for it defined in _scripts.php file memberStatus is global JS variable, it is set on donation, eccommerce and teamraiser pages in the wrapper, the code for it defined in _scripts.php file teamraiserEventName is global JS variable, it is set on teamraiser donation pages in the wrapper, the code for it defined in _scripts.php file

Parameters

setTransactionAnalytics

We are on donation page

setAnalyticsForm

We are on a donation thank you page

$body

stcBraintreePlugin is a third party Braintree payment plugig JS object. Setting it into global scope as we use it in a callback function, that's a callback to validation function, which is hard to pass by reference.