Search code examples
braintree

Braintree - proration upon subscription cancellation


I have a yearly recurring subscription set up on Braintree. I am trying to cater for a scenario where the user is able to have their subscription cancelled by an admin part way into the yearly cycle.

I am aware of the discounts feature but am unsure how I would apply it in this case or even whether its possible.

Is there a way in Braintree to prorate the amount for the rest of the cycle and credit it back to the user? I would not be doing any of this directly in Braintree but rather through the API via my application that uses Braintree for payments.


Solution

  • Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support@braintreepayments.com.

    You can cancel an annual subscription mid-cycle by using the API call to cancel a subscription. Here's a Ruby example, but the Braintree developer docs show examples in all supported SDKs.

    result = Braintree::Subscription.cancel("the_subscription_id")
    

    A proration would only apply if a change is made to the subscription price in the middle of a billing cycle. In the event of a cancellation, Braintree won't automatically issue a partial refund; you would have to process the refund yourself. Here is the API call for a partial refund:

    result = Braintree::Transaction.refund("transaction_id", "amount")
    

    Also, keep in mind that a cancelled annual subscription will not renew the next year. The only way to "reactivate" the subscription is to create a new one.