public function userNew($email, $cellphone, $countrycode = 1) {

    $data = array(
      'user[email]'        => $email,
      'user[cellphone]'    => $cellphone,
      'user[country_code]' => $countrycode,
    );

    $result = $this->apiCall('new', $data);

    if($result === false) {
      $this->lastError = 'AUTHY_SERVER_ERROR';
      return false;
    }

    if(isset($result->errors)) {
      if(isset($result->errors->api_key)) {
        $this->lastError = 'AUTHY_SERVER_INVALID_API_KEY';
      } else {
        $this->lastError = 'AUTHY_SERVER_INVALID_DATA';
      }
      return false;
    }

    if(isset($result->user->id)) {
      return $result->user->id;
    }
    $this->lastError = 'AUTHY_SERVER_SAYS_NO';
    return false;
  }
public function userNew($email, $cellphone, $countrycode = 1) {

    $data = array(
      'user[email]'        => $email,
      'user[cellphone]'    => $cellphone,
      'user[country_code]' => $countrycode,
    );

    $result = $this->apiCall('new', $data);

    if($result === false) {
      $this->lastError = 'AUTHY_SERVER_ERROR';
      return false;
    }

    if(isset($result->errors)) {
      if(isset($result->errors->api_key)) {
        $this->lastError = 'AUTHY_SERVER_INVALID_API_KEY';
      } else {
        $this->lastError = 'AUTHY_SERVER_INVALID_DATA';
      }
      return false;
    }

    if(isset($result->user->id)) {
      return $result->user->id;
    }
    $this->lastError = 'AUTHY_SERVER_SAYS_NO';
    return false;
  }
public function userNew ( $ email , $ cellphone , $ countrycode = 1 ) { $ data = array ( 'user[email]' => $ email , 'user[cellphone]' => $ cellphone , 'user[country_code]' => $ countrycode , ) ; $ result = $ this -> apiCall ( 'new' , $ data ) ; if ( $ result === false ) { $ this -> lastError = 'AUTHY_SERVER_ERROR' ; return false ; } if ( isset ( $ result -> errors ) ) { if ( isset ( $ result -> errors -> api_key ) ) { $ this -> lastError = 'AUTHY_SERVER_INVALID_API_KEY' ; } else { $ this -> lastError = 'AUTHY_SERVER_INVALID_DATA' ; } return false ; } if ( isset ( $ result -> user -> id ) ) { return $ result -> user -> id ; } $ this -> lastError = 'AUTHY_SERVER_SAYS_NO' ; return false ; }
Add a new Authy user and get the Authy ID.

@param string $email
User email.

@param string $cellphone
User cellphone.

@param string $countrycode
User countrycode. Defaults to 1 (USA).

@return mixed
Returns the users Authy ID on success or false on errors.
@see \phpSec\Auth\Authy::$lastError.
Add a new Authy user and get the Authy ID .