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

Refactor VerticalPaymentMethodListSelection -> RowButton.Type #4526

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

yuki-stripe
Copy link
Collaborator

Summary

This renames VerticalPaymentMethodListSelection to RowButton.Type and adds a type property to RowButton.

Motivation

There was potential value in having RowButton be agnostic to whether it was a saved PM / new PM / Apple Pay / Link, in particular if we ever wanted to move it to StripeCore. But it's too useful for RowButton to hold onto its type and I don't think it's worse off for it. We can simplify EmbeddedPaymentMethodsView a lot with this change.

Vertical mode could also benefit from this change but I'll leave that for another PR.

Testing

Existing tests, no new behavior

Changelog

Not user facing

@yuki-stripe yuki-stripe force-pushed the yuki/embedded-update-form-pm-row-pt-2 branch from c5fcad7 to afa36d4 Compare January 31, 2025 17:49
Copy link

github-actions bot commented Jan 31, 2025

⚠️ Public API changes detected:

StripeCore

- public func caseInsensitiveContains(_ other: Swift.String) -> Swift.Bool
- @discardableResult
- public mutating func remove(_ element: Element) -> Element?

If you are adding a new public API consider the following:

  • Do these APIs need to be public or can they be protected with @_spi(STP)?
  • If these APIs need to be public, assess whether they require an API review.

If you are modifying or removing a public API:

  • Does this require a breaking version change?
  • Do these changes require API review?

If you confirm these APIs need to be added/updated and have undergone necessary review, add the label modifies public API to this PR to acknowledge and bypass this check.

ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with master.

@@ -28,4 +28,11 @@ extension Array where Element: Equatable {
guard let index = firstIndex(of: element) else { return nil }
return remove(at: index)
}

@discardableResult public mutating func replace(_ element: Element, with newElement: Element) -> Element? {
Copy link
Collaborator

@porter-stripe porter-stripe Jan 31, 2025

Choose a reason for hiding this comment

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

Looks like CI flagged this, but should be behind SPI.

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