-
Notifications
You must be signed in to change notification settings - Fork 694
Honor intent SFU as fallback when checkbox and PMO SFU are not set #11760
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add test for checkbox > intent SFU priority - Add test for PMO SFU > intent SFU priority - Add test for intent SFU fallback when no checkbox/PMO - Add test for clientContext intent SFU fallback - Update test name for clarity when no SFU is set These tests verify the complete SFU priority chain: User checkbox > PMO SFU > Intent SFU > null 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude
- Add runSfuPriorityTest helper to reduce boilerplate - Use boolean userCheckbox param instead of enum (more intuitive) - Reduce test code by ~87% (from ~240 lines to ~30 lines) - Tests now clearly show SFU priority: Checkbox > PMO > Intent > null 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude
|
Diffuse output: APK |
amk-stripe
reviewed
Oct 17, 2025
...roid/paymentelement/confirmation/interceptor/ConfirmationTokenConfirmationInterceptorTest.kt
Outdated
Show resolved
Hide resolved
...tripe/android/paymentelement/confirmation/intent/ConfirmationTokenConfirmationInterceptor.kt
Outdated
Show resolved
Hide resolved
Implementation changes: - Extract SFU resolution logic into resolveSetupFutureUsage() helper - Use helper in both prepareConfirmationTokenParams and prepareConfirmationTokenClientContextParams - Ensures both code paths stay in sync with single source of truth Test changes: - Remove standalone clientContext SFU test (redundant) - Update runSfuPriorityTest to validate both setUpFutureUsage AND clientContext.setupFutureUsage - All 6 SFU priority tests now verify both fields match Benefits: - Single source of truth for SFU resolution logic - Tests ensure both code paths stay synchronized - Net -40 lines of code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude
# Conflicts: # paymentsheet/src/main/java/com/stripe/android/paymentelement/confirmation/intent/ConfirmationTokenConfirmationInterceptor.kt
amk-stripe
approved these changes
Oct 20, 2025
cttsai-stripe
added a commit
that referenced
this pull request
Oct 21, 2025
…11760) * Should honor intent sfu as fallback if checkbox and pmo sfu are not set * Add tests for intent SFU fallback in confirmation token flow - Add test for checkbox > intent SFU priority - Add test for PMO SFU > intent SFU priority - Add test for intent SFU fallback when no checkbox/PMO - Add test for clientContext intent SFU fallback - Update test name for clarity when no SFU is set These tests verify the complete SFU priority chain: User checkbox > PMO SFU > Intent SFU > null 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude * Refactor SFU priority tests with cleaner helper function - Add runSfuPriorityTest helper to reduce boilerplate - Use boolean userCheckbox param instead of enum (more intuitive) - Reduce test code by ~87% (from ~240 lines to ~30 lines) - Tests now clearly show SFU priority: Checkbox > PMO > Intent > null 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude * Address PR feedback: Extract SFU resolution into shared helper Implementation changes: - Extract SFU resolution logic into resolveSetupFutureUsage() helper - Use helper in both prepareConfirmationTokenParams and prepareConfirmationTokenClientContextParams - Ensures both code paths stay in sync with single source of truth Test changes: - Remove standalone clientContext SFU test (redundant) - Update runSfuPriorityTest to validate both setUpFutureUsage AND clientContext.setupFutureUsage - All 6 SFU priority tests now verify both fields match Benefits: - Single source of truth for SFU resolution logic - Tests ensure both code paths stay synchronized - Net -40 lines of code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Committed-By-Agent: claude * Fix publishable key --------- Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
setupFutureUsagewhen user checkbox and payment method options (PMO) SFU are not setMotivation
#11746
Testing
Screenshots
Changelog