thoughtbot / fake_stripe

A Stripe fake so that you can avoid hitting Stripe servers in tests.
MIT License
401 stars 78 forks source link

Return error on native or zero amounts #89

Closed cpytel closed 6 years ago

cpytel commented 6 years ago

When you pass a negative or 0 as an amount to Stripe it results in an error being returned. On our app that uses FakeStripe, we had a bug that was sending negative amounts to be charged and this was not caught by the specs because FakeStripe was happily taking this request.

This introduces this error state to match the behavior of the Stripe API. If a zero or negative amount is attemoted to be charged, an error will be returned.

This is related to #19, but only validates this one parameter.