This commit adds an optional new stripe based pricing table.
If the user is logged in, the email field will be prepopulated with the users email.
The pricing table can be configured in the stripe dashboard.
Once the discourse_subscriptions_pricing_table setting is filled with the pricing table embed code from the stripe dashboard,
the pricing table will be displayed on /s/subscriptions
For more details see https://stripe.com/docs/payments/checkout/pricing-table
---------
Co-authored-by: spirobel <spirobel@protonmail.com>
* 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>
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.
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).
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.
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.
- 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
* 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