-
Notifications
You must be signed in to change notification settings - Fork 1k
Show payment method preview in Link inline verification view #5179
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
base: master
Are you sure you want to change the base?
Conversation
🚨 New dead code detected in this PR: ConsumerSession+PublishableKey.swift:17 warning: Initializer 'init(consumerSession:publishableKey:displayablePaymentDetails:)' 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 |
let defaultCardBrand: String? | ||
let defaultPaymentType: PaymentType? | ||
let last4: String? | ||
let numberOfSavedPaymentDetails: Int? |
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.
e1e1cbf
to
0bc2bfa
Compare
4ff4d34
to
830629d
Compare
customerID: elementsSession.customer?.customerSession.customer, | ||
shouldPassCustomerIdToLookup: shouldPassCustomerIdToLookup |
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.
How about we only pass the customer ID if shouldPassCustomerIdToLookup
?
customerID: elementsSession.customer?.customerSession.customer, | |
shouldPassCustomerIdToLookup: shouldPassCustomerIdToLookup | |
customerID: shouldPassCustomerIdToLookup ? elementsSession.customer?.customerSession.customer : nil |
@@ -27,12 +34,42 @@ struct LinkInlineVerificationView: View { | |||
self.onComplete = onComplete | |||
} | |||
|
|||
private var scaledSeparatorWidth: CGFloat { | |||
max(Constants.baseSeparatorWidth, 0.5) // Ensure separator is always visible |
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.
This is always 1, no?
.resizable() | ||
.scaledToFit() | ||
.frame(height: 20) | ||
HStack(spacing: scaledContentSpacing) { |
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: The paymentMethodPreview.last4
doesn't seem to be properly aligned with the icon. In the screenshots, the text sits a little too high.
Summary
Adds the customer's payment method preview to the Link inline verification view.
Motivation
📈
Testing
Note that the Link logo doesn't show up on previews, so it's a blue box instead here:
Changelog
N/a