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

feature: Components - breaking the ice #1109

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

Conversation

borisprimer
Copy link
Contributor

This is a WIP PR for all the Components related for now, keeping it in the draft.

Screen.Recording.2025-02-06.at.16.08.43.mov

@borisprimer borisprimer requested a review from a team as a code owner February 6, 2025 15:09

/// Returns the current simulated state.
func getState() async -> PaymentMethodState {
// TODO: Replace simulated state with actual state mapping from your processing logic.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ TODOs should be resolved (Replace simulated state with a...). (todo)


/// Simulate payment submission.
func submit() async -> Result<PaymentResult, Error> {
// TODO: Replace with real payment submission logic.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ TODOs should be resolved (Replace with real payment subm...). (todo)

Text("Default UI for \(method.name)")
.font(.headline)
.padding()
// TODO: Add form fields, validations, and error messaging as needed.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ TODOs should be resolved (Add form fields, validations, ...). (todo)


/// Initialize with default payment methods.
init() {
// TODO: In a production system, fetch or update available payment methods dynamically.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ TODOs should be resolved (In a production system, fetch ...). (todo)

return AsyncStream { continuation in
self.paymentMethodsContinuation = continuation
continuation.yield(self._paymentMethods)
// TODO: Implement dynamic updates if payment methods change.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ TODOs should be resolved (Implement dynamic updates if p...). (todo)


/// Returns the current state for PayPal.
func getState() async -> PaymentMethodState {
// TODO: Replace with actual state logic for PayPal.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ TODOs should be resolved (Replace with actual state logi...). (todo)


/// Submits the PayPal payment.
func submit() async -> Result<PaymentResult, Error> {
// TODO: Implement PayPal-specific submission logic.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ TODOs should be resolved (Implement PayPal-specific subm...). (todo)

Text("PayPal Payment UI for \(method.name)")
.font(.headline)
.padding()
// TODO: Add PayPal-specific UI elements and configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ TODOs should be resolved (Add PayPal-specific UI element...). (todo)

.font(.title)
.padding()


Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace)

PrimerUIManager.primerRootViewController?.show(viewController: pucvc)

if #available(iOS 15.0, *) {
// TODO: TEMP - JUST FOR TESTING
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ TODOs should be resolved (TEMP - JUST FOR TESTING). (todo)

Copy link
Contributor

github-actions bot commented Feb 6, 2025

Warnings
⚠️ This PR doesn't seem to contain any updated Unit Test 🤔. Please consider double checking it.🙏
⚠️ > Pull Request size seems relatively large. If this Pull Request contains multiple changes, please split each into separate PR will helps faster, easier review.
⚠️ Please assign someone aside from CODEOWNERS (@checkout-pci-reviewers) to review this PR.

Generated by 🚫 Danger Swift against 997823e

Copy link

sonarqubecloud bot commented Feb 6, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
16.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Contributor

github-actions bot commented Feb 6, 2025

return .success(PaymentResult(success: true, message: "Payment processed successfully"))
}

#if canImport(SwiftUI)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we require #canImport(SwiftUI) given our current iOS target?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants