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

[Woo POS] UI: Reader connection presentation flow #12711

Open
4 tasks
iamgabrielma opened this issue May 13, 2024 · 4 comments
Open
4 tasks

[Woo POS] UI: Reader connection presentation flow #12711

iamgabrielma opened this issue May 13, 2024 · 4 comments
Labels
feature: POS type: task An internally driven task.

Comments

@iamgabrielma
Copy link
Contributor

iamgabrielma commented May 13, 2024

The current app implementation of the card reader connection flow is through a series of modal alerts initialized through a common service provider. The specific modals for each stage of the connection flow conform to the CardPresentPaymentsModalViewModel interface, which are served through a CardReaderConnectionAlertsProviding implementation:

Screenshot 2024-05-13 at 12 44 57

These need UIKit and Yosemite as dependencies, so we shouldn't just move them over, but a similar pattern could be used for the pos implementation, where we define a series of modal views that will be presented based on the observed connection state. At minimum we need:

  • Searching for reader
  • Found reader
  • Connecting to reader
  • Connected to reader

For the time being we can mock the different stages of the flow by forcing an update every x seconds. We should also be able to initialize the flow at any state from a testing perspective.

Handling the unhappy paths could be part of this issue, or tackled separately.

@iamgabrielma iamgabrielma added type: task An internally driven task. feature: POS labels May 13, 2024
@dangermattic
Copy link
Collaborator

Thanks for reporting! 👍

@jaclync jaclync self-assigned this May 13, 2024
@malinajirka
Copy link
Contributor

@jaclync @joshheald Ignore me if you've already done this, but make sure to sync between each other. I noticed Josh is working on exploring our options on how to approach the card-reader section (pdfdoF-51h-p2 - ticket) and there is also this task which seems to be more code-oriented assigned to you @jaclync .

I'm all up for two devs working on the same section, actually I would even say I encourage it. But I just want to make sure we are not duplicating work or making decisions which are not easily reversible without a proper discussion.

Thanks 🙇

@joshheald
Copy link
Contributor

@jaclync @joshheald Ignore me if you've already done this, but make sure to sync between each other.

I'm all up for two devs working on the same section, actually I would even say I encourage it. But I just want to make sure we are not duplicating work or making decisions which are not easily reversible without a proper discussion.

Thanks for the heads up @malinajirka, will do.

@jaclync In this case making connections actually may be a bit premature, as mentioned in the p2, because we haven't decided what payments code to reuse or how to reuse it yet – that's what I'm exploring.

If we use a mock as Gabriel mentioned, that can help us defer the decision, but that mock should probably be quite high level in this case, e.g. faking the whole card payment or connection, because having the POS manage its own connection might not even be desirable – from my exploration so far, I don't think it should have its own connection controller.

I'll try to keep across the tickets that are getting created to catch potential overlap as well.

@jaclync
Copy link
Contributor

jaclync commented May 15, 2024

The goal of this issue that I'm taking on is to implement views for just the card reader connection flow based on the latest design. As we probably want to reuse the state machine that has a lot of complexity, I looked into how the reader connection works in the existing app and I think we can reuse the state machine with UI state as refactored and shared in #12723 / pdfdoF-51h-p2#comment-6122. I'm not looking at reusing other parts to achieve the payments, just the card reader connection.

Now that I know all the UI states in the card reader connection flow in the existing app, I'm working on the POS reader connection UI flow based on similar UI states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: POS type: task An internally driven task.
Projects
None yet
Development

No branches or pull requests

5 participants