Reputation: 1245
I am working on an integration for Braintree and trying to adapt the subscriptions to a model which can account for subscriptions which are "upgraded" from one plan to another. I can see that you can change the plan, and then separately update the price. However, this seems less correct than just cancelling a previous subscription and creating a new one.
So in summary, is there a native way to indicate upgrading a subscription or at least a best practice that most would follow for Braintree?
Upvotes: 1
Views: 2290
Reputation: 743
Full disclosure: I work for Braintree.
I would suggest changing the plan and then updating the price for your business model. Assuming upgrading plans includes an increase in price, you can easily prorate a subscription when the price changes in the middle of a billing cycle. In Ruby it would look like this:
result = Braintree::Subscription.update(
"subscription_id_to_update",
:price => "14.00",
:plan_id => "new_plan",
:options => { :prorate_charges => true },
)
One use case for canceling and then creating new subscriptions upon upgrade would be if the plan upgrade is on a different billing cycle, e.g. yearly instead of monthly, because you cannot update to a plan with a different billing cycle. More information on updating subscriptions.
If you have any additional questions, feel free to reach out to Braintree support.
Upvotes: 3