Reputation: 4262
I am using Stripe for payments in my rails app. Everything is working well except for the fact that I'd like to disable prorating, or metered subscriptions. Customers show up on the dashboard, canceling and changing plans is working with a refund, etc. However, I do not want to prorate the subscription.
In my user model, I'm sending the attributes below and everything but prorate seems to be working. When that user cancels or switches plans, a prorated amount is refunded (something less than the full amount paid for the subscription). I want to refund the full amount they paid.
customer = Stripe::Customer.create(
:email => email,
:description => name,
:card => stripe_token,
:prorate => false,
:plan => roles.first.name
)
Does anyone have any ideas on how to configure this properly in Stripe? I have checked out their documentation but it is not helping me - https://stripe.com/docs/subscriptions. I also do not see how to configure this when setting up a plan on their site.
Any hints would be much appreciated! Thanks
Upvotes: 2
Views: 2763
Reputation: 4288
Right idea, not quite the right place. Customers at the top-level don't recognize the prorate
property and it's not stored. Since Stripe plans are billed prepaid, the only time this needs to be set is when changing a plan. (A new subscription by definition cannot be prorated.) prorate
is set with each plan change call and only applies to the act of changing between those plans.
So for users changing plans, you want to make sure your update_subscription
call passes false for prorate:
customer.update_subscription(plan: 'newplan', prorate: false)
Easy peasy, no more prorated plan changes.
Cancellation doesn't issue a refund at all, so if you're finding it does, double-check your own code before contacting Stripe support. Any cancellation refunds should be coming only from your code, and the refund
call by default issues a full refund.
Note that if you're making that refund on a user who's mistakenly been upgraded with proration, their last payment will likely have been prorated, so a full refund will be the prorated amount they last paid. That may be why you're seeing "prorated" refunds.
Upvotes: 4