-
Couldn't load subscription status.
- Fork 694
Set GPCR as default card scanning implementation #11770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Diffuse output: APKDEX |
|
Do we need a changelog in this PR? |
08de030 to
02bacdc
Compare
02bacdc to
99decfa
Compare
| validateAnalyticsRequest(eventName = "mc_embedded_sheet_newpm_show") | ||
| validateAnalyticsRequest(eventName = "mc_carousel_payment_method_tapped") | ||
| validateAnalyticsRequest(eventName = "mc_form_shown") | ||
| // cardscan is not available in test mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In test mode as in stripe test mode? Why not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. The error is 10: The Application invoking the current API hasn't registered for Google card recognition API.
GPCR works in paymentsheet-example but fails in paymentsheet tests because Google identifies apps using both package name and certificate fingerprint.
- paymentsheet-example: com.stripe.android.paymentsheet.example + Stripe keystore (SHA-1: BA:B2:79:56...) ✅ Registered in Google Cloud Console
- paymentsheet tests: com.stripe.android.paymentsheet.test + Android debug keystore (SHA-1: BD:14:55:B8...) ❌ Not registered
Even changing the test application ID to match wouldn't work because the tests use a different signing certificate (the default Android debug keystore vs. the custom Stripe keystore). Google treats them as separate apps since the fingerprints don't match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we sign our test APK with the same cert we have checked into the repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think that should work if we also change the application id. I saw the paymentsheet-example was signed with a custom key by you. Should we chat on slack how to sign the test apk correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't block on it. Let's do it as a follow up task.
paymentsheet/src/test/java/com/stripe/android/link/ui/paymentmethod/PaymentMethodScreenTest.kt
Outdated
Show resolved
Hide resolved
...ntsheet/src/test/java/com/stripe/android/paymentsheet/verticalmode/VerticalModeFormUITest.kt
Outdated
Show resolved
Hide resolved
- Remove legacy CardScan test cases - Add GPCR-only test scenarios - Simplify test helper methods to remove feature flag dependencies - Part of migration to set GPCR as default card scanning implementation Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude
…LaunchedCardScanFormDataHelper - Make GPCR the default card scanning implementation - Remove cardScanGooglePayMigration feature flag checks from main code - Update ScanCardButtonUI to use only CardScanGoogleLauncher - Remove legacy CardScanContract imports and launcher code - Update tests to test GPCR-only behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude
- Remove FeatureFlags import - Remove all setEnabled(true/false) calls - Remove test for feature flag disabled scenario (no longer relevant) - GPCR is now always enabled by default 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude
…llyTest - Remove FeatureFlags import - Remove setEnabled calls - GPCR is now always enabled 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude
Batch remove FeatureFlags.cardScanGooglePayMigration from: - DefaultVerticalModeFormInteractorTest.kt - CardDefinitionTest.kt - CustomerSheetViewModelTest.kt Removed imports and all setEnabled() calls. GPCR is now always enabled. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude
Remove FeatureFlagSettingsDefinition for cardScanGooglePayMigration from playground UI. GPCR is now always enabled, no toggle needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude
GPCR is now the default card scanning implementation. Remove the feature flag from FeatureFlags.kt as it's no longer needed. This completes Phase 1: Setting GPCR as default. The legacy cardscan modules remain in the codebase but are unused. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude
- Add EmptyCardScanEventsReporter with no-op implementations that error only in DEBUG builds - Refactor ScanCardButtonUI to accept CardScanGoogleLauncher? parameter instead of pulling from composition locals - Update CardDetailsSectionElementUI to conditionally create launcher based on ActivityResultRegistry availability - Simplify test setup by removing need for composition local providers in most tests - Update ScanCardButtonUITest to use new API This follows the pattern established by LocalAnalyticsEventReporter and eliminates the need for extensive test helper code while maintaining fail-fast behavior in DEBUG builds for production integration errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude
Replace Mockito mock with a simple NoOpCardScanEventsReporter object in PaymentMethodScreenTest to follow the codebase preference for fakes over mocks. The no-op implementation is sufficient since these tests don't exercise card scanning functionality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude
a243a52 to
a9a8a95
Compare
* Remove cardscan module references from build configuration Remove stripecardscan module and related ML modules from settings.gradle and build dependencies. Preserve camera-core module as it's required by the identity module. Changes: - Remove 5 cardscan modules from settings.gradle - Remove stripecardscan-example from API validation ignored projects - Remove stripecardscan dependencies from payments-ui-core - Remove stripecardscan dependency from paymentsheet-example - Keep camera-core module for identity module compatibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude * Delete cardscan module directories Remove physical directories for cardscan modules: - stripecardscan/ - main cardscan module - stripecardscan-example/ - example app - stripecardscan-tflite/ - TensorFlow Lite runtime - ml-core/cardscan/ - ML processing module - ml-core/googleplay/ - Google Play ML services module Deleted 191 files across 5 module directories. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude * Remove old cardscan code references and files - Delete old cardscan activity and contract files - Remove old cardscan proxy and availability check - Clean up CardDetailsSectionController and CardNumberController - Remove old cardscan test files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude * Remove remaining usages * Remove run-cardscan-instrumentation-tests * api dump * Remove CardScanActivity from AndroidManifest.xml * Update bitrise instrumentation tests * Update MIGRATING.md * Fix lokalise * Update transitive dependencies * Remove card_scan_available in PaymentSheetEventTest * Fix tests * Restore ml-core:googleplay * Update MIGRATING.md --------- Co-authored-by: Claude <noreply@anthropic.com>
Summary
Make Google Payment Card Recognition (GPCR) API the default card scanning implementation by removing the
cardScanGooglePayMigrationfeature flag.Motivation
Testing
Screenshots
Changelog