The explicit endpoint setting seems like an odd tax for everyone to
pay for handling stupidity. It isn't required in the backend api, so
why require it here?
I just went through a big outage with Mixpanel and learned a lot of
(hard) lessons about interacting with third party api's using JS. It
is hacky (like 99.99% of all the JS out there), but basically, what
you need to do is setup a setTimeout() which gets called after X
seconds to check to see if the rest of the .js has loaded yet and then
call the callback with an error message indicating that the JS failed
to load in time.
Instead of a simple <script src=""> like you have now, this would
require a small block of minimized JS that you hand out to people
which would attempt to async load your .js file and then do the
setTimeout dance. The general idea being that you *always* want that
callback to get called so that I can just build my app around
success/error messages and not have to worry about the networking
layer. Obviously, I can do this on my end, but I think that if you go
this extra little mile for your customers, they'd appreciate it in the
long run. Given the amount of downtime of your competitors .js file,
I'm surprised they don't handle this better as part of their
documentation. (cough
https://status.stripe.com/ cough).
Thanks for clarifying the response stuff.... I agree, putting it all
in the callback is a better system.
Some documentation explaining all the various errors we can receive
would be nice. It helps when designing a Payment Tag and accounting
for spacing. ;-)
I noticed that your .js file in production isn't minimized. I really
appreciate it being unminimized on stage as it helps with debugging,
but I really think prod should be minimized.
best,
jon