adyen-magento2 icon indicating copy to clipboard operation
adyen-magento2 copied to clipboard

[ECP-8912] Make Pos payments flow async

Open hossam-adyen opened this issue 1 year ago • 1 comments

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: Screenshot 2024-02-16 at 11 25 34 AM

The new flow diagram: Pos payment async 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 or false
  • [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

hossam-adyen avatar Feb 09 '24 13:02 hossam-adyen