Skip to content

Commit 8e22e15

Browse files
Merge pull request stripe-ruby-mock#654 from iCreateJB/f/add-missing-decline-codes
F/add missing decline codes
2 parents d12621d + 6ec882b commit 8e22e15

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/stripe_mock/api/errors.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ def self.build_error_for(code)
3737
when :processing_error then build_card_error('An error occurred while processing the card', nil, code: 'processing_error', http_status: 402)
3838
when :card_error then build_card_error('The card number is not a valid credit card number.', 'number', code: 'invalid_number', http_status: 402)
3939
when :incorrect_zip then build_card_error('The zip code you supplied failed validation.', 'address_zip', code: 'incorrect_zip', http_status: 402)
40+
when :insufficient_funds then build_card_error('The card has insufficient funds to complete the purchase.', nil, code: 'insufficient_funds', http_status: 402)
41+
when :lost_card then build_card_error('The payment has been declined because the card is reported lost.', nil, code: 'lost_card', http_status: 402)
42+
when :stolen_card then build_card_error('The payment has been declined because the card is reported stolen.', nil, code: 'stolen_card', http_status: 402)
4043
end
4144
end
4245

0 commit comments

Comments
 (0)