change output and test more cards

This commit is contained in:
Rimian Perkins
2017-05-24 12:16:31 +10:00
parent a43f79d7a0
commit e981471217
2 changed files with 4 additions and 3 deletions
+1
View File
@@ -45,3 +45,4 @@ These numbers can be used in test mode to simulate a transaction. For more infor
* Payment successful: 5555 5555 5555 4444
* Card declined: 4000 0000 0000 0002
* Incorrect Security Code: 4000 0000 0000 0127
@@ -38,9 +38,9 @@ module DiscourseDonations
rescue ::Stripe::CardError => e
err = e.json_body[:error]
output['messages'] << "Error type: #{err[:type]}"
output['messages'] << "Error code: #{err[:code]}" if err[:code]
output['messages'] << "Decline code: #{err[:decline_code]}" if err[:decline_code]
output['messages'] << "There was an error (#{err[:type]})."
#output['messages'] << "Error code: #{err[:code]}" if err[:code]
#output['messages'] << "Decline code: #{err[:decline_code]}" if err[:decline_code]
output['messages'] << "Message: #{err[:message]}" if err[:message]
render(:json => output) and return