Skip to content
Claude Hangui edited this page May 23, 2021 · 2 revisions

Welcome to the online payment methods wiki! The purpose of this project is to showcase how we can display the list of various payment methods provided by serving platforms during the checkout flow. All the various errors the users might encounter when attempting to display the list should be handled properly.

Technology stack

We worked under the assumption that the app needed to be shipped as soon as possible, whilst be testable should we have to improve the existing feature or add other ones.

  • Programming language: 100% Java
  • Presentation layer: MVVM -> fast to set up, no need to reference the view in another class; google already provides the necessary components (libraries) to interact with the view. Moreover we used a Result class which provides the UI state when we start the flow to fetch the payment methods
  • Dependency injection: Dagger-Hilt -> very easy to integrate, and prevents us from having to manually inject dependencies throughout our code. Helps in providing a properly testable app
  • Network/API calls: Retrofit, OkHttp
  • Asynchronous operations: RxJava (with RxAndroid) -> Threading made easy; it simplifies the ability to chain async operations; Error handling made easy

The Code itself

  • We already know the structure of the API model that is being provided when we make the request, however, we do not need all that information on the UI so we had to define a mapper class whose purpose is to provide only the data needed upfront on the UI
  • We needed the app to be testable and having to provide dependencies manually wasn't ideal, especially if the feature needs to be improved or new features need to be added in the future. In either case providing static classes or manual dependency classes wasn't ideal for us. This is where a dependency injection framework helped us, as having to inject our dependencies will help us easily test our implementations and/or update them
  • We provided a very basic flow decomposed on the domain, data and presentation layer: while heading to the essential we kept in mind the app feature might increase in the feature in terms of specification and new features can be added.
  • A few sets of tests were performed: the viewmodel has to be tested and perhaps an instrumentation test might also be useful
Clone this wiki locally