01-21-2017, 09:35 AM
I've been coding a user subscription system and I'm almost done. The last thing will be to add new functionality to the admin panel. My system uses Braintree (http://www.braintreepayments.com) as the payment processor. Currently I have completed...
* Subscription product data is stored in a table.
* A transaction log is kept in a table.
* Coupon codes are stored in a table.
* Users can subscribe to a product by paying.
* Users can get a discount by using a coupon code.
* Subscribed users are allowed to view certain restricted page(s) that correspond to the product they're subscribed to.
* Users can view their billing history.
* Users can unsubscribe.
* A custom API handles payments via ajax.
My code is clean and does not modify any of the base tables or code. The existing page access code and tables are used to manage access along with the new subscription system. When a user subscribes/pays, they're added to a UserSpice group using the built-in function. If they cancel or don't pay, they're similarly removed from that special group but can still login.
I've also coded an API that allows subscribed users to, through an ajax interface, add jobs to a job queue by filling out a form. The ajax page also lists their jobs in a table and shows other arbitrary stats related to my products (A service that runs server-side code). I have my site setup so that when a subscriber submits a job to the job queue, a PHP-CLI script thread forks to complete the job.
This can be used to create many types of online services. I'll probably post the code on GitHub as a fork when I'm done next week.
Any suggestions are welcome.
* Subscription product data is stored in a table.
* A transaction log is kept in a table.
* Coupon codes are stored in a table.
* Users can subscribe to a product by paying.
* Users can get a discount by using a coupon code.
* Subscribed users are allowed to view certain restricted page(s) that correspond to the product they're subscribed to.
* Users can view their billing history.
* Users can unsubscribe.
* A custom API handles payments via ajax.
My code is clean and does not modify any of the base tables or code. The existing page access code and tables are used to manage access along with the new subscription system. When a user subscribes/pays, they're added to a UserSpice group using the built-in function. If they cancel or don't pay, they're similarly removed from that special group but can still login.
I've also coded an API that allows subscribed users to, through an ajax interface, add jobs to a job queue by filling out a form. The ajax page also lists their jobs in a table and shows other arbitrary stats related to my products (A service that runs server-side code). I have my site setup so that when a subscriber submits a job to the job queue, a PHP-CLI script thread forks to complete the job.
This can be used to create many types of online services. I'll probably post the code on GitHub as a fork when I'm done next week.
Any suggestions are welcome.