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

[DTPP-142] PayPalWebPayments show stages of order #311

Merged
merged 22 commits into from
Dec 6, 2024

Conversation

GMALKHA
Copy link
Collaborator

@GMALKHA GMALKHA commented Dec 3, 2024

Reason for changes

Summary of changes

Refactored PaypalWebViewModel for better state tracking, updated PayPalButtonsView for progress handling, and fixed successView display issue.

Checklist

  • Replaced centralized state management (updateState) with PayPalPaymentState.
  • Added individual LoadingState properties for createOrderResponse and approveResultResponse.
  • Updated the UI in PayPalButtonsView to check the appropriate LoadingState for progress or error handling.
  • Introduced properties like createOrderResponse, approveResultResponse, captureOrderResponse, and authorizedOrderResponse in PaypalPayments for managing states independently.
  • Verified that the correct view is displayed after creating an order.

Authors

List GitHub usernames for everyone who contributed to this pull request.

@GMALKHA GMALKHA requested a review from a team as a code owner December 3, 2024 20:52
@GMALKHA GMALKHA requested a review from KunJeongPark December 3, 2024 20:53
@KunJeongPark
Copy link
Collaborator

KunJeongPark commented Dec 3, 2024

I think I expected the result of the order creation on the view right below the create order form and above checkout with PayPal.

@KunJeongPark
Copy link
Collaborator

KunJeongPark commented Dec 3, 2024

Pressing on PayPal checkout button is stuck in loading indicator of Create order button. I'll take a closer look at what's going on.
I think what I expected was separate results view after each state. That was my intention for wanting this, so we can compare results screens of each step.

@GMALKHA GMALKHA added wip work in progress and removed ready-for-review labels Dec 3, 2024
@KunJeongPark
Copy link
Collaborator

KunJeongPark commented Dec 4, 2024

Looks good so far, nit picks:

  1. this result view could be formatted the same as other views:
  1. Loading indicator on the buttons on checkout with PayPal action
  2. "Authorize Order" button seems unresponsive - this is because you are acting only on authorized option but observing capture order response on the PayPalWebTransactionView
  3. Your viewModel's completeTransaction is only handling authorize option, not capture.

@KunJeongPark
Copy link
Collaborator

KunJeongPark commented Dec 4, 2024

I'm trying to figure out why your result views for order completion is not appearing while it is working on main.
I see, old updatOrder assigned self.order which assigned OrderID and we are not doing it anymore so completeOrder is not getting called(as it is checking for orderID) We don't need to check for orderID anymore since it is handled in the states.

@GMALKHA
Copy link
Collaborator Author

GMALKHA commented Dec 4, 2024

I'm trying to figure out why your result views for order completion is not appearing while it is working on main. I see, old updatOrder assigned self.order which assigned OrderID and we are not doing it anymore so completeOrder is not getting called(as it is checking for orderID) We don't need to check for orderID anymore since it is handled in the states.

Ah, that was actually something I was planning to refactor yesterday. Right, the orderId is no longer used, and we need to remove a check from there.

@GMALKHA
Copy link
Collaborator Author

GMALKHA commented Dec 5, 2024

I'm trying to figure out why your result views for order completion is not appearing while it is working on main. I see, old updatOrder assigned self.order which assigned OrderID and we are not doing it anymore so completeOrder is not getting called(as it is checking for orderID) We don't need to check for orderID anymore since it is handled in the states.

The loading indicator wasn’t showing because it was tracking the orderID computed property, but it wasn’t assigned in the ViewModel and was always nil. I’ll push a commit to set the orderID

The approve result view is not appearing because the state for approveResultResponse always defaults to idle instead of transitioning to loaded. I'm looking into that.

@GMALKHA GMALKHA added ready-for-review and removed wip work in progress labels Dec 6, 2024
@KunJeongPark
Copy link
Collaborator

Hey Georgi, it looks good so far, just doing some testing. Can you order the views in order they appear?
The main container view, and then order of appearance?

@KunJeongPark
Copy link
Collaborator

🎉 Great job Georgi!

@GMALKHA GMALKHA merged commit c7a789d into main Dec 6, 2024
7 checks passed
@GMALKHA GMALKHA deleted the DTPP-142_PayPalWebPayments_show_stages_of_order branch December 6, 2024 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants