   #
   subscriptionDeleted: (customerId) ->
     console.log 'Subscription deleted for', customerId
-    user = BillingUser.first('profile.customerId': customerId)
+    user = BillingUser.first('billing.customerId': customerId)
     unless user then new Meteor.Error 404, "User not found.  Subscription cannot be deleted."
     
-    user.update('profile.subscriptionId': null)
+    user.update('billing.subscriptionId': null)
 
     Stripe = StripeAPI(Billing.settings.secretKey)
     deleteCard = Async.wrap Stripe.customers, 'deleteCard'
     try
-      deleteCard user.profile.customerId, user.profile.cardId
-      user.update('profile.cardId': null)
+      deleteCard user.billing.customerId, user.billing.cardId
+      user.update('billing.cardId': null)
     catch e
       console.error e
       throw new Meteor.Error 500, e.message

  getUpcomingInvoice: ->    
    console.log 'Getting upcoming invoice for', Meteor.userId()    
    Stripe = StripeAPI(Billing.settings.secretKey)
    customerId = Meteor.user().profile.customerId
    try
      invoice = Async.wrap(Stripe.invoices, 'retrieveUpcoming')(customerId)
    catch e

  updateSubscription: (userId, params) ->
    console.log 'Updating subscription for', userId
    user = BillingUser.first(_id: userId)
    if user then customerId = user.billing.customerId
    unless user and customerId then new Meteor.Error 404, "User not found.  Subscription cannot be updated."
    if user.billing.waiveFees or user.billing.admin then return

    Stripe = StripeAPI(Billing.settings.secretKey)
    updateSubscription = Async.wrap Stripe.customers, 'updateSubscription'
    try
      subscription = updateSubscription customerId, params
      Meteor.users.update _id: userId,
        $set: 'billing.subscriptionId': subscription.id, 'billing.planId'
    catch e
      console.error e
      throw new Meteor.Error 500, e.message
