INSTALLATION GUIDE FOR SUBSCRIPTION
-------------------------------------------

To activate subscription, recurring must be enabled.
You can enable recurring in Admin -> Stores -> Configuration -> Sales -> Viveum.
Set "Recurring" to Yes. And don't forgot to enable credit card (recurring) and paypal (recurring).

-------------------------------------------
STEP 1:

Webhook can't create order and invoice after handle successful subscription payment, because webhook directly access and considered as guest user, so magento blocked it.

Then, you must modify file AccessChangeQuoteControl.php in :
vendor/magento/module-quote/Model/QuoteRepository/Plugin

if file not exist, try in this directory :
app/code/Magento/Quote/Model/QuoteRepository/Plugin


find and comment code below:

if (!$this->changeQuoteControl->isAllowed($quote)) {
  throw new StateException(__("Invalid state change requested"));
}

to:

// if (!$this->changeQuoteControl->isAllowed($quote)) {
//     throw new StateException(__("Invalid state change requested"));
// }

and save the file.

STEP 2:

run this command again:
- php bin/magento module:enable Viveum_Viveum
- php bin/magento setup:upgrade
- php bin/magento setup:di:compile
- php bin/magento setup:static-content:deploy -f
- php bin/magento cache:clean
- php bin/magento cache:flush
