-
Notifications
You must be signed in to change notification settings - Fork 996
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
Link v3: Add components for card editing and verification #4158
Conversation
|
Name | Version | Download | Change | Install | Change | Approval |
---|---|---|---|---|---|---|
StripeSize com.stripe.StripeSize |
1.0 (1) | 2.1 MB | ⬇️ 6 B | 6.8 MB | - | N/A |
StripeApplePaySize com.stripe.StripeApplePaySize |
1.0 (1) | 438.1 kB | - | 1.6 MB | - | N/A |
StripeFinancialConnectionsSize com.stripe.StripeFinancialConnectionsSize |
1.0 (1) | 1.3 MB | ⬇️ 1 B | 4.3 MB | - | N/A |
StripePaymentsSize com.stripe.StripePaymentsSize |
1.0 (1) | 1.2 MB | - | 4.1 MB | - | N/A |
StripePaymentsUISize com.stripe.StripePaymentsUISize |
1.0 (1) | 1.9 MB | ⬇️ 2 B | 6.3 MB | - | N/A |
StripePaymentSheetSize com.stripe.StripePaymentSheetSize |
1.0 (1) | 3.5 MB | ⬆️ 59.0 kB (1.7%) | 10.6 MB | ⬆️ 137.7 kB (1.33%) | N/A |
StripeSize 1.0 (1)
com.stripe.StripeSize
No changes to report
StripeApplePaySize 1.0 (1)
com.stripe.StripeApplePaySize
No changes to report
StripeFinancialConnectionsSize 1.0 (1)
com.stripe.StripeFinancialConnectionsSize
No changes to report
StripePaymentsSize 1.0 (1)
com.stripe.StripePaymentsSize
No changes to report
StripePaymentsUISize 1.0 (1)
com.stripe.StripePaymentsUISize
No changes to report
StripePaymentSheetSize 1.0 (1)
com.stripe.StripePaymentSheetSize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 137.7 kB (1.33%)
Total download size change: ⬆️ 59.0 kB (1.7%)
Largest size changes
Item | Install Size Change |
---|---|
Localizable.strings | ⬆️ 4.1 kB |
Code Signature | ⬆️ 3.3 kB |
📝 StripePaymentSheet.LinkPaymentMethodPicker.Cell.setupUI | ⬆️ 3.0 kB |
📝 StripePaymentSheet.LinkUI.appearance | ⬆️ 2.4 kB |
📝 StripePaymentSheet.LinkPaymentMethodPicker.CellContentView.iconCo... | ⬆️ 2.3 kB |
🛸 Powered by Emerge Tools
Comment trigger: Size diff threshold of 100.00kB exceeded
319a3d8
to
5c6f1bd
Compare
🚨 New dead code detected in this PR: LinkPaymentMethodPicker-Cell.swift:25 warning: Property 'menuSpacing' is unused
LinkPaymentMethodPicker-Cell.swift:244 warning: Parameter 'sender' is unused
LinkPaymentMethodPicker-Header.swift:71 warning: Property 'cardNumberLabel' is unused
LinkPaymentMethodPicker.swift:175 warning: Parameter 'sender' is unused
LinkPaymentMethodPicker.swift:219 warning: Function 'showLoader(at:)' is unused
LinkPaymentMethodPicker.swift:228 warning: Function 'hideLoader(at:)' is unused
LinkPaymentMethodPicker.swift:237 warning: Function 'setAddPaymentMethodButtonEnabled(_:)' is unused
LinkPaymentMethodPicker.swift:273 warning: Function 'removePaymentMethod(at:animated:)' is unused
LinkCardEditElement.swift:29 warning: Class 'LinkCardEditElement' is unused
LinkCardEditElement.swift:204 warning: Extension 'LinkCardEditElement' is unused
LinkVerificationController.swift:12 warning: Class 'LinkVerificationController' is unused
LinkVerificationController.swift:37 warning: Extension 'LinkVerificationController' is unused
LinkVerificationView-LogoutView.swift:9 warning: Imported module 'StripeCore' is unused
LinkVerificationView.swift:11 warning: Imported module 'StripeCore' is unused
LinkVerificationView.swift:18 warning: Parameter 'view' is unused
LinkVerificationView.swift:153 warning: Parameter 'sender' is unused
LinkVerificationViewController.swift:59 warning: Initializer 'init(mode:linkAccount:)' is unused
LinkVerificationViewController.swift:199 warning: Parameter 'view' is unused
LinkVerificationViewController.swift:236 warning: Class 'TransitioningDelegate' is unused
LinkKeyboardAvoidingScrollView.swift:31 warning: Initializer 'init(contentView:)' is unused Please remove the dead code before merging. If this is intentional, you can bypass this check by adding the label ℹ️ If this comment appears to be left in error, double check that the flagged code is actually used and/or make sure your branch is up-to-date with |
5c6f1bd
to
7023828
Compare
StripePaymentSheet- public var paymentMethodLayout: StripePaymentSheet.PaymentSheet.PaymentMethodLayout
- }
- public enum PaymentMethodLayout {
- case horizontal
- case vertical
- case automatic
- public static func == (a: StripePaymentSheet.PaymentSheet.PaymentMethodLayout, b: StripePaymentSheet.PaymentSheet.PaymentMethodLayout) -> Swift.Bool
- public func hash(into hasher: inout Swift.Hasher)
- public var hashValue: Swift.Int {
- get
- } If you are adding a new public API consider the following:
If you are modifying or removing a public API:
If you confirm these APIs need to be added/updated and have undergone necessary review, add the label ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with |
e69c8a6
to
dcc3894
Compare
7023828
to
b00afa9
Compare
b00afa9
to
9f7cc8d
Compare
3147CECA2CC1BF550067B5E4 /* LinkPaymentMethodPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3147CEC32CC1BF550067B5E4 /* LinkPaymentMethodPicker.swift */; }; | ||
3147CECB2CC1BF550067B5E4 /* LinkPaymentMethodPicker-CellContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3147CEC62CC1BF550067B5E4 /* LinkPaymentMethodPicker-CellContentView.swift */; }; | ||
3147CECC2CC1BF550067B5E4 /* LinkPaymentMethodPicker-Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3147CEC52CC1BF550067B5E4 /* LinkPaymentMethodPicker-Cell.swift */; }; | ||
3147CECD2CC1BF550067B5E4 /* LinkPaymentMethodPicker-Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3147CEC72CC1BF550067B5E4 /* LinkPaymentMethodPicker-Header.swift */; }; | ||
3147CECE2CC1BF550067B5E4 /* LinkPaymentMethodPicker-RadioButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3147CEC82CC1BF550067B5E4 /* LinkPaymentMethodPicker-RadioButton.swift */; }; | ||
3147CECF2CC1BF550067B5E4 /* LinkPaymentMethodPicker-AddButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3147CEC42CC1BF550067B5E4 /* LinkPaymentMethodPicker-AddButton.swift */; }; |
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.
Nit: I would prefer these file names to be +CellContentView.swift
or +Cell.swift
, etc.., but I guess we can keep them using the '-' symbol?
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 think +
is usually reserved for extensions. (Like UIView+StripeAdditions
.) If I were starting over today I would make this a folder structure (e.g. LinkPaymentMethodPicker/AddButton.swift
), but the -
is fine too
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { | ||
if self.point(inside: point, with: event) { | ||
return self | ||
} | ||
|
||
return nil | ||
} |
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 think this is fine for now, assuming it "works", but hoping to get rid of it at some point in time. In the past, hitTest() was causing us issues with views that were being recycled -- my guess is that we'll go through a dogfooding/QA cycle, right?
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 think that was just because we were calling it during reloadData()
in that case? Overriding hitTest
in general shouldn't be a problem
contentView.paymentMethod = paymentMethod | ||
updateAccessibilityContent() | ||
|
||
guard let paymentMethod = paymentMethod else { |
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.
nit:
guard let paymentMethod else {
}
case .bankAccount: | ||
return false | ||
case .unparsable: | ||
return false |
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.
nit: can be combined to
case .bankAccount, .unparsable:
bankIconView.leadingAnchor.constraint(greaterThanOrEqualTo: view.leadingAnchor), | ||
bankIconView.topAnchor.constraint(greaterThanOrEqualTo: view.topAnchor), | ||
bankIconView.trailingAnchor.constraint(lessThanOrEqualTo: view.trailingAnchor), | ||
bankIconView.bottomAnchor.constraint(lessThanOrEqualTo: view.bottomAnchor), |
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 would have expected these to all be just equalTo not greaterThanOr/lessThanOr
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 think it makes sense, you want the icon to be:
- Centered (with the centerXAnchor and centerYAnchor)
- To follow their intrinsic size
- To not extend beyond the leading, trailing, top, or bottom anchors
If you set this as equalTo, you'd be requiring that the view extend to the edges of the containing view, which may not be correct depending on its intrinsic size.
...tSheet/StripePaymentSheet/Source/Internal/Link/Verification/LinkVerificationController.swift
Show resolved
Hide resolved
let codeField = OneTimeCodeTextField(configuration: | ||
.init(numberOfDigits: 6), |
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.
nit: spacing looks off.
} | ||
|
||
override var frameOfPresentedViewInContainerView: CGRect { | ||
guard let containerView = containerView else { |
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.
nit: remove = containerView
} | ||
|
||
private func calculateModalFrame(forContainerSize containerSize: CGSize) -> CGRect { | ||
guard let contentView = contentView else { |
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.
nit: remove = contentView
/// | ||
/// This is always equals to the container view safe area minus `padding` on eat edge. | ||
private var safeFrame: CGRect { | ||
guard let containerView = containerView else { |
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.
nit: remove = containerView
Summary
Add Card Edit, Payment Method Picker, and Verification components.
Motivation
Link v3
Testing
Added snapshot tests.
Changelog
None