Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FullfillCommand leaves order status as processing_wallee #29

Open
jhruehl-DEN opened this issue Jul 11, 2023 · 8 comments
Open

FullfillCommand leaves order status as processing_wallee #29

jhruehl-DEN opened this issue Jul 11, 2023 · 8 comments

Comments

@jhruehl-DEN
Copy link

jhruehl-DEN commented Jul 11, 2023

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 processing_wallee 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".

@jhruehl-DEN
Copy link
Author

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.

@jhruehl-DEN
Copy link
Author

Not sure about the intention in vendor/wallee/magento-2/Setup/Patch/Data/AddSetupData.php class either.
grafik

=>
grafik

=>
grafik

But it seems that is another cause for the processing_wallee status to become the default for the processing state.

@theodorspringwallee
Copy link
Contributor

Dear jhruehl-DEN

Thanks for your input. We will double-check our product behavior and will give you feedback.

Best regards

@theodorspringwallee
Copy link
Contributor

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:
grafik
grafik

Best regards

@jhruehl-DEN
Copy link
Author

jhruehl-DEN commented Jul 12, 2023

@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".
grafik

With my fix to set the order status "processing" back as default for the order state "processing"
grafik

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.

$this->status->assignState('processing', 'processing', true);

@jhruehl-DEN
Copy link
Author

grafik

@philippeaellig
Copy link

status?

@mmezhensky
Copy link

@theodorspringwallee, @jhruehl-DEN
Do you have some updates here? I have the same problem.
Please share a possible solution or progress here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants