These things always returns false after payment success, so i always redirect to cart page. I search over the google and every where but not found helpful. My model file is:


public function isValid()
        if (!$this->checkoutSession->getLastSuccessQuoteId()) {
            return false;

        if (!$this->checkoutSession->getLastQuoteId() || !$this->checkoutSession->getLastOrderId()) {
            return false;
        return true;

After my research i have made solution for this. I made changes in Payment gateway Controller/Response.php.

I have added the following code just after "Success" response.


Issue Solved!

  • thanks, Jagveer for this answer – shohel hussain Sep 12 '20 at 10:42

Try this code may be it will help you.

$resultRedirect = $this->resultRedirectFactory->create();
return $resultRedirect;


  • Thanks for your response. Can you please tell me where should i place this code. I mean describe please. I am new to Magento – Jagveer Singh Sep 10 '20 at 14:36
  • In your code may be you will put it before return true; then it will work. – Mayur Sisodiya Sep 10 '20 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.