2

When I am placing order by my payment gateway I am getting error "Invalid state change requested". when I debug the core code then I found that error is coming from plugin used by core classes.

Magento\Quote\Model\QuoteRepository\Plugin\AccessChangeQuoteControl.php

public function beforeSave(CartRepositoryInterface $subject, CartInterface $quote)
{ 
    if (! $this->changeQuoteControl->isAllowed($quote)) {
        throw new StateException(__("Invalid state change requested"));
    }
}

Please anyone have an idea why i m facing this issue ?

Hemangi Patel
  • 335
  • 2
  • 16

1 Answers1

-1

when customer does not pass the Authentication Token in headers.

Magento 2 doesn't give access to Quote for users without authentication token.

Please Pass authentication token Properly.

Oscprofessionals
  • 1,795
  • 9
  • 20
  • how customer can pass Authentication token , they are placing an order through authorize.net payment gatway @Oscprofessionals – Hemangi Patel Oct 01 '19 at 11:14
  • Please refer this two links 1. https://devdocs.magento.com/guides/v2.3/get-started/authentication/gs-authentication-token.html & 2. https://magento.stackexchange.com/questions/235319/magento-2-rest-api-using-basic-auth – Oscprofessionals Oct 01 '19 at 11:16
  • ok, let me check – Hemangi Patel Oct 01 '19 at 11:17
  • 1
    I checked link but idid not get that what is relation of customer with access token , however if they placed an order without login @Oscprofessionals – Hemangi Patel Oct 01 '19 at 11:25
  • Basically when you work with some framework, you need to work according to that. SO follow the rules of framework. – Oscprofessionals Oct 01 '19 at 11:30
  • I m not using Rest Api , i think for that i need to check for authorize token this is just payment gateway inbuilt Authorize.net @Oscprofessionals – Hemangi Patel Oct 02 '19 at 04:42