1
0
mirror of synced 2026-08-02 21:27:02 +00:00

10 Commits

Author SHA1 Message Date
Blake Erickson 100b276c9d DEV: Add pagination to plans request (#272)
When pulling up a users subscriptions a 500 might occur if we don't find
their plan. If your account happens to have over 100 plans this can be
the cause of the 500 error. This change adds pagination when fetching
plans form stripe, so that we fetch them all.

https://meta.discourse.org/t/problem-with-500-error-with-subscriptions/360808?u=blake
2025-04-10 07:35:31 -06:00
Blake Erickson 5eba613f8f FIX: Prevent duplicate stripe subscription list requests (#208)
Users can have multiple customer records in our db, so we need to filter
out non-unique stripe customer ids before fetching subscriptions for each.
2024-05-03 12:38:26 -06:00
Blake Erickson 66e8857c20 DEV: Stop deleting customers on cancel (#207)
Instead of deleting customers on cancel we will now update the
subscription status to canceled. This way we can have some visibility on
which users have canceled.
2024-05-02 13:38:30 -06:00
Loïc Guitaut 87659e237b DEV: Fix new Rubocop offenses 2024-03-06 15:23:55 +01:00
David Taylor 4e1a17c40c DEV: Introduce syntax_tree for ruby formatting (#144) 2022-12-29 13:35:06 +01:00
Faizaan Gagan 945af4f140 FIX: Allow user to update card details for recurring subscriptions (#123)
* add new route for card update

* create backend route

* update label

* basic functionality working

* ran rubocop

* added rspec tests for functionality

* make payment_method param compulsory

* fixed js linting

* improve client side error handling

* improve server side error handling

* improved update card page UI

* improve button UI for user subscriptions page

* give feedback to user about save status

* remove heading from last column

* fix padding on edit/delete buttons for update table

Co-authored-by: Blake Erickson <o.blakeerickson@gmail.com>
2022-07-05 19:53:27 -06:00
Justin DiRose 6ce6e85ef4 Make rubocop happy 2020-08-19 15:11:16 -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 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 fb4f50478d REFACTOR: Use engine to load files, add constraint (#14) 2020-07-06 11:11:04 -05:00