I'm building an Event app using Rails. I've recently changed around my bookings controller to accomodate events which are free. This side of the app seems to work fine but when I try a test booking for a paid event the app defaults to 'booking unsuccessful' after I complete the payment submission form.

I'm not really sure why this is happening. Here's my controller logic - 

```
def new

        @event = Event.find(params[:event_id])
        @booking = Booking.new
        @booking.user = current_user

    end

    def create
        @event = Event.find(params[:event_id])
        @booking = Booking.new(booking_params)
        @booking.user = current_user

            if 
                @booking.save
                flash[:success] = "Your place on our event has been booked"
                redirect_to event_booking_path(@event, @booking)
            else
                flash[:error] = "Booking unsuccessful"
                render "new"
            end

    end

    def show
        @event = Event.find(params[:event_id])
        @booking = Booking.find(params[:id])
    end

    def update

        if @booking.update(booking_params)
            redirect_to event_booking_path(@event, @booking) , notice: "Booking was successfully updated!"
        else
            render 'new'
        end
    end

    private

    def booking_params
        params.require(:booking).permit(:stripe_token, :booking_number, :quantity, :event_id, :stripe_charge_id, :total_amount)
    end

```

And in my model I have this -

**Booking.rb** 

```
   class Booking < ActiveRecord::Base

    belongs_to :event
    belongs_to :user

  before_create :set_booking_number 

     validates :quantity, presence: true, numericality: { greater_than_or_equal_to: 0 }
     validates :total_amount, presence: true, numericality: { greater_than_or_equal_to: 0 }
     validates :quantity, :total_amount, :booking_number, presence: true

  def set_booking_number
    self.booking_number = "MAMA" + '- ' + SecureRandom.hex(4).upcase
  end

    def booking
        # Don't process this booking if it isn't valid
        self.valid?

          if booking.is_free?
            self.total_amount = event.price_pennies.nil?
            save!
          end

            begin
                        self.total_amount = event.price_pennies * self.quantity
                        charge = Stripe::Charge.create(
                            amount: total_amount,
                            currency: "gbp",
                            source: stripe_token, 
                            description: "Booking created for amount #{total_amount}")
                        self.stripe_charge_id = charge.id
              self.booking_number = "MAMA" + '- ' + SecureRandom.hex(4).upcase
                        save!
                    rescue Stripe::CardError => e
                    errors.add(:base, e.message)
                    false
                end

  end
end

```

So, for some reason its not saving or there's something else not right. Any assistance appreciated.