Closed sprankhub closed 1 month ago
Hi @sprankhub ,
we will check that, and hopefully come back with a satisfying solution.
Greetings from Kiel Timo
Thanks, @T-Kuchel! Since missing increment IDs are somewhat critical, could you please handle this with high priority? As a very first step, some background information regarding MAGE-410 would be helpful. Thanks!
Hi @sprankhub ,
i raise the priority and this is now #2 on the list.
Greetings from Kiel Timo
Sorry to bug you again :confused: Any update? As said, any background information regarding MAGE-410 would be helpful in any case.
With MAGE-410 we tried to always submit the Magento invoice ID to our platform, even when basket submission is turned off. Sounded like a small and simple change at that time. It would improve merchant experience when looking for transactions in our backend, as they could search for the Magento invoice number.
I still consider this an important issue. However, my client unfortunately moved away from PAYONE, so that the issue is not that urgent any more for me.
We have a conflict of interest here. Some merchants want the invoice ID submitted to our platform, and others value consecutive invoice IDs more.
The only solution I'd see here is to wrap the functionality of #320 in a feature toggle, so that merchants can decide, if they want to potentially risk un-consecutive invoice IDs.
Unfortunately, we'll have to keep this in the backlog for now.
One of our clients has issues with missing invoice and creditmemo increment IDs. The entity IDs are consecutive, but sometimes, there are missing increment IDs. We tracked this down to a PAYONE update including the changes from https://github.com/PAYONE-GmbH/magento-1/pull/320/. Could you shed some light on what these changes from MAGE-410 should have fixed?
The issue is that currently, during the capture, if the invoice does not have an increment ID yet, you reserve a new one via
\Payone_Core_Model_Mapper_ApiRequest_Payment_Abstract::fetchNewIncrementId
. TBH, I think you should never ever do this at all since Magento does that in the invoice save process anyway. This is called via the following stack:Payone_Core_Model_Payment_Method_Abstract::capture
callsPayone_Core_Model_Service_Payment_Abstract::execute
callsPayone_Core_Model_Mapper_ApiRequest_Payment_Capture::mapFromPayment
callsPayone_Core_Model_Mapper_ApiRequest_Payment_Abstract::fetchNewIncrementId
The issue probably happens under these conditions:
capture
is called.capture
call is not wrapped in a transaction, the reserved increment ID is not rolled back.Hence, there is a reserved increment ID, which is unused.
Could you please check that? IMHO, the issue cannot be solved without removing the manual retrieval of the increment ID.
@mwr @tniebergall, since you know a thing or two about this extension ;-) and you also have bigger clients, could you check if you also have missing invoice / creditmemo increment IDs?