Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the next billing date with Braintree

I've looked over the docs (https://www.braintreepayments.com/docs/ruby/subscriptions/overview) and cannot see if it's possible to change the next billing date of an active subscription.

We want the ability to pause our user's subscriptions without cancelling their subscription. So I'm hoping we can update the user's next billing date by 1, 3, or 6 months at a time.

like image 487
Dallas Clark Avatar asked Apr 15 '14 20:04

Dallas Clark


1 Answers

I work at Braintree. If you have trouble finding anything else in our docs, please feel free to reach out to our support team.

The list of updateable fields on subscriptions is:

  • subscription id
  • price
  • plan
  • payment method token
  • add-on and discount details
  • number of billing cycles
  • merchant account

The next billing date is calculated, and so can't be changed.

Instead, you can add a discount that will reduce the price to zero for a number of months:

result = Braintree::Subscription.update(
  "the_subscription_id",
  :discounts => {
    :add => [
      {
        :inherited_from_id => "discount_id_1",
        :amount => BigDecimal.new("7.00"),
        :number_of_billing_cycles => 3
      }
    ]
  }
)
like image 54
agf Avatar answered Sep 28 '22 08:09

agf