adyen-magento2: [PW-8506] Wrong Order status when configuration field 'payment_pre_authorized' is set

Describe the bug

Why is the method \Adyen\Payment\Helper\Order::setPrePaymentAuthorized called only when we do have a successful authorization there \Adyen\Payment\Helper\Webhook\AuthorisationWebhookHandler::handleSuccessfulAuthorisation ? Shouldn’t we consider authorized payment as processed?

See Magento Doc Order Flow

Step 3: Receive Payment The status of the order changes to Processing when payment is received or authorized. Depending on the payment method, you might receive notification when the transaction is authorized or processed.

Today there’s the following configuration fields that allows us to set the status by event:

  • payment_pre_authorized
  • payment_authorized

You may have something like this:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <payment>
            <adyen_abstract>
                <payment_pre_authorized>pending_payment</payment_pre_authorized>
                <payment_authorized>processing</payment_authorized>
                <payment_cancelled>canceled</payment_cancelled>
            </adyen_abstract>
        </payment>
    </default>
</config>

So when a payment is pending authorization it is in pending_payment (so it can be cancelled automatically by Magento after a delay). When the payment is authorized we set the processing status. However, we can see that the field ‘payment_pre_authorized’ is used when a payment is authorized and not before we got the notification. ‘payment_authorized’ is used when there’s the auto-capture or the capture. So the fields are misleading and not clear. Obviously I tend to think there’s an error and that \Adyen\Payment\Helper\Webhook\AuthorisationWebhookHandler::handleSuccessfulAuthorisation should at its beginning set the status from this field: payment_authorized (when $isFullAmountAuthorized is true)

To Reproduce

  1. Enable manual capture
  2. Set the configuration as above
  3. Place an order
  4. Order is in payment review, then pending payment
  5. Order receive the successful AUTHORIZATION event
  6. Don’t capture the payment, the order is going to be cancelled by Magento (default value is 480 minutes)

Expected behavior After the successful AUTHORIZATION event, the order is in processing state, so it can’t be canceled by the Magento cron.

Magento version Any

Plugin version 8.x (8.18.2)

Additional context Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (12 by maintainers)

Most upvoted comments

If anyone finds out a patch or any solution to this issue share here, it’s a major issue and we have lost our business. Adyen this is a major issue using your module kindly quickly work around it and provide a solution. I have created a ticket but no one provide ETA.

We have also faced the same issue, our order is only updated till the pending_payment state, and after that order is automatically closed by magento. Could you please provide status processing during payment_pre_authorized? it’s a very urgent thing. we have lost our customer confidence.

We are facing the same issue. In the configuration, “Order status: payment authorization” corresponds to the “payment_pre_authorized” config which is used after the authorization event. We can only set status associated to the state “pending” and not “processing”. So the order stays “pending” after the authorization.

Note : To avoid the cancellation from Magento, you can set the “Order status: payment authorization” configuration to something else then pending_payment.