Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow trials without credit cards #737

Merged
merged 5 commits into from
Nov 30, 2020
Merged

Conversation

glacials
Copy link
Owner

Currently trial subscriptions are handled completely by Stripe, and they don't have an option to allow them without entering payment information first.

This branch moves trial subscriptions to be handled by us, so that we don't need to have that requirement in place.

It also refactors the code that decides which users have which features, because it was getting pretty muddy having so many features with so many possible grantors of that feature. Now, each model that can grant a feature (Subscription, PatreonUser, and now SubscriptionTrial) has the same interface and can be easily queried en masse by User.

Also letting some more rufo lint leak through. I'm pretty confident I want us to switch to it.

Fixes #732.

Currently trial subscriptions are handled completely by Stripe, and they
don't have an option to allow them without entering payment information
first.

This branch moves trial subscriptions to be handled by us, so that we
don't need to have that requirement in place. It also refactors the code
that decides which users have which features, because it was getting
pretty muddy having so many features with so many possible grantors of
that feature.
Copy link
Collaborator

@BatedUrGonnaDie BatedUrGonnaDie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I'm missing something, but I see the schema.rb file is changed but I don't see any migration file as part of this PR.

app/models/patreon_user.rb Outdated Show resolved Hide resolved
app/models/subscription_trial.rb Outdated Show resolved Hide resolved
app/models/user.rb Show resolved Hide resolved
app/views/layouts/application.slim Outdated Show resolved Hide resolved
app/views/layouts/application.slim Outdated Show resolved Hide resolved
Copy link
Owner Author

@glacials glacials left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, forgot to git add the migration and the controller 😅

app/models/subscription_trial.rb Outdated Show resolved Hide resolved
app/models/user.rb Show resolved Hide resolved
app/views/layouts/application.slim Outdated Show resolved Hide resolved
app/views/layouts/application.slim Outdated Show resolved Hide resolved
Copy link
Collaborator

@BatedUrGonnaDie BatedUrGonnaDie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good once that one test is fixed.

@glacials glacials merged commit bd8be2e into main Nov 30, 2020
@glacials glacials deleted the trials_without_credit_card branch November 30, 2020 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow starting a trial without entering a credit card number
2 participants