Sha256: 93a07dd72dd6a015508dbdff75b0aefc6376e78a2d0e45835cea8a236e15309b

Contents?: true

Size: 1.02 KB

Versions: 19

Compression:

Stored size: 1.02 KB

Contents

class IntegratedPaymentController < ApplicationController
  before_filter :disallow_if_payment_is_hosted
  before_filter :get_cart_order
  before_filter :require_addresses_for_checkout

  def billing
    @user = current_user
    @page_title = "Pay Securely Online WIth Your Credit Card"
  end

  def pay
    processor = Forge::CreditCardProcessor.new(@cart_order)
    processor.create_credit_card(
      :number => params[:credit_card][:number],
      :verification_value => params[:credit_card][:verification_value],
      :month => params[:date][:month],
      :year => params[:date][:year]
    )
    if processor.pay(@cart_order)
      flash[:notice] = processor.message
      redirect_to paid_order_path(@cart_order, :key => @cart_order.key)
    else
      flash[:warning] = processor.message
      render :action => "billing" and return
    end
  end

  private

    def disallow_if_payment_is_hosted
      if Forge.config.ecommerce.payments == :hosted
        redirect_to "/hosted_payment/billing" and return false
      end
    end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
forge-cli-0.1.10 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.1.9 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.1.8 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.1.7 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.1.6 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.1.5 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.1.4 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.1.3 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.1.2 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.1.1 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.1.0 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.0.18 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.0.17 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.0.16 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.0.15 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.0.14 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.0.13 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.0.12 lib/forge/app/controllers/integrated_payment_controller.rb
forge-cli-0.0.11 lib/forge/app/controllers/integrated_payment_controller.rb