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 .
Aber das ist albern. Fügen Sie stattdessen einen Callback für das Abonnement (wenn es sich um ein Abonnement handelt) oder den Kunden (wenn es sich um eine einmalige Zahlung handelt) hinzu. Kunde ist ein etwas irreführender Begriff. Er enthält die Stripe-Kunden-ID und die Stripe-Produkt-ID. Machen Sie also etwas wie
add_model_callback(DiscourseSubscriptions::Subscription, :after_save) do
Rails.logger.warn("Now got a subscription #{self.external_id} for #{self.customer_id}")
# do stuff
end
add_model_callback(DiscourseSubscriptions::Customer, :after_save) do
Rails.logger.warn("Customer #{self.product_id} for #{self.user_id}")
# do more stuuff
end
Hallo, hast du dieses Problem gelöst?
Können Sie mir weitere Anleitungen geben? Zum Beispiel, wie ich diese Funktion implementieren kann. Ich bin nicht mit Rails vertraut. Danke!
Das ist meiner Meinung nach meine beste kostenlose Antwort.
Ich habe es durch Modifikation des Discourse-Abonnement-Plugins gelöst. Danke.
Aber ich habe festgestellt, dass ich Produkte nicht einmal mit dem ursprünglichen Discourse-Abonnement-Plugin löschen kann. Haben Sie eine Idee?
Sie müssen sie nicht löschen. Sie schaden nichts. Sie werden als Aufzeichnung der verkauften Artikel benötigt. Sie sollten sie über die Stripe-Konsole löschen können.
Stripe erlaubt auch nicht, Produkte zu löschen, aber sie können deaktiviert/archiviert werden.
Sie sagen:
Ich weiß nicht, ob Sie das immer noch erreichen möchten oder ob Sie einen Weg gefunden haben, dies zu tun? Es scheint keine Funktion zu sein, die mit Discourse automatisiert werden kann, aber vielleicht gibt es einen anderen Weg, dies zu tun. Es ähnelt irgendwie einem Café, in dem man jeden Tag ein neues Getränk kaufen muss, um an einem der Tische sitzen zu können.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


