       else
         KD.remote.api.JRecurlyPlan.getGroupBalance group, cb
 
-    buildModal = (content, cb)->
+    askBillingInfo = (cb)->
+      paymentModal = paymentController.createPaymentMethodModal {}, (newData, onError, onSuccess)->
+        if type is 'group'
+          group.setBillingInfo newData, (err, result)->
+            console.log "Group Billing:", arguments
+            if err
+              onError err
+            else
+              onSuccess result
+              cb yes
+        else
+          KD.remote.api.JRecurlyPlan.setUserAccount newData, (err, result)->
+            console.log "User Billing:", arguments
+            if err
+              onError err
+            else
+              onSuccess result
+              cb yes
+
+    buildModal = (content, needBilling, willCharge, cb)->
       modal           = new KDModalView
         title         : "Confirm VM Creation"
         content       : "<div class='modalformline'>#{content}</div>"

                       continue?.
                     </p>
                  """
        buildModal content, callback
      else
        getBalance type, (err, balance)->
          if not err and balance > 0
            charge = (plan.feeMonthly - balance) / 100
            balance = balance / 100

            content = """<p>
                           You have $#{balance.toFixed(2)} credited to your 
                           <strong>#{type}</strong> account.
                         </p>
                      """

            if charge > 0
              content += """<p>
                              You will be charged for $#{charge.toFixed(2)}. 
                              Do you want to continue?
                            </p>
                         """
            else
              content += """<p>
                              You <strong>won't</strong> be charged. Do you 
                              want to continue?
                            </p>
                         """
          else
            charge = plan.feeMonthly / 100
            content = """<p>
                           You will be charged for $#{charge.toFixed(2)}. Do 
                           you want to continue?
                         </p>
                      """
          buildModal content, callback

  makePaymentModal: (type, plan, callback)->
    vmController      = KD.getSingleton('vmController')
    paymentController = KD.getSingleton('paymentController')

    group = KD.getSingleton("groupsController").getCurrentGroup()
    planCode = plan.code

    group.canCreateVM
      type    : type
      planCode: planCode
    , (err, status)->
      if err
        return new KDNotificationView
          title : "There is an error in payment backend, please try again later."
      if status
        vmController.createGroupVM type, planCode
        callback()
      else
        if type is 'group'
          group.checkPayment (err, payments)->
            if err or payments.length is 0
              paymentController.subscribeGroup group, type, planCode, callback
            else
              group.updatePayment {plan: planCode, type: type}, (err, subscription)->
                vmController.createGroupVM type, planCode
                callback()
        else
          KD.remote.api.JRecurlyPlan.getUserAccount (err, account)->
            if err or not account
              paymentModal = paymentController.createPaymentMethodModal {}, (newData, onError, onSuccess)->
                newData.plan = planCode
                KD.remote.api.JRecurlyPlan.setUserAccount newData, (err, result)->
                  if err
                    onError err
                  else
                    onSuccess result
                    paymentController.subscribeUser type, planCode, callback
              paymentModal.on "KDModalViewDestroyed", -> vmController.emit "PaymentModalDestroyed"
            else
              paymentController.subscribeUser type, planCode, callback
            callback  : =>
              modal.destroy()
              cb()
          Billing     :
            title     : "Enter Billing Info"
            cssClass  : "modal-clean-green"
            callback  : =>
              askBillingInfo (success)->
                if success
                  modal.buttons.Yes.show()
                  modal.buttons.Billing.hide()
          Yes         :
            title     : "OK, create the VM"
            cssClass  : "modal-clean-green"
            callback  : =>
              modal.destroy()
              paymentController.makePayment type, plan, willCharge, ->
                cb()

      if needBilling
        modal.buttons.Billing.show()
        modal.buttons.Yes.hide()
      else
        modal.buttons.Billing.hide()

    getBillingInfo = (cb)->
      if type is 'group'
        group.getBillingInfo cb
      else
        KD.remote.api.JRecurlyPlan.getUserAccount cb

    group.canCreateVM
      type     : type
      planCode : plan.code
