v6 - Card Scanning - Create new internal API#2759
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces card scanning capabilities by integrating Google Pay's card recognition service. It adds a CardScannerInitializer for setup, a CardScannerController to manage scanning intents and parse results, and a CardScanResult data model. Feedback was provided to enhance the robustness of the initialization process by verifying the presence of the PendingIntent before creating the controller, preventing potential runtime errors.
1c44452 to
ef7c9d0
Compare
COSDK-1195
ef7c9d0 to
6ed36f2
Compare
|
The following dependencies have been modified in this PR: ---
+++
@@ -2,7 +2,6 @@
androidx.activity:activity-compose:1.8.2
androidx.activity:activity-ktx:1.13.0
androidx.activity:activity-ktx:1.8.2
-androidx.activity:activity:1.0.0
androidx.activity:activity:1.13.0
androidx.activity:activity:1.8.2
androidx.annotation:annotation-experimental:1.4.1
@@ -10,9 +9,7 @@
androidx.annotation:annotation:1.9.1
androidx.appcompat:appcompat-resources:1.7.1
androidx.appcompat:appcompat:1.7.1
-androidx.arch.core:core-common:2.1.0
androidx.arch.core:core-common:2.2.0
-androidx.arch.core:core-runtime:2.0.0
androidx.arch.core:core-runtime:2.2.0
androidx.autofill:autofill:1.0.0
androidx.autofill:autofill:1.3.0
@@ -22,7 +19,6 @@
androidx.collection:collection-jvm:1.5.0
androidx.collection:collection-ktx:1.4.2
androidx.collection:collection-ktx:1.5.0
-androidx.collection:collection:1.1.0
androidx.collection:collection:1.4.2
androidx.collection:collection:1.5.0
androidx.compose.animation:animation-android:1.11.0-alpha06
@@ -95,7 +91,6 @@
androidx.core:core-viewtree:1.0.0
androidx.core:core:1.16.0
androidx.core:core:1.18.0
-androidx.core:core:1.2.0
androidx.cursoradapter:cursoradapter:1.0.0
androidx.customview:customview-poolingcontainer:1.0.0
androidx.customview:customview:1.0.0
@@ -111,7 +106,6 @@
androidx.emoji2:emoji2:1.3.0
androidx.emoji2:emoji2:1.4.0
androidx.fragment:fragment-ktx:1.8.9
-androidx.fragment:fragment:1.1.0
androidx.fragment:fragment:1.5.4
androidx.fragment:fragment:1.8.9
androidx.graphics:graphics-path:1.0.1
@@ -123,15 +117,12 @@
androidx.lifecycle:lifecycle-common-java8:2.9.4
androidx.lifecycle:lifecycle-common-jvm:2.10.0
androidx.lifecycle:lifecycle-common-jvm:2.9.4
-androidx.lifecycle:lifecycle-common:2.1.0
androidx.lifecycle:lifecycle-common:2.10.0
androidx.lifecycle:lifecycle-common:2.9.4
androidx.lifecycle:lifecycle-livedata-core-ktx:2.10.0
androidx.lifecycle:lifecycle-livedata-core-ktx:2.9.4
-androidx.lifecycle:lifecycle-livedata-core:2.0.0
androidx.lifecycle:lifecycle-livedata-core:2.10.0
androidx.lifecycle:lifecycle-livedata-core:2.9.4
-androidx.lifecycle:lifecycle-livedata:2.0.0
androidx.lifecycle:lifecycle-livedata:2.10.0
androidx.lifecycle:lifecycle-livedata:2.9.4
androidx.lifecycle:lifecycle-process:2.10.0
@@ -146,7 +137,6 @@
androidx.lifecycle:lifecycle-runtime-ktx-android:2.9.4
androidx.lifecycle:lifecycle-runtime-ktx:2.10.0
androidx.lifecycle:lifecycle-runtime-ktx:2.9.4
-androidx.lifecycle:lifecycle-runtime:2.1.0
androidx.lifecycle:lifecycle-runtime:2.10.0
androidx.lifecycle:lifecycle-runtime:2.9.4
androidx.lifecycle:lifecycle-service:2.10.0
@@ -160,7 +150,6 @@
androidx.lifecycle:lifecycle-viewmodel-savedstate-android:2.9.4
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.10.0
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.9.4
-androidx.lifecycle:lifecycle-viewmodel:2.1.0
androidx.lifecycle:lifecycle-viewmodel:2.10.0
androidx.lifecycle:lifecycle-viewmodel:2.9.4
androidx.loader:loader:1.0.0
@@ -189,7 +178,6 @@
androidx.savedstate:savedstate-compose:1.4.0
androidx.savedstate:savedstate-ktx:1.3.2
androidx.savedstate:savedstate-ktx:1.4.0
-androidx.savedstate:savedstate:1.0.0
androidx.savedstate:savedstate:1.3.2
androidx.savedstate:savedstate:1.4.0
androidx.startup:startup-runtime:1.1.1
@@ -199,7 +187,6 @@
androidx.transition:transition:1.6.0
androidx.vectordrawable:vectordrawable-animated:1.1.0
androidx.vectordrawable:vectordrawable:1.1.0
-androidx.versionedparcelable:versionedparcelable:1.1.0
androidx.versionedparcelable:versionedparcelable:1.1.1
androidx.viewpager2:viewpager2:1.1.0-beta02
androidx.viewpager:viewpager:1.0.0
To check the affected modules run the |
There was a problem hiding this comment.
Some dependencies have been modified in this PR, review the modifications in the comments before merging.
✅ No public API changes |
|


Description
Create a new Compose-friendly, library-internal API for card scanning in the
card-scanningmodule.CardScannerInitializer— wraps Google PayPaymentsClientinitialization, returnsCardScannerController?CardScannerController— providesgetIntentSender(),parseResult(), andterminate()CardScanResult— data class withpan,expiryMonth,expiryYear@RestrictTo(LIBRARY_GROUP)coremodule dependency for v6Environmentand loggingProgress
✅ Phase 1 — Move existing classes to old package
➡️ Phase 2 — Create new internal API in card-scanning module
Phase 3 — Add scanning state & intents to v6 card component state layer
Phase 4 — Add scanning analytics events
Phase 5 — Integrate scanning in v6 CardComponent (logic layer)
Phase 6 — Integrate scanning in v6 composable UI
Phase 7 — Tests
Checklist
COSDK-1195