I have a Payment Gateway which implements `SupportsNotificationsInterface`. According to docblock, in `onNotify` I should only create/change status of Payment, I don’t need to touch the Order. That makes perfect sense. `OrderEvents::ORDER_PAID` was implemented to complete Order in case it was fully paid (ex. via `onNotify`) and to be a safeguard in case user hasn’t returned from offsite payment gateway. AFAIK “fully paid” means balance is less equal zero, which means Payments need to be *captured*. When selling physical goods Payment is not captured until Order is delivered, so Order must be placed with Payment(s) in *authorization* state. Unfortunately, in that case `OrderEvents::ORDER_PAID`, along with all it’s great safeguard logic, is not fired and, in case user hasn’t returned from the offsite payment gateway Order gets stuck in payment state. Do we have a plan, an issue perhaps, for extending `OrderEvents::ORDER_PAID` functionality for *authorised* payments?
Comments
Comment #2
bojanz commentedComment #3
zaporylie#3048791: Allow checking if payment can be captured, voided or refunded could help here - we could have a code, not necessarily in commerce core but in https://www.drupal.org/project/commerce_payment_extra or even custom codebase, that checks if order is `locked` and in `payment` phase and has enough authorized payments which `canCapture`, and based on all those criteria perform place&unlock on the order.
Comment #4
zaporylieEven though this issue was created first I'm closing it as a duplicate of #3225516: The order can stay unplaced after an offsite authorization only payment as that's where the discussion happens.