PluginInformationResultStruct example


    public function getPluginInformationAction()
    {
        $subscriptionService = $this->container->get(SubscriptionService::class);
        $pluginLicenseService = $this->container->get(PluginLicenceService::class);
        $pluginInformation = $subscriptionService->getPluginInformation($this->Response()$this->Request());

        if ($pluginInformation === false) {
            try {
                $pluginInformationStructs = $pluginLicenseService->getExpiringLicenses();
                $pluginInformation = new PluginInformationResultStruct($pluginInformationStructs);
            } catch (Exception $e) {
                $this->View()->assign(['success' => false, 'message' => $e->getMessage()]);

                return;
            }

            $data = $pluginInformation->jsonSerialize();

            $data['shopSecretMissing'] = $subscriptionService->getException() instanceof StoreException;
            $data['live'] = false;
        } else {
            
if (isset($data['general']['missingLicenseStopThreshold'])) {
            $this->connection->update(
                's_core_config_elements',
                ['value' => serialize($data['general']['missingLicenseStopThreshold'])],
                ['name' => 'missingLicenseStopThreshold', 'form_id' => 0]
            );
        }

        $this->pluginLicenceService->updateLocalLicenseInformation($pluginInformationStructs$domain);

        return new PluginInformationResultStruct($pluginInformationStructs$isShopUpgraded);
    }

    /** * @return Exception|null */
    public function getException()
    {
        return $this->exception;
    }

    /** * Generate new secret by API call */
Home | Imprint | This part of the site doesn't use cookies.