Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Need to pass as a string in PHP
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Carson committed Oct 17, 2012
1 parent ef6ef21 commit a03d81f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -100,7 +100,7 @@ Once again you can use `ok()` to verify whether the token was valid or not.

If you wish to verify tokens even if the user has not yet complete registration, pass force=true when verifying the token.

$verification = $authy_api->verifyToken('authy-id', 'token-entered-by-the-user', array("force" => true));
$verification = $authy_api->verifyToken('authy-id', 'token-entered-by-the-user', array("force" => "true"));

## Requesting SMS Tokens
To be able to use this method you need to have activated the SMS plugin for your Authy App.
Expand All @@ -113,7 +113,7 @@ As always, you can use `ok()` to verify if the token was sent.
This call will be ignored if the user is using the Authy Mobile App. If you still want to send
the SMS pass force=>true as an option

$sms = $authy_api->requestSms('authy-id', array("force" => true));
$sms = $authy_api->requestSms('authy-id', array("force" => "true"));


### More…
Expand Down
4 changes: 2 additions & 2 deletions lib/Authy/Api.php
Expand Up @@ -71,7 +71,7 @@ public function registerUser($email, $cellphone, $country_code = 1)
*
* @param string $authy_id User's id stored in your database
* @param string $token The token entered by the user
* @param string $opts Array of options, for example: array("force" => true)
* @param string $opts Array of options, for example: array("force" => "true")
*
* @return Authy_Response the server response
*/
Expand All @@ -89,7 +89,7 @@ public function verifyToken($authy_id, $token, $opts = array())
* Request a valid token via SMS.
*
* @param string $authy_id User's id stored in your database
* @param string $opts Array of options, for example: array("force" => true)
* @param string $opts Array of options, for example: array("force" => "true")
*
* @return Authy_Response the server response
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/Authy/ApiTest.php
Expand Up @@ -48,14 +48,14 @@ public function testVerifyTokenWithInvalidToken() {
}

public function testRequestSmsWithInvalidUser() {
$sms = $this->client->requestSms(0, array("force" => true));
$sms = $this->client->requestSms(0, array("force" => "true"));

$this->assertEquals(false, $sms->ok());
}

public function testRequestSmsWithValidUser() {
$user = $this->client->registerUser('user@example.com', '305-456-2345', 1);
$sms = $this->client->requestSms($user->id(), array("force" => true));
$sms = $this->client->requestSms($user->id(), array("force" => "true"));

$this->assertEquals(true, $sms->ok());
//$this->assertEquals("is not activated for this account", $sms->errors()->enable_sms);
Expand Down

0 comments on commit a03d81f

Please sign in to comment.