       @emit 'PaymentConfirmed', @aggregatedData
 
     # if provided, show the product form, otherwise skip to payment methods.
-    if @productForm?
+    if productForm?
     then @setState 'product'
     else @preparePaymentMethods()
 

  selectPaymentMethod: (method) ->
    { paymentMethodId } = method
    @addAggregateData { paymentMethodId }
    @confirmForm.setPaymentMethod? method
    @setState 'confirm'

  createChoiceForm: ->

    # use this feature, make sure to emit the "DataCollected" event with any
    # data that you want aggregated (that you want to be able to access from
    # the "PaymentConfirmed" listeners).
    { productForm } = @getOptions()

    if productForm?
      @addForm 'product', productForm
      productForm.on 'DataCollected', (productData) =>
        @addAggregateData { productData }
        @preparePaymentMethods()

    # "choice form" is for choosing from existing payment methods on-file.
    @addForm 'choice', @createChoiceForm()

    # "entry form" is for entering a new payment method for us to file.
    @addForm 'entry', @createEntryForm()

    # "confirm form" is required.  This form should render a summary, and emit
    # a "PaymentConfirmed" after user approval.
    { confirmForm } = @getOptions()
    @addForm 'confirm', confirmForm

    confirmForm.on 'PaymentConfirmed', =>
      # You should listen to the "PaymentConfirmed" event from outside the
      # workflow.  We'll forward a result like:
      #   { paymentMethodId, productData* }
