-
-
Notifications
You must be signed in to change notification settings - Fork 72
Description
Hello,
I figured out that authorized payments seem to be really not supported by the refund plugin.
Let me explain more precisely:
Order checkout
┌────────────────────────┐ ┌──────────────────────────┐
│ │ │ │
│ Payment by card │ │ Order │ Refund will fail
│ (stripe for me) ├────────────────────► (state: new) ├─────────►
│ NOT captured │ │ │
└────────────────────────┘ └───────────┬──────────────┘
│
│ Human action:
│ stock verification etc
┌───────────▼──────────────┐
│ │
│ Order │
│ (state fulfilled) │
└───────────┬──────────────┘
│
│
┌───────────▼───────────────┐
│ │
│ Payment capture │
│ │
└───────────┬───────────────┘
│
│ Any refund from here
▼ is working
I'm not sure how critical is this issue, but when the payment is only captured, the refund page is a 500 error.
Mostly because of those 2 lines:
RefundPlugin/src/Resources/views/_paymentMethod.html.twig
Lines 2 to 3 in 09ef1e6
| {% set completed = constant('Sylius\\Component\\Core\\Model\\PaymentInterface::STATE_COMPLETED') %} | |
| {% set original_payment_method = order.lastPayment(completed).method %} |
But it's also complicated to allow a refund on a non captured payment, because it's not really a refund: it's just a reduction of the amount to capture if not all the items are canceled (or even partially canceled).
I think there's also some issues with stock management when an item is refund but the whole order not canceled.
I'm not sure of anything here, I'm just exposing a problem that has tons of solutions...