-
Notifications
You must be signed in to change notification settings - Fork 994
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
Support BDCC in native Link #4692
base: master
Are you sure you want to change the base?
Conversation
0d6c288
to
8cc39bc
Compare
🚨 New dead code detected in this PR: ConsumerSession.swift:24 warning: Initializer 'init(clientSecret:emailAddress:redactedFormattedPhoneNumber:unredactedPhoneNumber:phoneNumberCountry:verificationSessions:supportedPaymentDetailsTypes:)' 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 |
@@ -16,19 +16,25 @@ final class ConsumerSession: Decodable { | |||
let clientSecret: String | |||
let emailAddress: String | |||
let redactedFormattedPhoneNumber: String | |||
let unredactedPhoneNumber: String? |
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.
We're pulling the unredacted phone number to potentially prefill an empty phone number field.
051eb11
to
b3f9d9e
Compare
9ba4d76
to
c73ccd6
Compare
c73ccd6
to
8395c6f
Compare
@@ -385,8 +389,10 @@ extension STPAPIClient { | |||
] | |||
|
|||
if let details = updateParams.details, case .card(let expiryDate, let billingDetails) = details { | |||
parameters["exp_month"] = expiryDate.month | |||
parameters["exp_year"] = expiryDate.year | |||
if let expiryDate { |
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.
Does the update call work if expiryDate is nil?
let label = UILabel() | ||
label.font = LinkUI.font(forTextStyle: .title) | ||
label.textColor = .linkPrimaryText | ||
label.adjustsFontForContentSizeCategory = true | ||
label.numberOfLines = 0 | ||
label.textAlignment = .center | ||
label.text = String.Localized.update_card | ||
label.text = if isBillingDetailsUpdateFlow { | ||
// TODO: Localize me |
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.
Can you make this a localized string before landing?
private lazy var cvcElement: TextFieldElement = { | ||
let cvcElement = TextFieldElement( | ||
configuration: TextFieldElement.CVCConfiguration( | ||
// If we're using a placeholder, we just fill up the view with zeros. |
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.
We'll render it as "•••" though, 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.
Ah, yes, I see that below now
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.
private extension STPElementsSession { | ||
func isCompatible(with configuration: PaymentElementConfiguration) -> Bool { | ||
// We can't collect billing details if we're in the web flow, so turn Link off for those cases. | ||
let nativeLink = deviceCanUseNativeLink(elementsSession: self, configuration: configuration) |
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.
Kinda wondering what happens if the device fails the attestation check after this — I almost wonder if we should just hide Link entirely if attestation fails instead of falling back to the web flow.
Summary
Motivation
Testing
Changelog