fix(terminal): map STRIPE_U200 device type during discovery - #505
Open
matthew-tyler wants to merge 1 commit into
Open
matthew-tyler wants to merge 1 commit into
matthew-tyler wants to merge 1 commit into
Conversation
✅ Deploy Preview for capacitor-community-stripe ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
matthew-tyler
force-pushed
the
fix/stripe-terminal-u200-device-type
branch
from
September 17, 2026 02:29
67a84d6 to
9b0408b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the missing STRIPE_U200 case to the Android device-type mapper so simulated discovery can resolve.
Root cause
Test-mode (simulated) discovery emits a reader for every mobile device type the SDK supports — including Stripe U200 — but mapFromDeviceType() has no case for it, so it falls through to the else branch and throws IllegalArgumentException("Unknown DeviceType: ..."). The exception escapes from onUpdateDiscoveredReaders(), so discoverReaders() never resolves and apps hang until their own timeout. (iOS maps unknown types to "unknown" instead of throwing, so this only crashes on Android.)
Impact
discoverReaders() in test mode now resolves with the full simulated reader list (Chipper 2X, Stripe M2, Stripe U200, WisePad 3) instead of hanging. Live Bluetooth discovery is unaffected — the readers used in production were already mapped.
Validation
npm run build -w packages/terminal
Android ./gradlew clean build test with JDK 21
On-device (test mode): simulated discovery returns 4 readers, all mapped, no exception in logcat