Commit Graph

224 Commits

Author SHA1 Message Date
Justin DiRose d60c5b6d54
UX: fix incorrect text on cancel button 2020-09-16 09:49:45 -05:00
Justin DiRose bdcaaf9897
UX: i18ninize string 2020-09-16 09:44:44 -05:00
Justin DiRose 4457713901
FEATURE: Show renewal date on uncanceled subscriptions 2020-08-19 15:08:38 -05:00
Justin DiRose a868e6b838
FEATURE: Cancel payments at end of subscription vs immediately
Previously, when a user canceled a subscription, the access would revoke
immediately on Discourse vs. at the end of the billing period. This
commit changes the behavior to remove membership at the end of the
billing period using Stripe's `cancel_at_period_end` attribute on the
Subscription object.

This commit now requires the setup of webhooks for subscription
processing to occur correctly.
2020-08-19 14:37:47 -05:00
Justin DiRose 83002fab3c
FEATURE: New styling of product page 2020-07-28 12:46:59 -05:00
Justin DiRose 954beeb094
FIX: Properly show information on saved plans 2020-07-28 11:56:58 -05:00
Justin DiRose 0a244111bc
FIX: Buttons out of alignment on some browsers 2020-07-28 11:49:15 -05:00
Justin DiRose 587661fafb
FEATURE: Allow one-time purchases on products (#18)
Building off the foundation of using the Prices API, this PR adds the ability to create a one-time purchase plan for any product, which then can add a user to the specified plan group.

Some things to be aware of:

    One-time purchases cannot have trials.
    One-time purchases use the Invoice API instead of Subscriptions. Invoices are created then charged immediately.
    Users should receive emails for these invoices directly from Stripe just like subscriptions.
2020-07-22 11:06:34 -05:00
Justin DiRose c9ff55b46a
REFACTOR: Use the Prices API in place of Plans (#17)
Stripe has a newer API called Prices where you can create a price for any product and it can either be recurring or one-time. The easy part is existing Plans work with the Prices API by passing a Plan ID, but objects are returned in the slightly-different Prices API object format.

This commit is a refactor to the new API to handle the data in its new form, and lays the foundation for a one time payment plan to be added to any subscriptions product.
2020-07-15 08:44:40 -05:00
Justin DiRose 9c46794e80
DEV: Remove deprecations & improve error handling (#12)
- Replace deprecated methods on client
- Fix broken dropdowns due to select kit 2 upgrade
- Graceful error handling when Stripe keys are not configured but plugin enabled
2020-05-28 10:32:57 -05:00
Justin DiRose fb4fac197b
REFACTOR: Use models to store data (#11)
* REFACTOR: Use api to add subscribe link

* FIX: I18n subscribe link

* REFACTOR: Use models to store some data

This enables the plugin to show only subscription information which was
generated on Discourse. Subscription data storage is limited to the
external identifiers Stripe generates so we can interact with the API.

* DEV: Test/linting fixes/rake task
2020-05-22 11:20:05 -05:00
Rimian Perkins 48c606908a disable billing interval when cannot change 2020-03-21 20:30:30 +11:00
Rimian Perkins 2bc780c4f9 Merge branch 'feature/one-time-payment' of github.com:rimian/discourse-subscriptions into feature/one-time-payment 2019-12-18 08:47:17 +11:00
Rimian Perkins 49ac965b24 tidy some scss class names etc 2019-12-18 08:47:01 +11:00
Rimian Perkins 9176471551 toggle single payments allowed setting 2019-12-17 21:14:13 +11:00
Rimian Perkins 52db93ecd8 user payments page 2019-12-17 16:31:58 +11:00
Rimian Perkins 38c444c489 tidy scss a bit 2019-12-16 13:59:58 +11:00
Rimian Perkins 7d3ca0421a rm old donation form 2019-12-16 10:59:59 +11:00
Rimian Perkins b79eed42ef redirect and rm activity connector 2019-12-16 10:47:59 +11:00
Rimian Perkins 55f4592033 subscription and billing templates 2019-12-16 10:42:55 +11:00
Rimian Perkins 8264930e92 user activity link to payments 2019-12-13 13:44:25 +11:00
Rimian Perkins 4b334a69b5 remove subscribe index 2019-12-13 11:54:32 +11:00
Rimian Perkins 57fb508514 buttons for selecting price and one time payment 2019-12-13 10:41:14 +11:00
Rimian Perkins 831e64317b refactor models, routes and buttons 2019-12-12 12:59:26 +11:00
Rimian Perkins ff1740d035 validate plan 2019-12-10 10:55:24 +11:00
Rimian Perkins 86bc9bb3e6 rm redundant action 2019-12-10 10:15:30 +11:00
Rimian Perkins 1c31884475 show the plans in the buttons proper 2019-12-09 12:01:10 +11:00
Rimian Perkins 71d6c6dab2 display the plan in the plan buttons 2019-12-09 10:30:34 +11:00
Rimian Perkins d3eed3546d test button click 2019-12-06 14:33:38 +11:00
Rimian Perkins 2ce314fc8d initial payment buttons component 2019-12-06 13:52:03 +11:00
Rimian Perkins 09bfe419d8 set new product inactive by default 2019-12-05 17:07:26 +11:00
Rimian Perkins 7db60e2c4b tidy up the user subscription list 2019-12-05 14:59:07 +11:00
Rimian Perkins 21b8340f4f rename the translations 2019-12-04 09:29:13 +11:00
Rimian Perkins 08cbff0c1c change engine mount point and base path in jsapp 2019-12-03 10:29:44 +11:00
Rimian Perkins 382fd4ac41 name space the js admin 2019-12-02 18:58:14 +11:00
Rimian Perkins 709aebb593 set the currency in the plan 2019-11-30 16:39:28 +11:00
Rimian Perkins 947ec4338e css the card 2019-11-29 15:08:51 +11:00
Rimian Perkins 7580b68711 rm extra line in product page 2019-11-29 10:16:00 +11:00
Rimian Perkins 298e70b32a delete customer record 2019-11-28 20:44:38 +11:00
Rimian Perkins e5753095d8 cannot subscribe to a product twice 2019-11-28 20:11:48 +11:00
Rimian Perkins ca00b530aa show the product name in subscription lists 2019-11-27 10:48:30 +11:00
Rimian Perkins 3e4fd76891 show product and plan nickname in admin 2019-11-26 12:55:49 +11:00
Rimian Perkins b3b7d88481 spinner on subscription cancel 2019-11-14 14:07:45 +11:00
Rimian Perkins d9b5aa6a35 loading on subscription page 2019-11-14 13:43:18 +11:00
Rimian Perkins 3999e1f7fd style the product page a bit 2019-11-14 11:13:12 +11:00
Rimian Perkins 399dca953a Merge branch 'feature/logged-in-subscribe-page' of github.com:rimian/discourse-patrons into feature/logged-in-subscribe-page 2019-11-14 10:51:27 +11:00
Rimian Perkins 6590d8051c delete subscriptions in admin 2019-11-14 10:51:04 +11:00
Rimian Perkins 370566b570 only show subscribe buttons when logged in 2019-11-14 09:47:15 +11:00
Rimian Perkins 5fdd81ac77 link to user admin 2019-11-13 15:27:32 +11:00
Rimian Perkins 8aed6b8d30 add link to user 2019-11-13 14:21:21 +11:00