Regarding the Discourse Subscriptions plugin, what would happen if I changed some settings from Stripe itself? For example, from Discourse it’s not possible to make a plan for a product a one-off payment. It has to be a day, week, month, or year-long subscription. But if I go into stripe.com I can change an existing subscription to a one-off payment. Can I do this? How would this change how that plan functions in Discourse? Would it then be a one-off payment?
It most definitely is possible! If you uncheck the recurring checkbox in the plan creation screen, it will be a one time payment.
However, you cannot change existing plans once they’re created.
You’re right! I had a brain fart. What I actually meant to ask is whether it’s possible or not to have a one-off payment that terminates, and doesn’t go on indefinitely. For example, something like a “day-pass,” where you pay $5 and are put into a special group, and then after, say, a day, the subscription terminates and you’re then eliminated from the group until you pay again. Is this possible?
It is not at this time, unfortunately.
I do something like that in a plugin. I (loosely) add to the user_group model an action that when a user is added to the subscription group, does an action, and then removes the user from the group. In your case, you’d make it so when the subscription added the user to the one-off-weeklong group it would
- add the user to the
weeklonggroup that gives permission to whatever categories - add a job that will delete them from the
weeklonggroup when the week is up - add a user custom field with the date the week started so you could delete them if you have some redis disaster
- remove them from the
one-off-weeklonggroup.
If you’re interested in such, you can contact me or post in marketplace .
Mais c’est stupide. Au lieu de cela, ajoutez simplement un rappel pour l’abonnement (s’il s’agit d’un abonnement) ou le client (s’il s’agit d’un paiement unique). Client est un peu un terme impropre. Il a l’ID client Stripe et l’ID produit Stripe. Alors faites quelque chose comme
add_model_callback(DiscourseSubscriptions::Subscription, :after_save) do
Rails.logger.warn("Maintenant, j'ai un abonnement #{self.external_id} pour #{self.customer_id}")
# faire des choses
end
add_model_callback(DiscourseSubscriptions::Customer, :after_save) do
Rails.logger.warn("Client #{self.product_id} pour #{self.user_id}")
# faire plus de choses
end
Salut, avez-vous résolu ce problème ?
Pouvez-vous fournir plus de conseils ? Par exemple, comment implémenter cette fonctionnalité. Je ne suis pas familier avec Rails… merci !
Je pense que c’est ma meilleure réponse gratuite.
Je l’ai résolu en modifiant le plugin de souscription Discourse. Merci.
Cependant, j’ai constaté que je ne pouvais pas supprimer de produits, même en utilisant le plugin de souscription Discourse d’origine. Avez-vous une idée ?
Vous n’avez pas besoin de les supprimer. Ils ne font de mal à personne. Ils sont nécessaires comme enregistrement des choses que vous avez vendues. Vous devriez pouvoir les supprimer depuis la console Stripe.
Stripe n’autorise pas non plus la suppression des produits, mais ils peuvent être désactivés/archivés.
Ils disent :
Je ne sais pas si c’est toujours quelque chose que vous voulez réaliser, ou si vous avez trouvé un moyen de le faire ? Il semble que ce ne soit pas quelque chose qui soit intégré pour être automatisé avec Discourse, mais il existe peut-être un autre moyen de le faire. Cela ressemble un peu à l’affaire d’un café où il faut acheter une nouvelle boisson chaque jour pour pouvoir s’asseoir à l’une de leurs tables.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


