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

UIViewRepresentable for embedded #4520

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

Conversation

porter-stripe
Copy link
Collaborator

@porter-stripe porter-stripe commented Jan 31, 2025

Summary

  • Adds EmbeddedViewRepresentable which is a SwiftUI view that can display the embedded payment element's view in SwiftUI
  • Adds EmbeddedPaymentElementView, which is the public API of the EmbeddedViewRepresentable
  • Adds a snapshot test for it

Motivation

  • Embedded SwiftUI

Testing

  • Manual
  • New snapshots

Changelog

N/A

}
}

extension UIViewController {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tested this VC stuff out in a very barebones SwiftUI app and confirmed it works. https://github.com/porter-stripe/swift-ui-embedded/tree/main

@stripe stripe deleted a comment from github-actions bot Jan 31, 2025
@stripe stripe deleted a comment from github-actions bot Jan 31, 2025
@stripe stripe deleted a comment from github-actions bot Jan 31, 2025
@@ -74,7 +74,7 @@ class EmbeddedPaymentMethodsViewSnapshotTests: STPSnapshotTestCase {
appearance.embeddedPaymentElement.row.additionalInsets = 20

let embeddedView = EmbeddedPaymentMethodsView(initialSelection: nil,
paymentMethodTypes: [.stripe(.card), .stripe(.cashApp), .stripe(.klarna)],
paymentMethodTypes: [.stripe(.card), .stripe(.cashApp), .stripe(.afterpayClearpay)],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@porter-stripe porter-stripe marked this pull request as ready for review January 31, 2025 20:48
@porter-stripe porter-stripe requested review from a team as code owners January 31, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants