Discourse Subscriptions

Is there a way to use Stripe “coupons” ?

Not in the current build of the plugin. Might be a good v2 feature if there’s enough need for it!

3 Likes

+1 for this

And additionally, One time memberships fee payment

4 Likes

I’ve just merged this PR:

It introduces a few back-end changes to the plugin on how it processes data from Stripe – namely adding a couple of database tables and models to store information on products and subscriptions created by the plugin in Stripe.

One problem encountered with the plugin if you previously used Stripe for subscriptions on any other site is it would pull in all information from Stripe. Storing the external ids of the Stripe products and subscriptions in the database allows us to pull only the data created inside Discourse.

To enable backwards compatibility, we’ve added a new rake task rake subscriptions:import. This will grab all products in Stripe and let you choose to import each one. For each product to import, the rake task will pull any subscriptions in that have a user_id and username stored in metadata which match a user on the Discourse site.

Please be aware this plugin is still in BETA status, so please use at your own risk! There are a few other niggly issues we need to iron out, but I believe most of the major work on the Stripe API integration is done.

13 Likes

I suppose you have a lot to do on the back-end first, but I was wondering if there was a plan in the future to add the possibility to use markdown and/or html in the product description?

I was able to play with the templates a lot, and it had a lot of possibilities, but when we have more than one product I can feel limited.

But I understand that it’s not the priority right now given the status of the plugin

The major consideration is all that information gets sent to the Stripe API and is stored there, so it’s not always practical to have markdown or plain text in that API. Plus I think there’s a character limit.

If there’s a need for a sales page with more copy/info, maybe that’s a possible use case for the Page Publishing we’ve just added to core?

6 Likes

More than development right now… Please please fix the drop down menu issues and single-time payment problem, it’s very hard to use this plugin in its actual state since we are totally confined to monthly recurrent subscriptions.

1 Like

Can you point me to the drop down issues? Are you talking about the plan page only showing month in the drop down?

And what’s the single time payment problem? Sorry I haven’t caught up on every detail of the topic quite yet if it’s been mentioned.

I’m working on improving the plugin but we had to get the foundational issues taken care of first.

2 Likes

Dropdown issues:

As for single-time payments, the issue is at the end when submitting the payment… an empty dialog window with only a confirm button and nothing else happens even when clicking on it.

2 Likes

Thank you very much for the rework, it is looking great!
I’m looking forward to seeing this as official plugin!

May I ask if SCA (3D secure) payments are supported?

2 Likes

Not yet. I will see what it will take to implement these, but I can’t guarantee I can add it. There have been multiple asks for it though!

4 Likes

Cool… It is unfortunately requirement to accept payments in EU. Without it it would be limited to US …

1 Like

That’s good to know. I’ll prioritize it prior to coming out of beta then!

6 Likes

A few quality of life fixes today:

Big one is this fixes the dropdowns on the plan page to allow selection of a subscription timeframe and changing of the currency.

10 Likes

Very excited for this! Thanks for all your work! I’m having some trouble, though.

I’ve set up everything according to the instructions, created a product and plan, and subscribed to that plan with two different users. It all shows up correctly in my Stripe dashboard. The subscribed users were correctly added to the group I specified. So far, so good.

However, in Discourse, in Admin > Plugins > Subscriptions, there are two tabs: Products and Subscriptions. Both of these show no information whatsoever. Products has a button to create a new product, but does not show the one I’ve already created. Subscriptions has a table with a header row, but no actual data.

How can I get that information to appear correctly? Thanks!

Discourse version: 2.5.0.beta5
Plugin version: 2.8.1

1 Like

Great fixes, thanks.

However, now the problem is even bigger. After creating a product, no matter which one it is, it disappears after refreshing the webpage. And the product I had already setup disappeared completely. Can it be related to Stripe? (like the need to setup Stripe all over?)

1 Like

I’m going to need repro steps as I haven’t seen this behavior before. Can you assist in that? Also any errors in the browser console or at /logs?

1 Like

I can repro the product disappearing issue on a test instance with latest: 2.5.0.beta6 293467a37a:

There is nothing in the error log. Console looks like this:

Issue #2 is a 500 error while trying to load /s/user/payments as a test user with a subscription:

Issue #2 error log:

log
Message

Uncaught TypeError: Cannot read property 'findDetails' of undefined
Url: https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js
Line: 1
Column: 268182
Window Location: https://dev-disco.glasair-owners.com/u/omarfilip_disco1/billing/subscriptions

Backtrace

