Skip to content

Commit 6856a43

Browse files
committed
Merge pull request #4 from kickboxio/v2
Updating to V2
2 parents 48b582f + e0ef586 commit 6856a43

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ catch (Exception $e) {
5959
echo "Code: " . $e->getCode() . " Message: " . $e->getMessage();
6060
}
6161
```
62+
#### Options
63+
64+
**timeout** `integer` (optional) - Maximum time, in milliseconds, for the API to complete a verification request. Default: 6000.
65+
66+
```php
67+
// Example with options
68+
$response = $kickbox->verify("test@example.com", array('timeout' => 6000));
69+
```
6270

6371
### Response information
6472

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kickbox/kickbox",
3-
"version": "1.0.4",
3+
"version": "2.0.0",
44
"description": "Official kickbox API library client for PHP",
55
"homepage": "http://kickbox.io",
66
"authors": [

lib/Kickbox/Api/Kickbox.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Kickbox\HttpClient\HttpClient;
66

77
/**
8-
*
8+
*
99
*/
1010
class Kickbox
1111
{
@@ -20,15 +20,17 @@ public function __construct(HttpClient $client)
2020
/**
2121
* Email Verification
2222
*
23-
* '/verify?email=:email' GET
23+
* '/verify?email=:email&timeout=:timeout' GET
2424
*
2525
* @param $email Email address to verify
2626
*/
2727
public function verify($email, array $options = array())
2828
{
2929
$body = (isset($options['query']) ? $options['query'] : array());
3030

31-
$response = $this->client->get('/verify?email='.rawurlencode($email).'', $body, $options);
31+
$timeout = (isset($options['timeout']) ? $options['timeout'] : 6000);
32+
33+
$response = $this->client->get('/verify?email='.rawurlencode($email).'&timeout='.$timeout.'', $body, $options);
3234

3335
return $response;
3436
}

lib/Kickbox/HttpClient/HttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class HttpClient
1919
{
2020
protected $options = array(
2121
'base' => 'https://api.kickbox.io',
22-
'api_version' => 'v1',
23-
'user_agent' => 'alpaca/0.2.1 (https://github.com/pksunkara/alpaca)'
22+
'api_version' => 'v2',
23+
'user_agent' => 'kickbox-php/2.0.0 (https://github.com/kickboxio/kickbox-php)'
2424
);
2525

2626
protected $headers = array();

0 commit comments

Comments
 (0)