My goal is to sell subscriptions to two plans on my site. From tutorials online, it appears that the logical order of things would be:
Install paid plans app
Add membership app
Permission members for each of the two plans I intend to offer
My question however is how does the ‘login’ functionality fit into the above? Is a login button automatically added to the site for returning paying members/clients? Or will I have to add that somehow (via code?) later on?
When a visitor clicks the See More button, the button’s click event handler calls the to() function to open the dynamic page.
When a visitor clicks the Buy Now button for a free plan, the button’s click event handler calls the orderPlan() function to order the plan and opens a congratulations lightbox.
When a visitor clicks the Buy Now button for a plan that costs money, the button’s click event handler opens a confirmation lightbox.
When a visitor clicks Yes , the button’s event handler calls the orderPlan() function to order the plan.
The function checks if the user is logged in, and if not, prompts for login.
When the user is logged in, the function creates, and returns, an orderResult object.
A payment procedure is initiated using the ID from the orderResult object, causing a payment window to appear.
The visitor enters payment information and completes the transaction. This triggers the onPlanPurchased event, which returns a PlanPurchasedEvent object.
An event is logged in a collection. The event is based on the PlanPurchasedEvent object.