 
   @makePayment = secure (client, data, callback)->
     @initialize client, data, (err, group, account, plan)=>
-      if err then return callback new KodingError 'Unable to access payment backend, please try again later.'
+      if err then return callback { message: 'Unable to access payment backend, please try again later.' }
 
       data.quantity ?= 1  # Default quantity is 1
       data.multiple ?= no # Don't allow multiple subscriptions by default

  @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}"
      callback null, subscription

  # Charge user account
  @chargeUser = (account, plan, data, callback)->
    return callback new KodingError 'Unable charge, insufficient funds.'
    # TBI

  # List group's payments


  {secure, daisy}      = require 'bongo'

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