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

Add checkout handling #66

Merged
merged 13 commits into from
Jan 24, 2018
Merged

Add checkout handling #66

merged 13 commits into from
Jan 24, 2018

Conversation

AntonoffEvgeniy
Copy link
Contributor

Add checkout success screen.
Add cart clearing.
Add dev scheme.

self?.state.onNext(.error(error: error))
}
if let success = success, success == true {
// TODO:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be implemented after checkout flow changes

@@ -12,4 +12,8 @@ struct CartProductListUseCase {
public func getCartProductList(_ callback: @escaping RepoCallback<[CartProduct]>) {
Repository.shared.getCartProductList(callback: callback)
}

public func clearCart(_ callback: @escaping RepoCallback<Bool>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to create separate use case (ClearCartUseCase) and move this method to them because we use simple rule: one use case = one action. Also I see that we have many different methods in CheckoutUseCase. I think we also need to separate them. @plzen Am I right?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to have use cases small as possible. So we need to encapsulate some action to use case. I agree that we need to split CheckoutUseCase.

@@ -12,4 +12,8 @@ struct CartProductListUseCase {
public func getCartProductList(_ callback: @escaping RepoCallback<[CartProduct]>) {
Repository.shared.getCartProductList(callback: callback)
}

public func clearCart(_ callback: @escaping RepoCallback<Bool>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to have use cases small as possible. So we need to encapsulate some action to use case. I agree that we need to split CheckoutUseCase.

@AntonoffEvgeniy AntonoffEvgeniy merged commit a8a81ab into develop Jan 24, 2018
@AntonoffEvgeniy AntonoffEvgeniy deleted the feature/testing_payments branch January 24, 2018 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants