adyen-magento2
adyen-magento2 copied to clipboard
[ECP-8912] Make Pos payments flow async
Description
Moving to async flow of POS payments, an order has to be placed first without triggering sync payments call to Terminal API. After order creation an async call will be made to the plugin, which will trigger sync tender call. If the connection breaks down during this period, at least merchant would have an order on pending_payment state and Authorisation webhook can update and finalise the order.
The old flow:
The new flow diagram:
todo:
- [x] FE part to initiate Pos payment
- [x] new endpoint accepting the POS payload and trigger POS command
authorize
successfully - [x] Secured guest endpoint with cartId and orderId
- [x] The command builder build the POS payment request successfully
- [x] Make sure the authorization notification is setting the order state correctly when success is
true
orfalse
- [x] Test coverage
Tested scenarios
- [ ] Place POS payment and cancel the payment from the terminal then retry
- [ ] Place POS payment and cancel the payment from the terminal then cancel the order
- [ ] Place successful Pos payment with auto capture
Fixes #1431