TypeError: Cannot read property 'findDetails' of undefined
    at t.afterModel (https://dev-disco.glasair-owners.com/assets/application-4d8af9c02695c219ddae3a080f3f3f2b817dd02915d6b905763f2d4e028876c4.js:1:2403542)
    at e.t.runAfterModelHook (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:527737)
    at https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:526583
    at E (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:547399)
    at w (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:547291)
    at t.invoke (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:490268)
    at e.t.flush (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:489266)
    at e.t.flush (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:491273)
    at e.t._end (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:496669)

Env

HTTP HOSTS: dev-disco.glasair-owners.com
Console
/s/user/payments:1 Failed to load resource: the server responded with a status of 500 ()
_application-4d8af9c02695c219ddae3a080f3f3f2b817dd02915d6b905763f2d4e028876c4.js:65652 Objectabort: ƒ (e)always: ƒ ()catch: ƒ (e)done: ƒ ()fail: ƒ ()getAllResponseHeaders: ƒ ()getResponseHeader: ƒ (e)jqTextStatus: "error"overrideMimeType: ƒ (e)pipe: ƒ ()progress: ƒ ()promise: ƒ (e)readyState: 4requestedUrl: "/s/user/payments"responseJSON: {status: 500, error: "Internal Server Error"}responseText: "{"status":500,"error":"Internal Server Error"}"setRequestHeader: ƒ (e,t)state: ƒ ()status: 500statusCode: ƒ (e)statusText: "error"then: ƒ (t,n,r)__proto__: Object
error @ _application-4d8af9c02695c219ddae3a080f3f3f2b817dd02915d6b905763f2d4e028876c4.js:1
_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:36991 Error while processing route: user.billing.payments
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:38545 Uncaught Object
_application-4d8af9c02695c219ddae3a080f3f3f2b817dd02915d6b905763f2d4e028876c4.js:65652 TypeError: Cannot read property 'findDetails' of undefined
    at t.afterModel (_application-4d8af9c02695c219ddae3a080f3f3f2b817dd02915d6b905763f2d4e028876c4.js:69071)
    at e.t.runAfterModelHook (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:70143)
    at _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:70055
    at E (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:72211)
    at w (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:72194)
    at t.invoke (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66552)
    at e.t.flush (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66442)
    at e.t.flush (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66646)
    at e.t._end (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:67222)
    at e.t.end (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66908)
error @ _application-4d8af9c02695c219ddae3a080f3f3f2b817dd02915d6b905763f2d4e028876c4.js:1
k @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
n.triggerEvent @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
e.trigger @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
n.transitionDidError @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
E @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
w @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
g @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.invoke @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.flush @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.flush @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t._end @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.end @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t._run @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t._join @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.join @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
f @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
r @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
handleEvent @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
handleEvent @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
dispatch @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
v.handle @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:36991 Error while processing route: user.billing.payments Cannot read property 'findDetails' of undefined TypeError: Cannot read property 'findDetails' of undefined
    at t.afterModel (https://dev-disco.glasair-owners.com/assets/application-4d8af9c02695c219ddae3a080f3f3f2b817dd02915d6b905763f2d4e028876c4.js:1:2403542)
    at e.t.runAfterModelHook (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:527737)
    at https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:526583
    at E (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:547399)
    at w (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:547291)
    at t.invoke (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:490268)
    at e.t.flush (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:489266)
    at e.t.flush (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:491273)
    at e.t._end (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:496669)
    at e.t.end (https://dev-disco.glasair-owners.com/assets/ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:1:493225)
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
error @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
k @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
n.triggerEvent @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
e.trigger @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
n.transitionDidError @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
E @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
w @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
g @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.invoke @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.flush @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.flush @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t._end @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.end @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t._run @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t._join @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.join @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
f @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
r @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
handleEvent @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
handleEvent @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
dispatch @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
v.handle @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:38545 Uncaught TypeError: Cannot read property 'findDetails' of undefined
    at t.afterModel (_application-4d8af9c02695c219ddae3a080f3f3f2b817dd02915d6b905763f2d4e028876c4.js:69071)
    at e.t.runAfterModelHook (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:70143)
    at _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:70055
    at E (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:72211)
    at w (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:72194)
    at t.invoke (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66552)
    at e.t.flush (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66442)
    at e.t.flush (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66646)
    at e.t._end (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:67222)
    at e.t.end (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66908)
afterModel @ _application-4d8af9c02695c219ddae3a080f3f3f2b817dd02915d6b905763f2d4e028876c4.js:1
t.runAfterModelHook @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
E @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
w @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.invoke @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.flush @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.flush @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t._end @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.end @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t._run @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t._join @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
t.join @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
f @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
r @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
handleEvent @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
handleEvent @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
dispatch @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303
v.handle @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:74303

Issue #3 is that even though there is a user with a subscription, there is no record in the Admin:

2 Likes

Thanks. I’ll have a look next week.

5 Likes

BTW, thanks for taking on this plugin - I’m looking forward to switching from Wordpress membership solutions to this! :boom:

7 Likes