Open DZuz14 opened 3 years ago
Hm, I should look deeper. I'm not quite familiar with react native architecture in such details.
EDIT: I see that there are two synchronous method. First one which you referenced initializes (sets up) Stripe SDK and as it could be called right before i.e payment I prefer it to be sync.
The second one is credit card validation. Will it cause problems for chrome debugger as well?
@viktorasl I'm surprised other people haven't had a problem with this. What do you think about providing an async version of the setup method that returns a promise (I know it sounds kind of weird, but inherently everything that executes in the JS bridge is async, so it wouldn't be that weird)? In regards to the card validation, we don't use that part of the library, so it won't break the debugger, because we don't call that method.
The idea to have an async method looks valid. I'll look deeper into best practices communicating via the JS-Native bridge and maybe even make card validation async as well
Cool. Sounds great! =)
I am getting an Invariant Violation any time I attempt to use the Debugger in React Native. This only occurred after I installed your package.
I looked in your source code and found some methods in the Java package that are synchronous.
After checking the
lib/index.tsx
file I saw that theStripePayments.init
method gets invoked automatically when you use thesetOptions
method. I found that if I comment out theStripePayments.init
line in the compiled JS code, my debugger then starts working properly.Any advice? Thank you for the library.