Skip to content

Commit

Permalink
Instant Debits: cleaned up logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
kgaidis-stripe committed May 8, 2024
1 parent ebf04fa commit 6529b1c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
1 change: 1 addition & 0 deletions Stripe.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"originHash" : "a6099f8b6f6e3d4e6a249794b40206685b3930858d8b410d4e86ef38217df380",
"pins" : [
{
"identity" : "capture-core-sp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ final public class FinancialConnectionsSheet {
/// :nodoc:
extension FinancialConnectionsSheet: HostControllerDelegate {
func hostController(
_ hostController: HostController, viewController: UIViewController,
_ hostController: HostController,
viewController: UIViewController,
didFinish result: HostControllerResult
) {
viewController.dismiss(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,12 +716,7 @@ extension PaymentSheetFormFactory {
)
}
}(),
emailElement: (
// TODO: does this email logic make sense?
(configuration.billingDetailsCollectionConfiguration.email != .never)
? makeEmail()
: nil
),
emailElement: makeEmail(),
theme: theme
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,6 @@ final class InstantDebitsPaymentMethodElement: Element {
emailElement: PaymentMethodElement?,
theme: ElementsUITheme = .default
) {
let willShowEmailField = (configuration.billingDetailsCollectionConfiguration.email != .never)
let hasDefaultEmail = (
configuration.billingDetailsCollectionConfiguration.attachDefaultsToPaymentMethod
&& configuration.defaultBillingDetails.email != nil
)

// Fail loudly: This is an integration error
assert(
// TODO: is it a mandatory step to provide an email???
(willShowEmailField || hasDefaultEmail),
"If email is not collected, they must be provided through defaults"
)

self.configuration = configuration
self.linkedBankInfoView = BankAccountInfoView(frame: .zero, theme: theme)
self.linkedBankInfoSectionElement = SectionElement(
Expand Down

0 comments on commit 6529b1c

Please sign in to comment.