Verified Commit 23560646 authored by Aral Balkan's avatar Aral Balkan
Browse files

Update readme with further details on Fund Us and Patronage pages

parent 89e58d92
......@@ -45,15 +45,43 @@ Standard pages and posts are added in the usual Hugo way, using `hugo new posts/
Repeated partials, such as the `layout/partials/fund-us.html` or `layout/partials/footer.html` copy are included in some templates. The fund-us partial can also be included within markdown files using the `{{ < fund-us > }}` shortcode.
## Testing the Fund Us flow and Patronage pages
## Fund Us and Patronage Pages
### Overview of implementation and where to find relevant files
The Fund Us page is a static page generated by Hugo.
The Patronage pages are _dynamic_ pages.
Both are served by Site.js.
### Fund Us page
- __Content:__ `/content/fund-us/`
- __Layout:__ `/layouts/fund-us/list.html`
The Fund Us page contains the funding form and uses the fully client-side Stripe Checkout flow. The payment form is hosted by Stripe and we simply redirect the donor to it once they’ve selected their donation type (donation or patronage) and amount. When they successfully complete a transation, they are either returned to `/fund-us/thank-you/` (for donations) or to their own patronage page, as specified by the inclusion of the Stripe session ID within the URL.
### Patronage page(s)
- __Content:__ /themes/small-tech/static/.dynamic/`
- __Layout:__ uses the page template generated by Hugo at `/content/template.md`
Within the `.dynamic` folder:
- `client/`: has client side HTML, CSS, and JS. The CSS and JS, along with patronage-specific variables are injected into the patron.html file which is then itself injected into the layout template specified above.
- `https/get/patron.js`: the HTTPS GET route that gets called by Stripe after a successful patronage subscription. This route renders the patronage page.
- `wss/patrong.js`: the websocket route. The patronage page communicates with this route via a WebSocket connection to allow for the updating, pausing, and cancellation of patronages using the Stripe API.
### Testing
Currently, it’s a bit more difficult to develop/test the Fund Us flow and Patronage pages as the former requires remote access to the machine you are testing on and the latter requires the Site.js server to serve the public directory (the `develop` and `stage` scripts, on the other hand, run Site.js to proxy Hugo’s server, which gets us live reload functionality for static content).
### To test the Fund Us donation flow
#### Fund Us donation flow
You can test the Fund Us Stripe flow using the `stage` script __for one-time donations only__. You cannot test the Stripe flow using the `develop` script, which runs a server at `localhost` instead of at your hostname.
### To test the Fund Us patronage flow and the Patronage pages
#### Fund Us patronage flow and the Patronage pages
Run the `funding` script instead of `stage`.
......
Markdown is supported
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