com.drastikbydesign.stripe icon indicating copy to clipboard operation
com.drastikbydesign.stripe copied to clipboard

Javascript error doesn't show in interface

Open normancates opened this issue 6 years ago • 2 comments

I was having problems with getting this extension to work.

The submit button was failing to work. It just did nothing.

Eventually I found a Javascript error in the Chrome Developer Tools console.

This error was about having spaces in the API key.

My API key had managed to get spaces in it, presumably when I copied it from the Stripe interface. I didn't see the spaces because the text is obfuscated like a password.

If that error had popped up somewhere I could have seen it, it would have saved me a lot of time.

Ultimately, it would be really helpful if such errors were reported to the user. Possibly only when CiviCRM debug mode is on.

Not sure if that problem is on the Stripe JS end...?

Thanks, Norm

normancates avatar Mar 06 '18 21:03 normancates

At it's core, I feel this error has to do with sanitizing input. Spaces should be striped out. If I understand it correctly, that is a CiviCRM issue, because it's Civi code that accepts the api key when a new pay processor is added, not the extension.

I personally have seen Stripe errors displayed to me, so that's a mystery why you weren't shown an "incorrect api key" error. I just tried mangling my test keys and unfortunately test transactions still work. I'll have to test on a live transaction later on.

h-c-c avatar Mar 07 '18 05:03 h-c-c

Absolutely, sanitising the data would be helpful. But yeah, if there's other errors that never get shown to the user, then that's still a problem.

Of course, it may just be a problem on my end for some reason. I haven't suppressed JS errors deliberately... But yeah, if other people get the errors popping up, then maybe the problem is on my end...

normancates avatar Mar 07 '18 05:03 normancates