Commit Graph

2 Commits

Author SHA1 Message Date
Justin DiRose da9b58398b
FEATURE: Support for coupons in checkout (#41)
This adds support for Stripe Promo Codes in the user checkout process. 

Also adds a discounted field to User > Billing > Subscriptions to show the amount or percent discounted.

This does not currently add in support for creating promo codes in the Subscriptions interface (that will come at a later point in time). Instead a coupon can be created with a promo code right from the Stripe dashboard.
2021-01-07 15:25:44 -06:00
Justin DiRose 3a5078ded6
REFACTOR: Simplify controller setup (#24)
The code in the plugin needed a dramatic cleanup. This refactor collapses the Plan/Product/Subscription controllers on the backend into one new controller: `SubscribeController`.

This reduces N+1 calls to the back end during the subscription process and simplifies use of the code. 

I've also removed a bunch of dead code and refactored some logic into methods for easier readability. No feature/functionality changes in this commit; only refactoring. However, refactoring will allow for implementation of better anonymous user handling, so this is largely a foundation to enable making that change.
2020-10-21 13:36:31 -05:00