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

Cancel expired orders using OrderManagementInterface #18832

Conversation

JeroenVanLeusden
Copy link
Member

@JeroenVanLeusden JeroenVanLeusden commented Oct 26, 2018

Description (*)

Plugins are most likely be created in the OrderManagementInterface to do additional operations instead of the cancel() method of the order itself.

Regarding our use case: We create proforma invoices for an order with pending(_payment) status. When the cron cancels these orders it will call the cancel() method on the order instead of using the OrderManagementInterface. Result is our plugins are nog triggered.

Fixed Issues (if relevant)-->

  1. None I could find.

Manual testing scenarios (*)

  1. Create pending invoice for order with pending_payment status.
  2. Set sales/orders/delete_pending_after to 0.
  3. Create before plugin on OrderManagementInterface::cancel() which cancel any open invoices.
  4. Run the cron sales_clean_orders to cancel the order.
  5. Invoices are not canceled while they should.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@JeroenVanLeusden JeroenVanLeusden added Release Line: 2.3 partners-contribution Pull Request is created by Magento Partner Partner: Reach Digital Pull Request is created by partner Reach Digital Partner: H&O labels Oct 26, 2018
@magento-engcom-team
Copy link
Contributor

Hi @JeroenVanLeusden. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me $VERSION instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@JeroenVanLeusden
Copy link
Member Author

JeroenVanLeusden commented Oct 26, 2018

@VladimirZaets Updated the PR.

@magento-engcom-team
Copy link
Contributor

Hi @JeroenVanLeusden. Thank you for your contribution.
We will aim to release these changes as part of 2.3.1.
Please check the release notes for final confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Sales Partner: H&O Partner: Reach Digital Pull Request is created by partner Reach Digital partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants