Using the Subscriptions plugin with Stripe’s Pricing table, is it still possible to add subscribers to groups?
I’ve switched to using Stripe’s Pricing table to list my products, instead of the Subscriptions plugin. Subscribers are no longer added to my specified User group (for the original Discourse-created subscription, since added to my Pricing table). New products created in Stripe also aren’t appearing in the Discourse subscriptions plugin, as I thought they did before I switched to the Pricing table.
Is the expected behaviour, or have I broken something along the way?
If it’s expected, can I help add a line to the plugin guide, to highlight the consequences of switching to the Pricing table?
I will dig into the advice on webhooks & integration, but any pointers on how to automate adding subscribers to a group greatly appreciated
And if you have things that you didn’t create with Discourse that you want Discourse to know about (and you’re self-hosted) you can try rake subscriptions:subscriptions_import
Thanks for this detailed response, @blake ! I’ll set up the products and plans in Discourse, and mark this as the solution once tested
It looks like the coupons & promotion codes transfer happily between Stripe and Discourse. My final test is whether the integration still behaves after I add a description and marketing features to the product in Stripe (to populate the pricing table)
Someone purchased my Discourse-created product+plan over the weekend, and they were not added to my specified group. So it seems that editing the product+plan in Stripe after creating it in Discourse somehow breaks this integration
I’ve also just tested this myself by buying a subscription, and I’m not added to the specified group
If anyone can advise how to test this further to figure out where things go wrong, I’m happy to do so
I’m also going to investigate other ways of integrating Stripe payments with Discourse
Good thing you mentioned this, I think there may be a separate issue with one-off payments. I just tested it locally and I’m seeing an error with the webhook call likely causing it to not add the user to the group or have the transaction show up in the user’s billing page.
I’ll see if I can come up with a code fix so that future transactions will work.
Okay, I’ve created a code fix for this issue. If you update your subscriptions plugin to the latest version it should work for all new one-off payments with the pricing table.
I’m sorry to report that your code fix hasn’t solved the problem. I’ve had four purchases from two separate customers since the update, and none were added to groups. I also cannot see any payments or subscriptions on their billing pages
I believe the code fix has changed one thing - the products I created in Discourse since updating the Subscriptions plugin are now tagged with the metadata repurchaseable: false in Stripe. However, the product created before the code fix hasn’t had that metadata added (it has been purchased)
Let me know what I can do to help diagnose the issue!
First of all congrats on all the sign ups you are getting, that is pretty cool! Sorry things still aren’t working quite right with the subscription plugin though. In my local setup users are added to groups once they sign up, so I know it can work. I’ll do some more digging, and then send you a PM to ask about some details of your setup so that we can get to the bottom of this.
Okay I was able to replicate your issues in a production environment I setup to test out the plugin. I know the first thing to fix is to add checkout.session.completed as a event for your existing webhook.
Thanks for digging into this further, Blake. I’ve updated my Stripe webhook to add checkout.session.completed
I’ll be back when I have news of success/failure!
Note to self - find webhooks athttps://dashboard.stripe.com/webhooks/. I first installed the Subscriptions plugin several years ago so was a bit rusty on the setup…
I’m not sure if this is a question for me or @marpoe , but yes - I have the correct Discourse url in Stripe, and the correct Stripe secret in Discourse. I know the webhook is mostly working because Stripe creates products & plans in response to me setting them up in Discourse