-
Notifications
You must be signed in to change notification settings - Fork 694
Block Konbini and Blik payment methods with ConfirmationTokens in test mode #11756
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
Conversation
Following TDD approach, add failing tests that verify: - Konbini and Blik payment methods throw IllegalStateException in test mode - Konbini and Blik payment methods succeed in live mode These tests currently fail as the blocking logic has not been implemented yet. Related to MOBILESDK-4092 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Committed-By-Agent: claude
…t mode Add failIfUnsupportedPaymentMethod() function that throws IllegalStateException for Konbini and Blik payment methods when using test mode API keys. The block is enforced in both new and saved payment method flows. Live mode usage is allowed to enable production functionality while preventing test mode usage of payment methods not yet supported with confirmation tokens. Related to MOBILESDK-4092 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Committed-By-Agent: claude
Simplify Konbini and Blik blocking tests by using the existing helper function instead of manually creating interceptors. This reduces code duplication and improves maintainability. - Add isLiveMode parameter to helper that controls publishableKeyProvider - Use helper for all four test cases (test/live mode × Konbini/Blik) - Reduce each test by ~50% while maintaining the same test coverage 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Committed-By-Agent: claude
|
Diffuse output: APK |
...tripe/android/paymentelement/confirmation/intent/ConfirmationTokenConfirmationInterceptor.kt
Outdated
Show resolved
Hide resolved
| private fun failIfUnsupportedPaymentMethod(paymentMethodCode: String?) { | ||
| val unsupportedPaymentMethods = setOf("konbini", "blik") | ||
|
|
||
| if (paymentMethodCode in unsupportedPaymentMethods && !requestOptions.apiKeyIsLiveMode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the behavior in live mode? ie what is the user experience if they are trying to check out with Konbini + CTs in live mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the best way to test that? If I simply remove the assertion and try in playground, it would look like this:
Screen_recording_20251016_221319.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll follow up on this on slack
...roid/paymentelement/confirmation/interceptor/ConfirmationTokenConfirmationInterceptorTest.kt
Outdated
Show resolved
Hide resolved
| private fun failIfUnsupportedPaymentMethod(paymentMethodCode: String?) { | ||
| val unsupportedPaymentMethods = setOf("konbini", "blik") | ||
|
|
||
| if (paymentMethodCode in unsupportedPaymentMethods && !requestOptions.apiKeyIsLiveMode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll follow up on this on slack
# Conflicts: # paymentsheet/src/test/java/com/stripe/android/paymentelement/confirmation/interceptor/ConfirmationTokenConfirmationInterceptorTest.kt
Summary
Block Konbini and Blik payment methods when using confirmation tokens in test mode. These payment methods are not yet fully supported with confirmation tokens. By blocking them early in test mode, we help developers catch this issue during development rather than encountering errors in production.
Motivation
MOBILESDK-4092
Testing
Screenshots
Changelog