G
YouTube TikTok Games
Skip to content

fix(android): only configure preferredNetworks when explicitly provided - #2751

Merged
jaynewstrom-stripe merged 1 commit into
stripe:masterfrom
reginaldalfret:fix/issue-2494-preferred-networks-null-and-unknown
Oct 19, 2026
Merged

jaynewstrom-stripe merged 1 commit into
stripe:masterfrom
reginaldalfret:fix/issue-2494-preferred-networks-null-and-unknown

Conversation

@reginaldalfret

Copy link
Copy Markdown
Contributor

Summary

Fixes #2494

On Android, \CustomerSheetManager.kt, \PaymentSheetManager.kt, and \EmbeddedPaymentElementViewManager.kt\ were unconditionally chaining .preferredNetworks(mapToPreferredNetworks(...))\ onto their respective configuration builders.

When \preferredNetworks\ was omitted from options or
ull, \mapToPreferredNetworks(null)\ evaluates to \emptyList(), which sets an explicit empty list on the native configuration builder instead of leaving the property untouched/unset. On iOS, \preferredNetworks\ is guarded by \if let preferredNetworks = preferredNetworks\ (and similarly in \CheckoutConfigurationMapper.kt\ with ?.let), keeping the default native behavior when omitted.

This change ensures that \preferredNetworks\ is only configured when the parameter is non-null.

Testing

  • Verified ./gradlew detekt\ passes cleanly without issues.

Signed-off-by: reginaldalfret <reginaldalfret@gmail.com>
@reginaldalfret
reginaldalfret requested review from a team as code owners October 19, 2026 08:00
@jaynewstrom-stripe
jaynewstrom-stripe merged commit a5c36fc into stripe:master Oct 19, 2026
4 of 5 checks passed
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.

"Unknown" preferred network is sent in edit on CustomerSheet, unable to select

2 participants