Open jhruehl-DEN opened 1 year ago
As expected: Resetting the order state "processing" as default for the order status "processing" instead of "processing_wallee" fixed the issue and the order status is correctly set to "Processing" instead of "Hold Delivery" when wallee calls the webhook to set the order as fullfillable.
Not sure about the intention in vendor/wallee/magento-2/Setup/Patch/Data/AddSetupData.php class either.
=>
=>
But it seems that is another cause for the processing_wallee status to become the default for the processing state.
Dear jhruehl-DEN
Thanks for your input. We will double-check our product behavior and will give you feedback.
Best regards
Dear jhruehl-DEN
The "processing_wallee" is equals the "HOLD DELIVERY" state in Magento. This is a business decision for our plugin on our side.
If you want to change the "Processing" Magento state label on the M2 order, you simply can rename the label:
Best regards
@theodorspringwallee It's not at all about the order status processing_wallee, but about your extension making it the default for the order state "processing". That way the order stays on "Hold Delivery" even when the webhook is called to set the order to "The order can be fulfilled now." or send that the payment has been fullfilled.
Because of this line: https://github.com/wallee-payment/magento-2/blob/c8fc5a2411e7b36f5382aa3c126c08c0e7f48d82/Model/Webhook/Listener/Transaction/FulfillCommand.php#L61C13-L61C86
Given you set true in here: $order->addStatusToHistory(true, __('The order can be fulfilled now.'));
This leads to the default status to be used for the status "processing", which by your update script is set to be "processing_wallee".
In pictures: With your extension changing "processing_wallee" as the default status of the order state "processing".
With my fix to set the order status "processing" back as default for the order state "processing"
Click through your code in a Magento2 vanilla project yourself under the premise of your default-value changes.
The question is, if it was even your intention to adjust the default-value, because the use in the given upgrade script is wrong, because you serve the string "processing" as the supposedly boolean value for "isDefault" (second argument in assignState function call) here. https://github.com/wallee-payment/magento-2/blob/c8fc5a2411e7b36f5382aa3c126c08c0e7f48d82/Setup/Patch/Data/AddSetupDataState.php#L42
status?
@theodorspringwallee, @jhruehl-DEN Do you have some updates here? I have the same problem. Please share a possible solution or progress here.
In wallee/magento-2/Model/Webhook/Listener/Transaction/FulfillCommand.php the order status is set to "processing", if the order can be fullfilled, but given that the processingwallee state is set as default value for the processing statuses (in wallee/magento-2/Setup/Patch/Data/UpdateStatusStateData.php), it leaves the orders in the "Hold delivery" status, because updating the oder status via "$order->addStatusToHistory(true, _('The order can be fulfilled now.'));" sets the default order status value for the last set order state, which your update script ensures to be processing_wallee now.
The basic mistake the developers have made is mingling with the default magento order processes by setting another default state for the processing status. This should be addressed and I guess it already caused a lot of customers quite some headache, because the Magento 2 order flow relies on the order statuses to have certain values like "processing" to continue and not on "processing_wallee".
As the processing_wallee status label "Hold Delivery" suggests, it should not be shown when "The order can be fulfilled now.".
I'm going to check myself now, if I can simply correct that mistake by resetting the order state "processing" as default for the order status "processing".