Skip to content

Commit

Permalink
Fix broken logic in isLpmLevelSetupFutureUsageSet
Browse files Browse the repository at this point in the history
  • Loading branch information
tillh-stripe committed Mar 28, 2023
1 parent 6a2da20 commit 47afd87
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,8 @@ constructor(
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
fun isLpmLevelSetupFutureUsageSet(code: PaymentMethodCode): Boolean {
return isTopLevelSetupFutureUsageSet() || paymentMethodOptionsJsonString?.let {
JSONObject(paymentMethodOptionsJsonString)
.optJSONObject(code)
?.optString("setup_future_usage")?.let {
true
} ?: false
val pmOptions = JSONObject(paymentMethodOptionsJsonString).optJSONObject(code)
pmOptions?.has("setup_future_usage") ?: false
} ?: false
}

Expand Down

0 comments on commit 47afd87

Please sign in to comment.