This component contains a membership sign up form. This form is embedded on our squarespace website for members to complete the registration process.
The form has two parts. The first collects membership information (e.g. name, email, school, etc).
The second displays PayPal payment buttons.
Once the user inputs their membership information and completes the Paypal payment, the form is submitted to the backend
(see membership-form-backend
).
This form is some simple HTML, CSS and Javascript. It has been purposefully kept simple.
The form is hosted on Google Firebase and then embedded on the squarespace website using on iframe.
The form can submit to three different endpoints depending on the environment (localhost, testing GCP project, production GCP project).
During the build process, the appropriate environment is selected. When testing locally, one must create the proper env.js
file (see below).
In this section, I discuss the different steps involved in developing to the form.
Here are the steps to run the form on your computer.
-
Clone this repository.
-
Copy
./environment/env.localhost.js
to./env.js
. This will specify to use the PayPal sandbox environment and localhost endpoint. -
Open
index.html
in your browser. -
Fill out the form and complete a PayPal purchase using a Personal PayPal Sandbox Account.
-
For the form submission to submit properly, you need to also be running
membership-form-backend
locally.
See the squarespace-iframe
component to see how to embed this form on squarespace.
While completing the form, check the following:
- All form questions render and are aesthetically pleasing.
- No spelling mistakes.
- Can't submit without the required fields.
- Can submit without the optional fields.
- PayPal payment window reflects the selected amount.
Right before paying, open the network tab in your browser developer tools. Complete the payment and then check the following in the POST request to the backend.
- Request is being sent to correct URL
- Request data contains every field with the data you inputted.
Changes will be automatically deployed by Google Cloud Build upon merging the changes to the remote master branch.