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
…1513)

(cherry picked from commit d2bfbce)
  • Loading branch information
yuki-stripe committed Oct 13, 2022
1 parent bb3826b commit 8399ea6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions Stripe/AddressViewController+Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ public extension AddressViewController {
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 @@ -106,8 +103,7 @@ public extension AddressViewController {
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
2 changes: 1 addition & 1 deletion Stripe/AddressViewController.swift
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 8399ea6

Please sign in to comment.