add more tests to check Stripe exceptions
This commit is contained in:
parent
922440fb77
commit
a78804b94d
3 changed files with 62 additions and 5 deletions
|
|
@ -33,7 +33,7 @@ class Payment < ActiveRecord::Base
|
|||
self.status = 'success'
|
||||
true
|
||||
|
||||
rescue => error
|
||||
rescue Stripe::StripeError => error
|
||||
errors.add(:base, error.message)
|
||||
self.status = 'failure'
|
||||
false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue