Permalink
Browse files

Add credit card errors to message.

  • Loading branch information...
1 parent a2e3046 commit 6f8248818ad4ba45bc45acba54a1a3ed050b2502 @scrozier committed Feb 4, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −1 app/models/chargeable.rb
  2. +2 −1 app/models/donation.rb
@@ -60,7 +60,7 @@ def reserve_and_donate
if @make_donation
unless @donation.card_valid?
- flash.now[:error] = 'Invalid credit card information.'
+ flash.now[:error] = 'Invalid credit card information.' + object_errors(@donation)
render :action => :show
return
end
@@ -40,7 +40,8 @@ def card_valid?
:verification_value => @credit_card_verification,
:type => @credit_card_type,
)
- @credit_card.valid?
+ return true if @credit_card.valid?
+ errors.add_to_base(object_errors(@credit_card))
end
def name_and_address

0 comments on commit 6f82488

Please sign in to comment.