Skip to content

fix(terminal): map STRIPE_U200 device type during discovery - #505

Open
matthew-tyler wants to merge 1 commit into
capacitor-community:mainfrom
matthew-tyler:fix/stripe-terminal-u200-device-type
Open

matthew-tyler wants to merge 1 commit into
capacitor-community:mainfrom
matthew-tyler:fix/stripe-terminal-u200-device-type

Conversation

@matthew-tyler

Copy link
Copy Markdown

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

@netlify

netlify Bot commented Aug 28, 2026

Copy link
Copy Markdown

Deploy Preview for capacitor-community-stripe ready!

Name Link
🔨 Latest commit 9b0408b
🔍 Latest deploy log https://app.netlify.com/projects/capacitor-community-stripe/deploys/6aab506f641feb00085ad89e
😎 Deploy Preview https://deploy-preview-505--capacitor-community-stripe.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@matthew-tyler
matthew-tyler force-pushed the fix/stripe-terminal-u200-device-type branch from 67a84d6 to 9b0408b Compare September 17, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant