From d4b9860c337c58b4ff007a3a7305eca72f03d807 Mon Sep 17 00:00:00 2001 From: Cat Sync Date: Wed, 30 Sep 2015 15:13:33 -0400 Subject: [PATCH] Send hipchat message for prepaid purchase --- server/prepaids/prepaid_handler.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/prepaids/prepaid_handler.coffee b/server/prepaids/prepaid_handler.coffee index 9060ece17..6ac48b12c 100644 --- a/server/prepaids/prepaid_handler.coffee +++ b/server/prepaids/prepaid_handler.coffee @@ -2,6 +2,7 @@ Handler = require '../commons/Handler' Prepaid = require './Prepaid' StripeUtils = require '../lib/stripe_utils' {getPrepaidCodeAmount} = require '../../app/core/utils' +hipchat = require '../hipchat' # TODO: Should this happen on a save() call instead of a prepaid/-/create post? # TODO: Probably a better way to create a unique 8 charactor string property using db voodoo @@ -116,6 +117,8 @@ PrepaidHandler = class PrepaidHandler extends Handler months: req.body.months prepaid.save (err) => return @sendDatabaseError(res, err) if err + msg = "Prepaid code (#{req.body.maxRedeemers} users / #{req.body.months} months) purchased by #{req.user.get('email')}" + hipchat.sendHipChatMessage msg, ['tower'] @sendSuccess(res, prepaid.toObject()) module.exports = new PrepaidHandler()