Skip to content
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

Add internal "Native Link" switch #4205

Merged
merged 4 commits into from
Nov 8, 2024
Merged

Conversation

davidme-stripe
Copy link
Contributor

Summary

  • Add a client-side switch to enable Link.
  • Connect the switch to an internal PaymentSheet config var.
  • Move some existing Link-related protocol implementations from PaymentSheet.swift to PaymentSheet+Link.swift.

Motivation

Enabling testing of native Link

Testing

Tested in PS Example

Changelog

No user-facing changes

@davidme-stripe davidme-stripe requested review from a team as code owners October 31, 2024 00:35
Copy link

github-actions bot commented Oct 31, 2024

🚨 New dead code detected in this PR:

PayWithLinkViewController.swift:28 warning: Parameter 'payWithLinkViewController' is unused
LinkVerificationController.swift:18 warning: Property 'selfRetainer' is assigned, but never used
LinkVerificationController.swift:26 warning: Function 'present(from:completion:)' is unused
PaymentSheet+Link.swift:32 warning: Parameter 'payWithLinkWebController' is unused
PaymentSheet+Link.swift:41 warning: Parameter 'completion' is unused
PaymentSheet+Link.swift:88 warning: Function 'verifyLinkSessionIfNeeded(with:intent:completion:)' is unused
PaymentSheet+Link.swift:151 warning: Parameter 'payWithLinkViewController' is unused
PaymentSheet.swift:356 warning: Function 'pay(with:)' is unused
PaymentSheet.swift:357 warning: Function 'clearTextFields()' is unused
PaymentMethodFormViewController.swift:159 warning: Function 'clearTextFields()' is unused
PaymentSheetVerticalViewController.swift:439 warning: Function 'clearTextFields()' is unused

Please remove the dead code before merging.

If this is intentional, you can bypass this check by adding the label skip dead code check to this PR.

ℹ️ 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 master.

Comment on lines 143 to 166
}
}

func payWithLinkViewControllerDidCancel(_ payWithLinkViewController: PayWithLinkViewController) {
payWithLinkViewController.dismiss(animated: true)
}

func payWithLinkViewControllerDidFinish(
_ payWithLinkViewController: PayWithLinkViewController,
result: PaymentSheetResult
) {
completion?(result)
}

private func findPaymentSheetViewController() -> PaymentSheetViewController? {
for vc in bottomSheetViewController.contentStack {
if let paymentSheetVC = vc as? PaymentSheetViewController {
return paymentSheetVC
}
}

return nil
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spacing looks off here.

@davidme-stripe davidme-stripe enabled auto-merge (squash) November 7, 2024 23:48
@davidme-stripe davidme-stripe merged commit 91bdadf into master Nov 8, 2024
6 checks passed
@davidme-stripe davidme-stripe deleted the relink/connect-paymentsheet branch November 8, 2024 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants