Skip to content

Commit

Permalink
Make Address Element name field non-configurable and always required (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki-stripe authored Oct 13, 2022
1 parent a3b20e8 commit d2bfbce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ import Foundation
case required
}

/// Configuration for the field that collects a full name.
public var name: FieldConfiguration

/// Configuration for the field that collects a phone number.
public var phone: FieldConfiguration

Expand All @@ -107,8 +104,7 @@ import Foundation
public var checkboxLabel: String?

/// Initializes an AdditionalFields
public init(name: FieldConfiguration = .required, phone: FieldConfiguration = .hidden, checkboxLabel: String? = nil) {
self.name = name
public init(phone: FieldConfiguration = .hidden, checkboxLabel: String? = nil) {
self.phone = phone
self.checkboxLabel = checkboxLabel
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ extension AddressSectionElement.AdditionalFields {
}

self.init(
name: config(from: additionalFields.name),
name: config(from: .required),
phone: config(from: additionalFields.phone)
)
}
Expand Down

0 comments on commit d2bfbce

Please sign in to comment.