public function webhook()
 {
     if (!isset($this->request->post['type']) || !isset($this->request->post['data']) || !isset($this->request->get['code'])) {
         return;
     }
     $version = !defined('VERSION') ? 140 : (int) substr(str_replace('.', '', VERSION), 0, 3);
     $settings = $version < 151 ? unserialize($this->config->get($this->name . '_data')) : $this->config->get($this->name . '_data');
     if ($this->request->get['code'] != $settings['urlcode']) {
         if ($settings['logerrors']) {
             $this->log->write(strtoupper($this->name) . ' WEBHOOK ERROR: webhook URL code ' . $this->request->get['code'] . ' does not match the extension code ' . $settings['urlcode'] . ' for action "' . $this->request->post['type'] . '" for e-mail address ' . $this->request->post['data']['email']);
         }
         return;
     }
     $this->load->library('mailchimp_integration');
     $mailchimp_integration = new MailChimp_Integration($this->config, $this->db, $this->log);
     $mailchimp_integration->webhook($this->request->post['type'], $this->request->post['data']);
 }
 public function sync()
 {
     $this->load->library($this->name);
     $mailchimp_integration = new MailChimp_Integration($this->config, $this->db, $this->log);
     echo $mailchimp_integration->sync($this->request->post[$this->name . '_data']);
 }