-
Notifications
You must be signed in to change notification settings - Fork 981
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
[BANKCON-14524] Allow pay by bank when linkCardBrand criteria is met & dedupe instant debits #4021
Conversation
var eligibleForInstantDebits: Bool { | ||
elementsSession.orderedPaymentMethodTypes.contains(.link) && | ||
!elementsSession.orderedPaymentMethodTypes.contains(.USBankAccount) && | ||
!intent.isDeferredIntent && | ||
elementsSession.linkFundingSources?.contains(.bankAccount) == true | ||
{ | ||
} |
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.
does this need to be a var
instead of a let
?
and out of curiosity/learning how does this compile?
I would have expected it to be something like:
let eligibleForInstantDebits: Bool = {
return elementsSession.orderedPaymentMethodTypes.contains(.link) &&
!elementsSession.orderedPaymentMethodTypes.contains(.USBankAccount) &&
!intent.isDeferredIntent &&
elementsSession.linkFundingSources?.contains(.bankAccount) == true
}()
I get the inferred return
as they are no longer necessary.
But what are all the other pieces?
it almost looks like an in-line computed property but the declaration is inside of a function 🤔 so I am not immediately sure the step-by-step execution for it to compile into a boolean
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.
Tried in Xcode and I guess it can't be a let
because it is a computed property
Is there a name for computed properties inside of functions, and is this new or old? 🤔
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 base branch was changed.
Putting this PR on hold until we have guardrails preventing this feature be shown to users while it is being built. |
…& dedupe instant debits
73c6171
to
ccd9427
Compare
@@ -196,7 +196,7 @@ class PaymentSheetStandardUITests: PaymentSheetUITestCase { | |||
// `mc_load_succeeded` event `selected_lpm` should be "apple_pay", the default payment method. | |||
XCTAssertEqual(analyticsLog[2][string: "selected_lpm"], "apple_pay") | |||
app.buttons["+ Add"].waitForExistenceAndTap() | |||
XCTAssertTrue(app.staticTexts["Add a card"].waitForExistence(timeout: 2)) | |||
XCTAssertTrue(app.staticTexts["Card information"].waitForExistence(timeout: 2)) |
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.
Summary
Per the Panther project plan, this adds Link Card Brand as a payment method when the following criteria is met:
link_funding_sources
containsBANK_ACCOUNT
US_BANK_ACCOUNT
is not an available payment method.link_mode
isLINK_CARD_BRAND
This also makes sure that both Instant Debits and Link Card Brand won't both be shown at the same time, since they appear as identical payment methods to a user (same name, icon, and elements form).
Motivation
Building Panther support!
Testing
Added a unit test, and manually verified the new payment method shows up when the conditions are met:
Screen.Recording.2024-09-17.at.9.18.47.AM.mov
Changelog
N/a