-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
14602 Cancel payment when order marked complete
Adds an async `cancelPayment` function to the CardPresentPaymentFacade. This isn’t as comprehensive as the fire-and-forget version, which remains, as it can’t cancel if it’s called during non-payment events, e.g. connection and searching. We use the new async cancel to stop card payments from happening when a cash payment is accepted; it happens right before we mark the order complete. Currently failure to cancel is unhandled; it would be good to improve that! The state representation is incomplete with this approach. We should keep hold of the card payment state, if it’s still live in the background… and maybe even if it’s not. I’ve made suggestions for this in the comments. Another (maybe better?) option (commented out in this commit) is to cancel card payments as soon as the cash option is selected.
- Loading branch information
Showing
3 changed files
with
52 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters