Forzar que una suscripción a Discourse sea un pago único

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.

2 Me gusta

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.

2 Me gusta

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 weeklong group that gives permission to whatever categories
  • add a job that will delete them from the weeklong group 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-weeklong group.

If you’re interested in such, you can contact me or post in marketplace .

3 Me gusta

Pero eso es una tontería. En su lugar, simplemente añade una devolución de llamada para la suscripción (si es una suscripción) o el cliente (si es un pago único). Cliente es un nombre un tanto inapropiado. Tiene el ID de cliente de Stripe y el ID de producto de Stripe. Así que haz algo como

add_model_callback(DiscourseSubscriptions::Subscription, :after_save) do
      Rails.logger.warn("Ahora tengo una suscripción #{self.external_id} para #{self.customer_id}")
      # haz cosas
end

  add_model_callback(DiscourseSubscriptions::Customer, :after_save) do
    Rails.logger.warn("Cliente #{self.product_id} para #{self.user_id}")
    # haz más cosas
end
1 me gusta

Hola, ¿has resuelto este problema?

¿Puede proporcionar más orientación? como implementar esta característica. No estoy familiarizado con Rails… ¡gracias!

Creo que esa es mi mejor respuesta gratuita.

3 Me gusta

Lo he resuelto modificando el plugin de suscripción de Discourse. Gracias.

Pero he descubierto que no puedo eliminar productos ni siquiera usando el plugin de suscripción de Discourse original. ¿Alguna idea?

No necesitas eliminarlos. No hacen daño. Son necesarios como registro de las cosas que has vendido. Deberías poder eliminarlos desde la consola de Stripe.

2 Me gusta

Stripe tampoco permite eliminar productos, pero se pueden desactivar/archivar.

Dicen:

2 Me gusta

No sé si esto es algo que todavía quieres lograr, o si has encontrado una manera de hacerlo. Parece que no es algo que esté integrado para automatizarse con Discourse, pero puede haber alguna otra forma de hacerlo. Parece algo parecido a un acuerdo de cafetería donde tienes que comprar una bebida nueva cada día para poder sentarte en una de sus mesas.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.