5 Commits

Author SHA1 Message Date
David Taylor
4e1a17c40c
DEV: Introduce syntax_tree for ruby formatting (#144) 2022-12-29 13:35:06 +01:00
Bianca Nenciu
a58743e376
FIX: Simplify Stripe webhook handler (#135)
The 'customer.subscription.created' webhooks were not handled at all and
the logic was overcomplicated.
2022-10-03 13:33:50 +03:00
Justin DiRose
a868e6b838
FEATURE: Cancel payments at end of subscription vs immediately
Previously, when a user canceled a subscription, the access would revoke
immediately on Discourse vs. at the end of the billing period. This
commit changes the behavior to remove membership at the end of the
billing period using Stripe's `cancel_at_period_end` attribute on the
Subscription object.

This commit now requires the setup of webhooks for subscription
processing to occur correctly.
2020-08-19 14:37:47 -05:00
Justin DiRose
587661fafb
FEATURE: Allow one-time purchases on products (#18)
Building off the foundation of using the Prices API, this PR adds the ability to create a one-time purchase plan for any product, which then can add a user to the specified plan group.

Some things to be aware of:

    One-time purchases cannot have trials.
    One-time purchases use the Invoice API instead of Subscriptions. Invoices are created then charged immediately.
    Users should receive emails for these invoices directly from Stripe just like subscriptions.
2020-07-22 11:06:34 -05:00
Justin DiRose
fb4f50478d
REFACTOR: Use engine to load files, add constraint (#14) 2020-07-06 11:11:04 -05:00