stripe / stripe-android

Stripe Android SDK
https://stripe.com/docs/mobile/android
MIT License
1.23k stars 628 forks source link

[BUG] Unable to load connect account onboarding url returned from Stripe. #7888

Open rajeshkhumanthem opened 5 months ago

rajeshkhumanthem commented 5 months ago

Summary

Android App trying to open url returned from call to "https://api.stripe.com/v1/accounts" in a Webview fails. This is during a Connect account onboarding process.

Code to reproduce

Stacktrace from Chrome is given below: Uncaught ReferenceError: globalThis is not defined at getHostname (connect-flows.express_unified.023b9ffde252a582b993.min.js:5) at isStripeInternalHostname (connect-flows.express_unified.023b9ffde252a582b993.min.js:5) at isDevEnvironment (connect-flows.express_unified.023b9ffde252a582b993.min.js:5) at getEnvironment (connect-flows.express_unified.023b9ffde252a582b993.min.js:5) at Object. (connect-flows.express_unified.023b9ffde252a582b993.min.js:13) at webpack_require (connect-flows.runtime~express_unified.2cf0bb060194f759fbd9.min.js:1) at Object. (connect-flows.express_unified.023b9ffde252a582b993.min.js:14) at webpack_require (connect-flows.runtime~express_unified.2cf0bb060194f759fbd9.min.js:1) at Object. (connect-flows.express_unified.023b9ffde252a582b993.min.js:32) at __webpack_require__ (connect-flows.runtime~express_unified.2cf0bb060194f759fbd9.min.js:1)

It looks like it is looking for a variable that doesn't exist and crashes.

Android version

SDK Level 28

Impacted devices

Samsung S22 Android simulator running the above SDK.

Installation method

Android Studio Running on MacOS Sonoma 14.1.1

Dependency Versions

kotlin: stripe-android: Android Gradle Plugin: Gradle:

SDK classes

SDK Level 28

Video

Other information

This issue is simple; a JS script (see name in the stack trace) is referencing a variable without checking if it exist first. Please see the stack trace above from Chrome debugger. It works fine with simulator running SDK Level 29.

rajeshkhumanthem commented 5 months ago

Tested with SDK Level 29 and it works fine.

jaynewstrom-stripe commented 2 weeks ago

Hi @rajeshkhumanthem I'm not able to reproduce this. Is this happening on emulators and physical devices?

Are you still able to recreate this?