Notify Bugsnag on Stripe payment errors

This commit is contained in:
Maikel Linke
2020-08-27 10:30:10 +10:00
parent 9d07295480
commit 5d48da72c7
3 changed files with 19 additions and 1 deletions

View File

@@ -46,10 +46,12 @@ describe 'StripeElements Service', ->
it "doesn't submit the form, shows an error message instead", inject (Loading, RailsFlashLoader) ->
spyOn(Loading, "clear")
spyOn(RailsFlashLoader, "loadFlash")
spyOn(Bugsnag, "notify")
StripeElements.requestToken(secrets, submit).then (data) ->
expect(submit).not.toHaveBeenCalled()
expect(Loading.clear).toHaveBeenCalled()
expect(RailsFlashLoader.loadFlash).toHaveBeenCalledWith({error: "Error: There was a problem"})
expect(Bugsnag.notify).toHaveBeenCalled()
describe 'mapTokenApiCardBrand', ->
it "maps the brand returned by Stripe's tokenAPI to that required by activemerchant", ->