Skip to content

Commit

Permalink
improving code for unrecognised card type exception
Browse files Browse the repository at this point in the history
  • Loading branch information
dlam-blinkbox committed Jan 12, 2015
1 parent 6b58e55 commit 6547d89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/blinkbox/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def add_default_credit_card(opts = {})
'jcb' => '3530111333300000'
}
card_number = card_number_map[opts[:card_type]]
raise "Unrecognised card_type: #{opts[:card_type]}. Please use one of: mastercard, visa, amex, discover, jcb." unless card_number
raise "Unrecognised card_type: #{opts[:card_type]}. Please use one of #{card_number_map.keys}" if card_number.nil?

cvv = opts[:card_type].eql?('amex') ? '1234' : '123'

Expand Down

0 comments on commit 6547d89

Please sign in to comment.