Skip to content

v6 - Card Scanning - Create new internal API#2759

Open
jreij wants to merge 1 commit into
chore/v6-card-scanningfrom
chore/v6-card-scanning-internal-api
Open

v6 - Card Scanning - Create new internal API#2759
jreij wants to merge 1 commit into
chore/v6-card-scanningfrom
chore/v6-card-scanning-internal-api

Conversation

@jreij
Copy link
Copy Markdown
Collaborator

@jreij jreij commented May 18, 2026

Description

Create a new Compose-friendly, library-internal API for card scanning in the card-scanning module.

  • CardScannerInitializer — wraps Google Pay PaymentsClient initialization, returns CardScannerController?
  • CardScannerController — provides getIntentSender(), parseResult(), and terminate()
  • CardScanResult — data class with pan, expiryMonth, expiryYear
  • All classes annotated with @RestrictTo(LIBRARY_GROUP)
  • Added core module dependency for v6 Environment and logging

Progress

✅ 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

  • Code is unit tested
  • Changes are tested manually

COSDK-1195

@AdyenAutomationBot AdyenAutomationBot added the Chore [PRs only] Indicates any task that does not need to be mentioned in the public release notes label May 18, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jreij jreij force-pushed the chore/v6-card-scanning-internal-api branch 2 times, most recently from 1c44452 to ef7c9d0 Compare May 18, 2026 23:12
@jreij jreij marked this pull request as ready for review May 18, 2026 23:16
@jreij jreij requested a review from a team as a code owner May 18, 2026 23:16
@jreij jreij force-pushed the chore/v6-card-scanning-internal-api branch from ef7c9d0 to 6ed36f2 Compare May 18, 2026 23:22
@github-actions
Copy link
Copy Markdown
Contributor

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 aggregateDependencyLists gradle task with includeModules=true.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some dependencies have been modified in this PR, review the modifications in the comments before merging.

@github-actions
Copy link
Copy Markdown
Contributor

✅ No public API changes

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Chore [PRs only] Indicates any task that does not need to be mentioned in the public release notes size:small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants