Skip to content

[RFC] Support for authorized payments #392

@Nek-

Description

@Nek-

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:

{% 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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions