Closed asim-blueprintprep closed 1 year ago
Hi @asim-blueprintprep. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
@magento give me 2.4-develop instance
Hi @asim-blueprintprep. Thank you for your request. I'm working on Magento instance for you.
Hi @asim-blueprintprep, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
@magento give me 2.4-develop instance
Hi @asim-blueprintprep. Thank you for your request. I'm working on Magento instance for you.
Hi @asim-blueprintprep, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
@magento give me 2.4-develop instance
Hi @asim-blueprintprep. Thank you for your request. I'm working on Magento instance for you.
Hi @asim-blueprintprep, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
@magento give me 2.4-develop instance
Hi @engcom-November. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-November, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
Hi @asim-blueprintprep , Thank you for reporting and collaboration. Verified the issue on Magento 2.4-develop instance but cannot able to reproduce the issue with provided steps. We do not have "Void" option for payments made using check / money order. Hence cancelled the order from magento admin for a Pending Order and the status is updated as "Cancelled". Please refer the screenshot below. Kindly recheck the issue on Magento 2.4-develop instance and elaborate steps to reproduce if you are still facing any issues. Thank you.
Hi, The issue is NOT with cancelling. The issue is with voiding. I am aware cancelling changes the state correctly. Please remove the screenshots from an unrelated test.
EDIT: it also is irrelevant of payment method, as the void function is core magento code - which hard codes the state to processing.
@magento give me 2.4-develop instance
Hi @asim-blueprintprep. Thank you for your request. I'm working on Magento instance for you.
Hi @asim-blueprintprep, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
How can I test if this won't create one?
@engcom-November voiding is for online transactions - how can I enable one in a magento 2.4 develop instance, without providing you our test credentials tied to our stripe account etc?
@engcom-November A work around for a local environment, so you can see the core magento bug:
edit:
vendor/magento/module-payment/Model/Method/AbstractMethod.php
and comment out:
/*if (!$this->canVoid()) {
throw new \Magento\Framework\Exception\LocalizedException(__('The void action is not available.'));
}*/
and
vendor/magento/module-sales/Block/Adminhtml/Order/View.php
and comment out:
//if ($this->_isAllowedAction('Magento_Sales::invoice') && $order->canVoidPayment()) {
$message = __('Are you sure you want to void the payment?');
$this->addButton(
'void_payment',
[
'label' => __('Void'),
'onclick' => "confirmSetLocation('{$message}', '{$this->getVoidPaymentUrl()}')"
]
);
//}
This will allow you to simulate online payment - and the void button will appear.
I have done this with bank transfer and money order:
As noted previously, there is a function which hard codes it to move the order to processing
/**
* Sets order state to 'processing' with appropriate message
*
* @param \Magento\Framework\Phrase|string $message
*/
protected function setOrderStateProcessing($message)
{
$this->getOrder()->setState(Order::STATE_PROCESSING)
->setStatus($this->getOrder()->getConfig()->getStateDefaultStatus(Order::STATE_PROCESSING))
->addStatusHistoryComment($message);
}
@magento give me 2.4-develop instance
Hi @engcom-November. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-November, here is your Magento Instance: https://35080aa70b4c318fa0a6077e54e40361.instances.magento-community.engineering Admin access: https://35080aa70b4c318fa0a6077e54e40361.instances.magento-community.engineering/admin_c0cd Login: aca0a8e2 Password: 649768e37969
@magento give me 2.4-develop instance
Hi @engcom-November. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-November, here is your Magento Instance: https://35080aa70b4c318fa0a6077e54e40361.instances.magento-community.engineering Admin access: https://35080aa70b4c318fa0a6077e54e40361.instances.magento-community.engineering/admin_c8c5 Login: edf4351d Password: 3ab1ca5aac54
Hi @asim-blueprintprep , Verified the issue again on Magento 2.4-develop instance and is working fine if a processing order is voided. As per Magento officials docs , we can VOID an order only if the order status is "Processing" and not captured. As per Magento docs, Only sales orders that are not invoiced, have a status of Processing, and a payment setting of authorize, can be voided. Scenarios tested: Scenario 1: Made payment using Payflow PRO. Order status is Processing. Void button displayed - Voided the payment - Order status is Processing. Scenario 2: Created invoice for a Processing Order with "not capture option" - VOID button is displayed. Voided the payment. Order status is processing.
Can you please provide supporting documents / proofs showing Pending orders can be voided. Kindly recheck the behavior on Magento 2.4-develop instance and provide steps for valid use case scenario. Thank you.
@engcom-November
Yes, stripe creates orders in pending regardless if if theyve been paid or not. As per a copy of my email chain with stripe:
Hi Alex,
We have received feedback from customers who prefer the old checkout flow from versions 2.x of the module. In versions 2.x, orders were not placed in Pending status when a payment failed. In versions 3.x we made this change due to limitations we had at the time with the new PaymentElement
See below screenshots:
As you can clearly see in the above, an order is created in pending, and void button is visible. I believe it is not an admin clicking it, but a webhook that comes back to void it.
This then moves the order into processing.
This is an issue either with the logic of if voiding is allowed, or with voiding moving it into processing.
Thanks,
As a follow up, here is official stripe documentation: https://stripe.com/docs/plugins/adobe-commerce/troubleshooting?locale=en-GB#order-stuck-in-pending-status
Order stuck in pending status When creating an order, the initial status is Pending, which indicates that the authorization of the payment by the customer’s bank is still pending.
Again, I CANNOT show you on a develop-instance as I cannot give you our stripe credentials.
The screenshots and documentation clearly demonstrate an ability to void a pending order.
Extra follow up screenshots:
Hi @asim-blueprintprep , Thank you for the response. Stripe payment is a 3rd party package / extension and code of this extension is not part of https://github.com/magento/magento2 git repository. This issue is not reproducible with Magento built in default payment methods. Void button will not be displayed for Pending Orders. Community cannot able to provide fix for it in this repository. All questions, issue reports and fix for them should be addressed to the corresponding extension owners(support) on the Magento Market place page Thank you.
Hi @asim-blueprintprep , We are closing this issue as there has been no latest update on the same. Kindly reopen / create new issue if you are still facing any issues. Thank you.
Preconditions and environment
If an order in pending is voided, it forces a status move to processing - voiding should leave the order in it's current state. For stripe, processing is after payment is taken, which means some customers are gaining access to things that they haven't paid for.
Steps to reproduce
Expected result
The order is left in it's state/status
Actual result
The order is moved to processing
Additional information
The hard coded move to processing comes from:
vendor/magento/module-sales/Model/Order/Payment.php
protected function _void($isOnline, $amount = null, $gatewayCallback = 'void')
$this->setOrderStateProcessing($message);
Release note
No response
Triage and priority