Skip to content

Commit

Permalink
Added pin_expiry param in function verify_request
Browse files Browse the repository at this point in the history
  • Loading branch information
seadog007 committed Sep 9, 2016
1 parent 01d31e5 commit 8a1ed1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion controllers/example.php
Expand Up @@ -142,7 +142,8 @@ public function index()
$code_length = '4'; //optional 4 or 6
$lg = 'en-us'; //optional nexmo default en-us https://docs.nexmo.com/index.php/voice-api/text-to-speech#languages
$require_type = null; //optional enabled on request by nexmo
$response = $this->nexmo->verify_request($to, $brand, $sender_id, $code_length, $lg, $require_type);
$pin_expiry = 300;
$response = $this->nexmo->verify_request($to, $brand, $sender_id, $code_length, $lg, $require_type, $pin_expiry);
echo "<h1>Verify - Request</h1>";
$this->nexmo->d_print($response);
echo "<h3>Response Code: " . $this->nexmo->get_http_status() . "</h3>";
Expand Down
5 changes: 4 additions & 1 deletion libraries/nexmo.php
Expand Up @@ -429,9 +429,11 @@ public function search_rejections($date = null, $to = null)
* @param string
* @param string
* @param string
* @param string
* @param int
* return json or xml
*/
public function verify_request($to, $brand, $sender_id = null, $code_length = null, $lg = null, $require_type = null)
public function verify_request($to, $brand, $sender_id = null, $code_length = null, $lg = null, $require_type = null, $pin_expiry = 300)
{
$options = [
CURLOPT_HTTPHEADER => ["Accept: application/" . $this->_format],
Expand All @@ -444,6 +446,7 @@ public function verify_request($to, $brand, $sender_id = null, $code_length = nu
'code_length' => $code_length,
'lg' => $lg,
'require_type' => $require_type,
'pin_expiry' => $pin_expiry,
];

return $this->request('get', $this->verify_url($params), null, $options);
Expand Down

1 comment on commit 8a1ed1e

@vaghelasuraj
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank's

Please sign in to comment.