 
   # If requested list of records are longer than 50 items, recurly
   # paginates them. This method gets the URL path of next page.
-  parseNextUrl = (res)->
+  parseNextUrl = (res) ->
     links = {}
     for link in res.headers.link.split(', ')
       linkData = link.split('; ')

    POST 'plans', xml, (err, res) ->
      callback err, unless err then new models.Plan res.plan

  @updatePlan = (data, callback)->
    data.feeInitial  ?= 0
    data.feeInterval ?= 1


      </subscription>
      """

    PUT "subscriptions/#{data.uuid}", xml, (err, res) ->
      callback err, unless err then new models.Subscription res.subscription

  @terminateSubscription = (paymentMethodId, data, callback) ->
    data.refund ?= 'none'

    PUT "subscriptions/#{data.uuid}/terminate?refund=#{data.refund}", '', (err, res)->
      callback err, unless err then new models.Subscription res.subscription

  @cancelSubscription = (paymentMethodId, data, callback) ->
    PUT "subscriptions/#{data.uuid}/cancel", '', (err, res) ->
      callback err, unless err then new models.Subscription res.subscription

  @reactivateUserSubscription = (paymentMethodId, data, callback) ->
    PUT "subscriptions/#{data.uuid}/reactivate", '', (err, res) ->
      callback err, unless err then new models.Subscription res.subscription

  #
