Skip to content

[BUG] Subscription enters a broken state if the user decide not to make the payment #1135

Answered by excid3
luizkowalski asked this question in Q&A
Discussion options

You must be logged in to vote

Stripe allows you to give users a free trial without a payment method, so you could simplify this considerably using just Stripe and not the fake processor.

When you call Current.user.set_payment_processor :stripe that will make Stripe the default.

The fake processor subscription still exists regardless of the default payment processor. You just have to make sure you aren't scoping the query to the current payment processor.

Current.user.subscriptions here uses through: :pay_customers to do that. https://github.com/pay-rails/pay/blob/main/lib/pay/attributes.rb#L17

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@excid3
Comment options

Answer selected by excid3
@luizkowalski
Comment options

@luizkowalski
Comment options

@excid3
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1134 on January 11, 2025 22:17.