public function appStoreWebhook()

in 3.0.x-and-above/upload/catalog/controller/extension/module/facebook_business.php [140:169]


    public function appStoreWebhook() {
        $json = array();

        if (($this->request->server['REQUEST_METHOD'] == 'POST')) {
            $headers = getallheaders();

            if (isset($headers['X-App-Signature'])) {
                $signature = $headers['X-App-Signature'];
            } elseif (isset($headers['x-app-signature'])) {
                $signature = $headers['x-app-signature'];
            } else {
                $signature = '';
            }

            if ($signature == 'f35ca30bfe0b48aa63404483bef6697e94b3f732') {
                $this->load->model('extension/module/facebook_business');

                if (isset($this->request->post['facebook_system_user_access_token'])) {
                    $this->model_extension_module_facebook_business->installFBE($this->request->post);
                } else {
                    $this->model_extension_module_facebook_business->uninstallFBE();
                }

                $json['success'] = true;
            }
        }

        $this->response->addHeader('Content-Type: application/json');
        $this->response->setOutput(json_encode($json));
    }