   @chargeGroup = (group, p, data, callback)->
     {multiple, plan, quantity} = data
     p.subscribeGroup group, {multiple, plan, quantity}, (err, subscription)->
-      if err then return callback new KodingError "Unable to buy item: #{err}"
+      if err then return callback { message: "Unable to buy item: #{err}" }
       callback null, subscription
 
   # Charge user account
   @chargeUser = (account, plan, data, callback)->
-    return callback new KodingError 'Unable charge, insufficient funds.'
+    return callback { message: 'Not implemented!' }
     # TBI
 
   # List group's payments


  {secure, daisy}      = require 'bongo'

  KodingError          = require '../../error'
  JUser                = require '../user'
  JGroup               = require '../group'
  JPaymentPlan         = require './index'

  # TODO: Make sure this calculation is enough.
  #       Not tested for expired/canceled subscriptions.
  @getExpenses = (pattern, callback) ->
    error = (err)-> { message: "Unable to query user balance: #{err}" }

    JPaymentPayment.some pattern, {subscription: 1}, (err, items) ->
      return callback error err  if err
