Skip to content

Commit

Permalink
[fix] Cards: added Card.update route
Browse files Browse the repository at this point in the history
  • Loading branch information
SishaarRao authored Oct 18, 2021
1 parent ead32c6 commit 615d260
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Lob/Resource/Cards.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
}
12 changes: 12 additions & 0 deletions tests/Lob/Tests/Resource/CardsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

}

0 comments on commit 615d260

Please sign in to comment.