Forum: Ruby on Rails TypeError problem with active_merchant

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E8f08d5077bf7a224fe4f8111740138b?d=identicon&s=25 Lee Richmond (yorks-terrier)
on 2009-04-09 15:36
Hi folks

I'm doing some work on a project with active_merchant and I keep getting
the following error:

[b][i] TypeError in CheckoutController#place_order
exception class/object expected [/i][/b]

heres the piece of code from my controller that correpsonds:
[code=]@order = Order.new(params[:order])
@order.customer_ip = request.remote_ip
populate_order

#raise "I need to know what values are being sent in the order object"
                                                                                                   unless
@order.valid?
  return render :action => 'index'
  flash.now[:error] = "error while placing order"
end
 ########## START of AM##########
# ActiveMerchant::Billing::Base.mode = :test #COMMENT OUT / REMOVE FOR
REAL TRANSACTIONS!
# ActiveMerchant accepts all amounts as Integer values in cents
#$10.00
amount = @order.total
#twodig_year = @order.card_expiration_year.sub(/.*(\d{2})$/, '\1')
# twodig_syear = @order.card_start_year.sub(/.*(\d{2})$/, '\1')
credit_card = ActiveMerchant::Billing::CreditCard.new(
:first_name         => @order.first_name,
:last_name          => @order.last_name,
:number             => @order.card_number,
:month              => @order.card_expiration_month,
:year               => @order.card_expiration_year,
:start_month        => @order.card_start_month,
:start_year         => @order.card_start_year,
:issue_number       =>@order.card_issue_no,
:verification_value =>@order.card_verification_value
)
   raise credit_card.errors[/code]
now this error message has only shown since i tried "raise
credit_card.errors"

can anyone help me at least get a better understanding of what is
causing this error?

many thanks

:)
This topic is locked and can not be replied to.