public function subscribe($data)
 {
     // get settings
     global $WishListMemberInstance;
     $webinars = $WishListMemberInstance->GetOption('webinar');
     $settings = $webinars[$this->slug];
     $webinar4 = explode('---', $settings[$data['level']]);
     if (empty($settings)) {
         return;
     }
     $obj = new OAuth_En();
     $oauth = new OAuth($obj);
     $vars['firstName'] = $data['first_name'];
     $vars['lastName'] = $data['last_name'];
     $vars['email'] = $data['email'];
     $obj->setOrganizerKey($settings['organizerkey']);
     $obj->setAccessToken($settings['accesstoken']);
     $oauth->setWebinarId($webinar4[0]);
     $oauth->setRegistrantInfo($vars);
     $oauth->createRegistrant();
 }
        $_POST['webinar']['accesstoken'] = $obj->getAccessToken();
        $_POST['webinar']['organizerkey'] = $obj->getOrganizerKey();
        $_POST['webinar']['authorizationcode'] = trim($_POST['authorizationcode']);
        $webinar_settings[$webinar_provider] = $_POST['webinar'];
        $this->SaveOption('webinar', $webinar_settings);
        $webinar_settings = $this->GetOption('webinar');
        $webinars3 = $webinar_settings['gotomeetingapi'];
        $objOAuthEn = $oauth->getOAuthEntityClone();
        $webinars = $oauth->getWebinars();
    } else {
        echo '<font color="red" size="6px">Sorry, incorrect Authorization Code</font>';
    }
} else {
    $webinar_settings = $this->GetOption('webinar');
    $webinars3 = $webinar_settings['gotomeetingapi'];
    $obj = new OAuth_En();
    $oauth = new OAuth($obj);
    // Check if we updated the gtm webinar info and if the authorization code was changed
    if (isset($_POST['updategtmapi'])) {
        if (trim($_POST['txtauthorizationcode2']) != $webinars3['authorizationcode']) {
            $oauth->authorizeUsingResponseKey(trim($_POST['txtauthorizationcode2']));
            //if there's no error on api call, we save the access token and organizer key
            if (!$oauth->hasApiError()) {
                $_POST['webinar']['accesstoken'] = $obj->getAccessToken();
                $_POST['webinar']['organizerkey'] = $obj->getOrganizerKey();
                $_POST['webinar']['authorizationcode'] = trim($_POST['txtauthorizationcode2']);
                $webinar_settings[$webinar_provider] = $_POST['webinar'];
                $this->SaveOption('webinar', $webinar_settings);
                $webinar_settings = $this->GetOption('webinar');
                $webinars3 = $webinar_settings['gotomeetingapi'];
                $objOAuthEn = $oauth->getOAuthEntityClone();