Skip to content

PIMOB: 5473 - Bump checkoutAndroidComponents to 2.8.0 and add msc+rm support - #17

Merged
adrian-orlowski-cko merged 3 commits into
mainfrom
feature/PIMOB-5473_update_2.8.0_sample_app_support_for_msc_rm
Oct 5, 2026
Merged

adrian-orlowski-cko merged 3 commits into
mainfrom
feature/PIMOB-5473_update_2.8.0_sample_app_support_for_msc_rm

Conversation

@chintan-soni-cko

@chintan-soni-cko chintan-soni-cko commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Bumps the sample app to checkout-android-components 2.8.0 and wires end-to-end support for Merchant Saved Card + Remember Me (MSC+RM) so the blended experience can be exercised from the sample app. Also reworks the session customer setup so identifiers (email/phone) are only sent when explicitly provided.

Issue

PIMOB-5473

Proposed changes

Stored Card (MSC+RM)

  • Bump checkoutAndroidComponents 2.6.1 → 2.8.0.
  • New StoredCardSettings state, gated on a single source of truth: enabled = customerId.isNotBlank() (no separate toggle — presence of a Customer ID is what turns the feature on).
  • New collapsible Stored Card Configurations settings section: Customer ID, Display mode (friendly "Default only" / "All" labels), Capture CVV, accepted schemes/types.
  • Session request: when a Customer ID is present, stored_card is added to enabled_payment_methods and payment_method_configuration.stored_card.customer_id is sent (new serializable wire models). Component config builds a StoredCardConfiguration into ComponentOption.
  • Guard-off = untouched: a blank Customer ID leaves both the session and component configuration unmodified.

Payment session customer setup

  • New collapsible Payment Session Setup section grouping Address Country, Customer Email, and Customer Phone Number (phone dialing code derived from the country).
  • Customer email/phone are now nullable and only sent when non-blank; explicitNulls = false omits unset keys from the request.
  • Removed the hard-coded billing/shipping phone (1234567890) — no phone is sent unless provided.
  • Region presets no longer inject hard-coded emails/phones, so cleared values stay cleared.

Test Steps

  1. Open Settings → Payment Session Setup: with Email and Phone blank, start a flow and confirm the session carries no customer email/phone (so Remember Me has no identifier to resolve).
  2. Enter a Customer Email and/or Phone, start a flow again, and confirm the provided identifier(s) are sent.
  3. Open Settings → Stored Card Configurations, enter a Customer ID with saved cards, optionally adjust Display mode / Capture CVV / schemes / types, and start a flow to verify saved cards are presented per the configuration.
  4. Clear the Customer ID and verify the stored card feature is fully off (session and component unchanged).

testing video

Checklist

  • Reviewers assigned
  • I have performed a self-review of my code and manual testing
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if applicable)

Further comments

Stored card is gated on Customer ID presence rather than a dedicated toggle, since the session's customer_id is the real driver for resolving saved cards. The customer email/phone rework makes it possible to validate the "no identifier" path, which previously always triggered Remember Me because a phone was hard-coded onto the session.

…card configuration for MSC+RM

* Update `checkoutAndroidComponents` version to 2.8.0 in `libs.versions.toml`
* Add stored card configuration state, settings UI, and display mode extensions in the sample app
* Update payment session request models and flow factory to support `stored_card` payment method configuration

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Stale Compose callbacks can reset settings, and asynchronous state reads can produce inconsistent session and component configurations.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Adds merchant-stored-card configuration to the sample checkout flow and upgrades Checkout Android Components to 2.8.0.

Changes:

  • Adds stored-card session and component configuration.
  • Adds stored-card settings UI and state.
  • Updates the sample dependency and default customer email.
File Description
sample/​gradle/​libs.versions.toml Upgrades components to 2.8.0.
PaymentSessions.kt Adds stored-card request models.
strings.xml Adds stored-card labels.
SettingsScreen.kt Adds stored-card settings controls.
StoredCardSettings.kt Defines stored-card UI state.
Settings.kt Updates the default email.
Constants.kt Exposes display-mode options.
DemoScreen.kt Wires stored-card state into settings.
MainViewModel.kt Builds stored-card component options.
MainActivity.kt Connects stored-card state and updates.
FlowComponent.kt Configures stored-card payment sessions.
Extensions.kt Adds display-mode labels.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sample/app/src/main/java/com/checkout/android/components/sample/MainViewModel.kt Outdated
- Snapshot StoredCardSettings once in MainViewModel.showFlowComponent so the
  session request and ComponentOption are configured from the same values even
  if the user edits settings during the suspending session creation.
- Read the latest StoredCardSettings via rememberUpdatedState in the Customer ID
  field callback so typing no longer resets display mode, CVV, or scheme/type
  choices through a stale callback captured by SampleOutlineTextField.
- Document the storedCardSettings @PARAM in createConfigurationFromSettings KDoc.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@chintan-soni-cko
chintan-soni-cko marked this pull request as ready for review October 2, 2026 15:38
@chintan-soni-cko
chintan-soni-cko requested a review from a team as a code owner October 2, 2026 15:38
@chintan-soni-cko chintan-soni-cko changed the title PIMOB: 5473 - Bump checkoutAndroidComponents to 2.8.0 and add stored … PIMOB: 5473 - Bump checkoutAndroidComponents to 2.8.0 and add msc+rm support Oct 2, 2026
@chintan-soni-cko
chintan-soni-cko marked this pull request as draft October 2, 2026 15:58
* Make `email` and `phone` fields optional in the `Customer` model
* Set `explicitNulls = false` in the Kotlinx Json configuration
* Add phone number field and an expandable "Payment Session Setup" section to the sample app settings UI
* Update flow component and region presets to handle optional email and phone values
@chintan-soni-cko
chintan-soni-cko marked this pull request as ready for review October 2, 2026 16:55
@adrian-orlowski-cko
adrian-orlowski-cko merged commit dd4cb41 into main Oct 5, 2026
3 checks passed
@adrian-orlowski-cko
adrian-orlowski-cko deleted the feature/PIMOB-5473_update_2.8.0_sample_app_support_for_msc_rm branch October 5, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants