Closed leonhelmus closed 1 month ago
Hi @leonhelmus. Thank you for your report. To speed up processing of this issue, 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@magento I am working on this
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.
Hi @engcom-Dash. 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:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Hi @leonhelmus
Thanks for reporting and collaboration.
Verified the issue on Magento 2.4.7-p1 but the issue is not reproducible.
Steps to reproduce First create a customer where you add store credit (magento_customerbalance). Than add a product which you can pay of partially or full with store credit. Than it could trigger a error from an external psp. In magento the order has been processed even though this error was given back. I get twice as much store credit back.
I am getting the store credit back, but not doubled.
Please refer the attached screenshots.
Customer store credit in admin
Placing the order with partial store credit and partially with Paypal and the error is triggered
Refund received
Hi @leonhelmus
We have noticed that this issue has not been updated for a long time. Hence we assume this issue is fixed, so we are closing it. Please feel free to raise a fresh ticket or reopen this ticket if you need more assistance.
Thanks.
Preconditions and environment
Adobe Commerce: 2.4.6-p4 php 8.1
Steps to reproduce
Expected result
I get my store credit back, but not doubled.
Actual result
I get two times as much store credit back.
Additional information
Additional info If this function (\Magento\Quote\Model\QuoteManagement::submitQuote) receives an error of an external psp after the order has been created Magento will rollbackAddresses using this function: \Magento\Quote\Model\QuoteManagement::rollbackAddresses.
This than triggers the dispatch the event
sales_model_service_quote_submit_failure
which in turn invokes this observer: \Magento\CustomerBalance\Observer\RevertStoreCreditObserver::executeAfterwards on the same event the external psp has this event:
Which triggers a cancellation of the order which triggers this function (\Magento\Sales\Model\Order::cancel) Which adds the following event
order_cancel_after
which triggers the same observer again: \Magento\CustomerBalance\Observer\RevertStoreCreditObserver::executeIn my opinion \Magento\CustomerBalance\Observer\RevertStoreCreditForOrder should check if the customer has already received a refund of store balance and if this has already been triggered it should skip saving an additional time. This is prone to add issues since it does not check if it has already refunded the store credit on quote level or order level.
Workaround fix/ patch
Release note
No response
Triage and priority