diff --git a/src/Lob/Resource/Cards.php b/src/Lob/Resource/Cards.php index d33803b0..a4c8bed4 100644 --- a/src/Lob/Resource/Cards.php +++ b/src/Lob/Resource/Cards.php @@ -6,4 +6,14 @@ class Cards extends ResourceBase { + public function update($id, array $data, array $headers = null) + { + return $this->sendRequest( + 'POST', + 'cards/'.strval($id), + array(), + $data, + $headers + ); + } } diff --git a/tests/Lob/Tests/Resource/CardsTest.php b/tests/Lob/Tests/Resource/CardsTest.php index 23eb84e6..f49fa023 100644 --- a/tests/Lob/Tests/Resource/CardsTest.php +++ b/tests/Lob/Tests/Resource/CardsTest.php @@ -61,4 +61,16 @@ public function testAll() $this->assertTrue(is_array($cards)); } + public function testUpdate() + { + $updateParams = array( + 'description' => 'This is an updated description' + ); + $id = $this->lob->cards()->create($this->cardParams)['id']; + $updatedCard = $this->lob->cards()->update($id, $updateParams); + + $this->assertTrue(is_array($updatedCard)); + $this->assertTrue($updatedCard['description'] === 'This is an updated description'); + } + }