Cancellation of a card payment is a little tricky and error prone.
Depending where we are in the process when we cancel, different bits of the code need to be told about it, e.g. card reader discovery, or software updates, or a payment where the payment intent itself might need to be cleaned up.
We want to make this transparent using the adaptor, so that cancelling the async task just does the right thing. I didn't delve into it in the POC, and we may need to make some things accessible via Yosemite to do it.
This is an area the existing app doesn't handle perfectly right now, IMO.
### Tasks
- [x] Initial implementation to cancel properly for each payment state https://github.com/woocommerce/woocommerce-ios/pull/13100
- [x] Add a new `OrderAction.retrieveOrderRemotely` to always sync the order from the network in `CollectOrderPaymentUseCase` to replace the previous fix by upserting orders to storage https://github.com/woocommerce/woocommerce-ios/pull/13100#discussion_r1651393096 https://github.com/woocommerce/woocommerce-ios/pull/13147
Cancellation of a card payment is a little tricky and error prone.
Depending where we are in the process when we cancel, different bits of the code need to be told about it, e.g. card reader discovery, or software updates, or a payment where the payment intent itself might need to be cleaned up.
We want to make this transparent using the adaptor, so that cancelling the async task just does the right thing. I didn't delve into it in the POC, and we may need to make some things accessible via Yosemite to do it.
This is an area the existing app doesn't handle perfectly right now, IMO.