Commit Graph
880 Commits
Author SHA1 Message Date
Justin DiRose a282475da3 FEATURE: Admin > Subscriptions Pagination (#50)
Meta topic: https://meta.discourse.org/t/subscriptions-add-pagination-to-admin-subscriptions-view/172500

This adds support for pagination using our `{{load-more}}` component in core. Implementation on the backend was a bit tricky because we don't return all results from Stripe, only those that match local subscriptions stored in the `DiscourseSubscriptions::Subscription` model.
2021-02-05 11:57:53 -06:00
Discourse Translator Bot eaf1729f6f Update translations (#49) 2021-02-02 14:37:20 +01:00
Justin DiRose 072b558d40 FEATURE: Give option to repurchase products multiple times (#46)
Feature requested here: https://meta.discourse.org/t/subscriptions-allow-users-to-purchase-one-time-products-multiple-times/173732/

There may be cases where a site admin wants to allow the repurchasing of a product. This implements the functionality by adding a repurchaseable toggle in the admin screen when creating a product. This saves an attribute to the Stripe product metadata.

When a user has already purchased an item with this toggle enabled, they will be able to purchase it again when browsing to `/s`.
2021-01-31 14:17:44 -06:00
Joffrey JAFFEUX 3f8fca3246 DEV: prettier 2.2.1 (#48) 2021-01-27 10:38:33 +01:00
Discourse Translator Bot 49c49fe36e Update translations (#47) 2021-01-26 14:48:14 +01:00
Discourse Translator Bot 1c298d8fa4 Update translations (#45) 2021-01-19 15:47:39 +01:00
Justin DiRose 400313cded FEATURE: Allow creation of coupons in admin panel (#43)
Adds full support to create coupon/promo codes in the Admin > Plugins > Subscriptions section of the plugin. The Create Coupon button opens a form on the same page, and the active checkboxes toggle the active status of the coupon code.
2021-01-13 11:47:22 -06:00
Discourse Translator Bot a6de862ba9 Update translations (#42) 2021-01-12 14:27:02 +01:00
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 70b96cf3b8 FIX: Properly show one time payments in user billing (#40)
Encountered a bug where some one time payments were not showing under User > Billing > Payments. This was due to a simple error in the logic
2021-01-06 14:01:16 -06:00
Justin DiRose b6de4a7b67 DEV: Bump Stripe API gem to 5.29.0 (#38)
Bumping the API gem to 5.29.0 and to the latest API version. This takes into account changes in the API over the last few months and also lays the groundwork for some other improvements to the plugin (namely promo codes).
2021-01-06 13:36:50 -06:00
8036dba315 DEV: Update CI workflows (#36)
* DEV: Update CI workflows
* DEV: Fix linting

Co-authored-by: Justin DiRose <[email protected]>
Co-authored-by: Jarek Radosz <[email protected]>
2021-01-05 01:08:58 +01:00
Roman Rizzi 088b8d2239 REFACTOR: Use the new format for acceptance tests. (#37) 2021-01-04 16:32:33 -03:00
Discourse Translator Bot 0b5f740db5 Update translations (#35) 2020-12-01 14:33:30 +01:00
Justin DiRose 443fdc3ec6 DEV: Transition from Ember constant to imports (#34) 2020-11-30 10:35:21 -06:00
Justin DiRose d430098bad FIX: Properly allow no group to be selected (#33) 2020-11-24 14:52:00 -06:00
Discourse Translator Bot 52817018aa Update translations (#32) 2020-11-24 17:21:39 +01:00
Discourse Translator Bot e2485b58a1 Update translations (#31) 2020-11-03 18:06:40 +01:00
Justin DiRose 17bd58afa4 DEV: CI Updates (#30) 2020-11-02 11:57:36 -06:00
Justin DiRose be9e9c0117 FIX: Make URLs subfolder friendly (#29)
Not all URLs in Subscriptions were not subfolder install friendly. This commit uses link-to in places its needed to properly set URLs if on a subfolder install.
2020-11-02 10:20:31 -06:00
Justin DiRose b92627677f FEATURE: Implement refunds from dashboard (#27)
An implementation of refunds from the Admin dashboard. To refund, go to Plugins > Subscriptions > Subscriptions then click the `Cancel` button. You'll be presented with a modal. If you wish to refund only the most recent payment, check the box. 

This only implements refunds for Subscriptions, not One Time Payments. One Time Payments will still need to be handled manually at this time.
2020-10-29 10:31:12 -05:00
Justin DiRose b950926538 FIX: Payments could not complete (#28)
Due to putting the Stripe Elements HTML inside an if block in the
template, this caused state to be funky. As a result, calling
`this.stripe.createToken` failed to return a promise. Opted instead to
hide the elements via CSS for anonymous users to prevent this
showstopping bug.
2020-10-29 10:21:14 -05:00
Justin DiRose 1ad5b17640 FEATURE: Better UX for anonymous users (#25)
Improves the subscription flow for anonymous users by making the routes available, and showing a login button. Clicking login from this page will save a `destination_url` cookie so that when logging in they're redirected back to the subscription page they were at.
2020-10-28 13:30:26 -05:00
Discourse Translator Bot 8ffe769ca9 Update translations 2020-10-27 15:34:26 +01: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
Justin DiRose 3428429d77 DEV: Remove Travis CI 2020-10-20 11:29:15 -05:00
Justin DiRose 86c8daf693 DEV: Ignore foreign key migration in rubocop
We don't want foreign keys in migrations going forward as they can be
expensive for large tables. However, we shouldn't be changing old
migrations, so we're having rubocop ignore it in this plugin for now.
2020-10-20 11:27:32 -05:00
Discourse Translator Bot 0bae17dcb6 Update translations 2020-10-20 15:31:51 +02:00
Justin DiRose e13221279d FIX: Loading state persists after bad card entered (#22)
* FIX: Loading state persists after bad card entered

If a bad card number was entered and the subscribe button clicked, the
subscription button still disappeared and subscribing was not possible
without refreshing the page.

* UX: Add missing tooltip

* DEV: Ignore gems directory for local rubocop runs
2020-10-19 20:54:30 -05:00
Faizaan Gagan 55e6accb9c FEATURE: Markdown support for product description (#21) 2020-10-12 10:01:33 -05:00