Open viniciusfabri opened 5 years ago
@viniciusfabri thanks for reporting the issue. We will investigate.
@viniciusfabri We have tested on the specified environment. The order status has successfully passed to the "processing" state and "Invoice" has been successfully generated automatically.
Can you check if “Logging” is enabled in admin panel. (Admin panel menu -> Stores -> Configuration -> Sales -> Payment Methods -> EMS Global configuration -> Logging)
And then provide these logs for investigation:
@dligthart sent them to the email, please confirm if you received it
We have received the logs, thank you.
@viniciusfabri The logs show that the IPN request was successful. In this case, the invoice should be generated automatically.
Most likely, the problem occurs at the stage of invoice creation. There may be conflicts with other extensions. And this problem is specific to the store not to the EMS module.
We could check these logs to have a better idea: var/log/exception.log var/log/system.log
Hi @dligthart , I did see an exception on my exceptions.log file, but that was introduced in magento 2.3.2, and after applying the patch to fix it, I still don't get an invoice generated The github issue for the exception issue is https://github.com/magento/magento2/issues/23411
After fixing it, I don't have anything in my logs anymore (*.log)
No exceptions, nothing
I'm working on testing this on a vanilla Magento installation, will let you know the results
Out of curiosity, on which Magento version are you testing the module? We are on enterprise 2.3.3
UPDATE: Just finished testing on a fresh 2.3.3 version, and I'm having the same behaviour as on my customer's site: I see the transaction in the order:
No invoices:
The payment also shows as confirmed:
Comment history:
Don't know what else to try here. If you are using a fresh magento install, are you able to share which tag and a DB dump if possible (you should have my email from the logs I sent earlier) so I can compare the envs?
Also, is there an easy way to test the notification locally?
Hi @dligthart , Just figured it out: it seems that the "chargeTotal" amount that comes from EMS is a string instead of a numeric type in the JSON, and it comes like this:
'chargetotal' => '281,23',
Notice the comma as the decimal separator. When Magento processes the transaction, and checks if the total amount was paid, it converts the number to a double: https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Sales/Model/Order/Payment/Operations/RegisterCaptureNotificationOperation.php#L37
And because the string has a comma instead of a dot, 281,23 becomes 281,00, therefore the total amount is not paid, and the invoice is not generated
@viniciusfabri thanks for reporting the findings and the issue regarding the comma as a decimal separator, we are going to look into this.
Hi,
It seems when the payment is confirmed the invoice is not automatically generated, can you please confirm if that's the intended behavior?