 whoami = require '../util/whoami'
 showError = require '../util/showError'
 trackEvent = require 'app/util/trackEvent'
-$ = require "jquery"
+_ = require 'lodash'
 
 
 module.exports = class PaymentWorkflow extends KDController

    super options, data

    @state = kd.utils.extend @getInitialState(), options.state
    @startingState = $.extend(true, {}, @state)

    kd.singletons.appManager.tell 'Pricing', 'loadPaymentProvider', @bound 'start'


    {planTitle, provider, planInterval} = @state
    planId  = "#{planTitle}-#{planInterval}"

    userId = whoami().getId()
    orderId = "#{userId}-#{planId}"

    {currentPlanInterval, monthPrice, yearPrice} = @state
    if currentPlanInterval is PaymentConstants.planInterval.MONTH
      amount = monthPrice
    else
      amount = yearPrice
