I had a custom payment module that was working properly on 2.2.x as well as 2.3.x. However, when I tried to install it onto a clean 2.4.2 instance, I found that the function
getLastSuccessQuoteId() called on the checkout session always gave me a null result.
The payment gateway I implemented is more or less like the PayPal Hosted Solution, where the customers would be redirected to a 3rd party platform for the settlement, and redirected back to the shop afterward via a return URL.
On 2.2.x and 2.3.x, I was able to get the previous success quote ID by calling
getLastSuccessQuoteId() in this return URL, but now it gave me nothing.
I am not sure which part of the new Magento was contributing to the difference here. I have tried the following directions:
- add the CSP whitelist
- switch on the CSP report-only mode in the config.xml
- disable the CSP module
- implement those new
CsrfAwareActionInterface, HttpPostActionInterface, HttpGetActionInterfacefor the return action controller
In the end, I have even tried to rewrite the module completely based on the PayPal Hosted solution, but I am still getting the same result.
I really have no clue what I could have missed out on.