Skip to content

Commit d666b69

Browse files
committed
Fix variable names and update README
1 parent a84efd6 commit d666b69

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,16 @@ $client->leads->scrollLeads();
172172

173173
See [here](https://github.com/intercom/intercom-php#scroll) for more info on using the scroll parameter
174174

175+
## Customers
176+
177+
```php
178+
/** Search for customers */
179+
$client->customers->search([
180+
"query" => ['field' => 'name', 'operator' => '=', 'value' => 'Alice'],
181+
"sort" => ["field" => "name", "order" => "ascending"],
182+
"pagination" => ["per_page" => 10]
183+
]);
184+
175185
## Visitors
176186

177187
Retrieve `user_id` of a visitor via [the JavaScript API](https://developers.intercom.com/docs/intercom-javascript#section-intercomgetvisitorid)

src/IntercomClient.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class IntercomClient
136136
public function __construct($appIdOrToken, $password = null, $extraRequestHeaders = [])
137137
{
138138
$this->users = new IntercomUsers($this);
139+
$this->customers = new IntercomCustomers($this);
139140
$this->events = new IntercomEvents($this);
140141
$this->companies = new IntercomCompanies($this);
141142
$this->messages = new IntercomMessages($this);

test/IntercomCustomersTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
class IntercomCustomersTest extends TestCase
99
{
10-
public function testUserSearch()
10+
public function testCustomerSearch()
1111
{
1212
$stub = $this->getMockBuilder('Intercom\IntercomClient')->disableOriginalConstructor()->getMock();
1313
$stub->method('post')->willReturn('foo');
1414

15-
$users = new IntercomCustomers($stub);
16-
$this->assertEquals('foo', $users->search({"query": {}}));
15+
$customers = new IntercomCustomers($stub);
16+
$this->assertEquals('foo', $customers->search(["query": []]));
1717
}
1818
}

0 commit comments

Comments
 (0)