-
Notifications
You must be signed in to change notification settings - Fork 659
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
Fix broken logic in isLpmLevelSetupFutureUsageSet
#6434
Conversation
JSONObject(paymentMethodOptionsJsonString) | ||
.optJSONObject(code) | ||
?.optString("setup_future_usage")?.let { | ||
true | ||
} ?: false |
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.
The issue here is that jsonObject.optString(key)
returns an empty string if key
isn’t present, meaning that this code snippet would return true if payment_method_options[code]
exists, even if payment_method_options[code]["setup_future_usage"]
doesn’t.
Diffuse output:
APK
DEX
|
1c7bde1
to
c1b22a9
Compare
@tillh-stripe do you have any idea if this fixes this issue too? https://jira.corp.stripe.com/browse/RUN_MOBILESDK-1820 |
5eb5261
to
f2878d8
Compare
f2878d8
to
3c2472e
Compare
@tillh-stripe were you able to figure anything out with this? #6434 (comment) |
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.
LGTM, would still like to know if it fixes the other issue as well.
@jaynewstrom-stripe Will follow up on the other issue offline. |
Summary
This pull request fixes an issue where PaymentSheet would incorrectly assume that a merchant requested SFU for payment intents where
payment_method_options[code]
was set, even ifpayment_method_options[code]["setup_future_usage"]
didn’t exist.This is a short-term patch. Thinking longer-term, we should align this logic with iOS (which doesn’t usepayment_method_options
at all).Motivation
RUN_MOBILESDK-2223
Testing
Screenshots
Changelog