Skip to content

Order cancel api "/V1/orders/{order_id}/cancel" doesn't fail for completely invoiced order #4479

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

Closed
ruby10 opened this issue May 12, 2016 · 7 comments
Labels
bug report Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Component: Sales Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release triage wanted

Comments

@ruby10
Copy link

ruby10 commented May 12, 2016

Hi there,
As per observation on Magento2.0 on back-end there is no "Cancel" option for the order which is invoiced completely, which goes as per logic. But If I make cancel call via api "/V1/orders/{order_id}/cancel" in response I am getting "true" ,which is not correct. According to my understanding we should not be allowed to make cancel call for such orders. Also , On making cancel call for already "cancelled" orders , we get "true" in response, instead of some error message.

@maksek maksek added CS Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Component: Sales labels May 12, 2016
@mujtaba2012
Copy link

It seems the API call always return true, even if the order is already cancelled or invoiced. Instead it should returning some error code.

@srinivasanithin
Copy link

srinivasanithin commented May 13, 2016

Hi

I think this function in OrderService.php this function
`public function cancel($id)
{
$order = $this->orderRepository->get($id);
if ((bool)$order->cancel()) {
$this->orderRepository->save($order);
return true;
}

    return false;
}`

was using Order.php cancel which is always return order information even though canCancel() returns false.
` public function cancel()
{
if ($this->canCancel()) {
$this->getPayment()->cancel();
$this->registerCancellation();

        $this->_eventManager->dispatch('order_cancel_after', ['order' => $this]);
    }

    return $this;
}`

I think this is the issue

@ruby10
Copy link
Author

ruby10 commented Jun 14, 2016

@vzabaznov , @NadiyaS any update on it??

@vkorotun vkorotun removed the CS label Aug 4, 2016
@NadiyaS NadiyaS removed their assignment Aug 17, 2016
@RomanKrut
Copy link

@ruby10 Hi, thank you for your report. Internal ticket was created MAGETWO-70442.

@veloraven veloraven added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jul 4, 2017
@magento-engcom-team magento-engcom-team added bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Component: Sales Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added 2.1.x Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release labels Oct 5, 2017
@magento-engcom-team
Copy link
Contributor

@ruby10, thank you for your report.
The issue is already fixed in develop branch
But we will consider to backport the fix to patch releases

@magento-engcom-team
Copy link
Contributor

Hi @ruby10

This ticket has been marked as "Triage Wanted" due to low user involvement over time. Over the next 2 weeks we are looking for additional community feedback to decide if it should be archived or not. More information on this is available on the GitHub wiki.

Thank you for collaboration.

@magento-engcom-team
Copy link
Contributor

@ruby10 thank you for your report.

Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.

You may learn more about this initiative following this link.

Please feel free to comment or reopen the ticket if you think it should be reviewed once more. Thank you for collaboration.

magento-engcom-team pushed a commit that referenced this issue Jul 16, 2019
[honey] MC-17875: Refactor GraphQl Integration tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Component: Sales Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release triage wanted
Projects
None yet
Development

No branches or pull requests