Week 011 — Subscriptions Find a Home

The subscription system grew up a little this week — from backend plumbing to something a user can actually see and manage.

Week of December 16, 2024

Progress

Finished the webhook fulfillment loop: invoice.payment_succeeded now triggers the full cycle — extracts the Stripe product IDs, matches them to internal records, and writes the subscription data to the database. A success page was added so users land somewhere meaningful after a completed payment instead of back at Stripe.

Subscription management was moved into the user profile page. Subscribe button, active subscription display, and management link — all accessible from the same place a user would go to update their information. The Subscribe option was removed from the main navigation. It doesn't belong there anyway; it belongs in the context of the user's account.

Started work on a new user flow: what happens when someone lands on the home page and wants to get started. The landing page needed content — what srchParty actually does and why it costs what it costs. Added a first pass at that copy and the structural table for the subscription tier breakdown.

The Hard Part

Getting a product list function working — needed to populate the subscription tier table on the home page — turned into a PHP include path problem. The products.php file was using its own includes and requires, and they conflicted with what was already loaded by the time the file was needed. The fix: strip all includes from products.php and handle the necessary requires earlier in the chain, in header.php where the rest of the common dependencies live. Also switched to PHP constants instead of variables for the globals that needed to be shared across scope boundaries — the same variable scoping issue from earlier in the project, resurfacing in a new context.

Next Week

The new user flow is in progress. The next piece is the sign-in/subscribe handoff: if a visitor clicks Subscribe without being logged in, they need to be sent through sign-in first and returned to the subscription page afterward.