19 Commits

Author SHA1 Message Date
David Taylor
4e1a17c40c
DEV: Introduce syntax_tree for ruby formatting (#144) 2022-12-29 13:35:06 +01:00
David Taylor
c93be7632c
DEV: Bump rubocop-discourse (#136) 2022-10-04 09:18:34 +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
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
c30daa1b86
FIX: Couldn't dig the payments 2020-06-09 12:26:31 -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
b397ba5a68 name space module 2019-12-04 11:23:45 +11:00
Rimian Perkins
a95c119bcf fix paths in request specs 2019-12-03 11:48:12 +11:00
Rimian Perkins
36865c5ea1 remove the user from the group in user controller 2019-11-29 09:24:56 +11:00
Rimian Perkins
ad77fc749b test subcription deletes 2019-11-29 08:15:46 +11:00
Rimian Perkins
2eab43d4a0 delete customer when subscription destroyed 2019-11-29 08:00:13 +11:00
Rimian Perkins
ca00b530aa show the product name in subscription lists 2019-11-27 10:48:30 +11:00
Rimian Perkins
7340bf5bc5 fix customer id not found 2019-11-26 11:09:54 +11:00
Rimian Perkins
e4093e5a69 fix null delete subscription error 2019-11-14 12:07:24 +11:00
Rimian Perkins
5153a9a634 fix rubocop 2019-11-12 12:56:35 +11:00
Rimian Perkins
b2c5842aa6 only delete the right subscription 2019-11-12 12:43:23 +11:00
Rimian Perkins
e14b4dcd96 the subscribe product page 2019-11-04 16:37:21 +11:00
Rimian Perkins
2b3c52bdd4 name space user subscription request 2019-11-01 13:43:09 +11:00