Skip to content

Commit 9f05f1c

Browse files
Adding in country_codes param to all needed institution endpoints.
1 parent 2e29bb3 commit 9f05f1c

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/Resources/Institutions.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ class Institutions extends AbstractResource
88
* Get a specific Insitution.
99
*
1010
* @param string $institution_id
11+
* @param array<string> $country_codes
1112
* @param array<string,string> $options
1213
* @return object
1314
*/
14-
public function get(string $institution_id, array $options = []): object
15+
public function get(string $institution_id, array $country_codes, array $options = []): object
1516
{
1617
$params = [
1718
"institution_id" => $institution_id,
19+
"country_codes" => $country_codes,
1820
"options" => (object) $options
1921
];
2022

@@ -30,14 +32,16 @@ public function get(string $institution_id, array $options = []): object
3032
*
3133
* @param integer $count
3234
* @param integer $offset
35+
* @param array<string> $country_codes
3336
* @param array<string,string> $options
3437
* @return object
3538
*/
36-
public function list(int $count, int $offset, array $options = []): object
39+
public function list(int $count, int $offset, array $country_codes, array $options = []): object
3740
{
3841
$params = [
3942
"count" => $count,
4043
"offset" => $offset,
44+
"country_codes" => $country_codes,
4145
"options" => (object) $options
4246
];
4347

tests/InstitutionsTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
*/
1010
class InstitutionsTest extends TestCase
1111
{
12-
public function test_get_institutions(): void
12+
public function test_list_institutions(): void
1313
{
14-
$response = $this->getPlaidClient()->institutions->list(100, 200);
14+
$response = $this->getPlaidClient()->institutions->list(100, 200, ["US"]);
1515

1616
$this->assertEquals("POST", $response->method);
1717
$this->assertEquals("2020-09-14", $response->version);
@@ -21,12 +21,13 @@ public function test_get_institutions(): void
2121
$this->assertEquals("secret", $response->params->secret);
2222
$this->assertEquals(100, $response->params->count);
2323
$this->assertEquals(200, $response->params->offset);
24+
$this->assertEquals(["US"], $response->params->country_codes);
2425
$this->assertEquals((object) [], $response->params->options);
2526
}
2627

2728
public function test_get_institution(): void
2829
{
29-
$response = $this->getPlaidClient()->institutions->get("ins_12345");
30+
$response = $this->getPlaidClient()->institutions->get("ins_12345", ["US"]);
3031

3132
$this->assertEquals("POST", $response->method);
3233
$this->assertEquals("2020-09-14", $response->version);
@@ -35,6 +36,7 @@ public function test_get_institution(): void
3536
$this->assertEquals("client_id", $response->params->client_id);
3637
$this->assertEquals("secret", $response->params->secret);
3738
$this->assertEquals("ins_12345", $response->params->institution_id);
39+
$this->assertEquals(["US"], $response->params->country_codes);
3840
$this->assertEquals((object) [], $response->params->options);
3941
}
4042

tests/TokensTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @covers TomorrowIdeas\Plaid\Resources\AbstractResource
1010
* @covers TomorrowIdeas\Plaid\Resources\tokens
1111
* @covers TomorrowIdeas\Plaid\Entities\AccountFilters
12+
* @covers TomorrowIdeas\Plaid\Entities\User
1213
*/
1314
class TokensTest extends TestCase
1415
{

0 commit comments

Comments
 (0)