flutter_stripe
flutter_stripe copied to clipboard
[stripe_checkout] Uncaught ReferenceError: Stripe is not defined
After calling redirectToCheckout, I got a white screen and this error in chat Uncaught ReferenceError: Stripe is not defined. If I copy the session url on browser, it works.
Full log
I/PlatformViewsController(23452): Hosting view in view hierarchy for platform view: 1
4
D/EGL_emulation(23452): eglMakeCurrent: 0xe9ffd920: ver 2 0 (tinfo 0xe9fafe80)
I/chromium(23452): [INFO:CONSOLE(1)] "Uncaught ReferenceError: Stripe is not defined", source: (1)
D/EGL_emulation(23452): eglMakeCurrent: 0x9367f560: ver 2 0 (tinfo 0x9377c830)
4
D/EGL_emulation(23452): eglMakeCurrent: 0xe9ffd920: ver 2 0 (tinfo 0xe9fafe80)
E/chromium(23452): [ERROR:ssl_client_socket_impl.cc(946)] handshake failed; returned -1, SSL error code 1, net_error -201
I/chromium(23452): [INFO:CONSOLE(1)] "Uncaught ReferenceError: Stripe is not defined", source: https://stripe.com/base_url/ (1)
2
D/EGL_emulation(23452): eglMakeCurrent: 0xe9ffd920: ver 2 0 (tinfo 0xe9fafe80)
2
E/chromium(23452): [ERROR:ssl_client_socket_impl.cc(946)] handshake failed; returned -1, SSL error code 1, net_error -201
D/EGL_emulation(23452): eglMakeCurrent: 0xe9ffd920: ver 2 0 (tinfo 0xe9fafe80)
I/chatty (23452): uid=10233(test.hoongry.flutterhoongry) RenderThread identical 8 lines
D/EGL_emulation(23452): eglMakeCurrent: 0xe9ffd920: ver 2 0 (tinfo 0xe9fafe80)
Is this on Web?
Did you follow the instructions for it? https://github.com/flutter-stripe/flutter_stripe/tree/main/packages/stripe_checkout#web
Please provide a code example.
No, it's on mobile Android.
I found out that this cloud happens on Android Emulators that have no access to Google Play Services. Maybe is some kind of integration with Google Pay that breaks the code. On a real device, for now, I didn't see this error.
I'm currently using the library importing it from github
flutter_stripe: ^5.1.0
stripe_checkout:
git:
url: https://github.com/flutter-stripe/flutter_stripe
path: packages/stripe_checkou
closed as it is quite old ticket and I could not reproduce it anymore. Feel free to create a new ticket if the issue still persist