-
Notifications
You must be signed in to change notification settings - Fork 662
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
Enable bank payments in native Link #10070
Conversation
Diffuse output:
APK
DEX
|
29d7d6a
to
80c3035
Compare
94b512e
to
aa0ad65
Compare
private fun String.parsePaymentMethod(): PaymentMethod? = try { | ||
val json = JSONObject(this) | ||
val paymentMethod = PaymentMethodJsonParser().parse(json) | ||
paymentMethod | ||
} catch (e: Exception) { | ||
null | ||
} |
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.
wdyt about using runCatching
here to avoid the lint baseline update?
private val ConsumerPaymentDetails.PaymentDetails.useLinkCardBrandConfirmation: Boolean | ||
get() = type == "bank_account" && configuration.passthroughModeEnabled | ||
|
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.
wdyt about using ConsumerPaymentDetails.BankAccount.TYPE
instead of a string literal?
internal class LinkApiRepository @Inject constructor( | ||
context: Context, |
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 wish we had an annotation saying this is an application context. Seeing this field in the constructor is a little scary
GIT_VALID_PII_OVERRIDE
- If Link card brand and ACH enabled, then use `bank_account` - Rename `shareLinkCardBrand` to `sharePaymentDetails` - Inject `Application` instead of `Context`
3e43e91
to
1d56f20
Compare
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 otherwise
@JvmSuppressWildcards | ||
@Provides | ||
@IntoSet | ||
fun providesLinkCardBrandConfirmationDefinition( | ||
linkAccountManager: DefaultLinkAccountManager | ||
): ConfirmationDefinition<*, *, *, *> { | ||
return LinkCardBrandConfirmationDefinition( | ||
linkAccountManager = linkAccountManager, | ||
) | ||
} |
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.
This should be in a LinkCardBrandConfirmationModule
in com.stripe.android.paymentelement.confirmation.link
Add `LinkCardBrandConfirmationModule`.
a36b55a
to
0fdf9e4
Compare
Summary
This pull request adds support for bank payments to the native Link flow.
ConsumerPaymentDetails.BankAccount
to the supported payment method types, and continue to use the intent’slinkFundingSources
when determining which payment details types to show.LinkCardBrandConfirmationDefinition
when attempting to use a bank account in passthrough mode. This invokes theshareLinkCardBrand
method with anexpectedPaymentMethodType
ofcard
.Motivation
Testing
Screenshots
Changelog