Skip to content

Commit

Permalink
Merge pull request #193 from jbirchevans/add_get_credit_by_type
Browse files Browse the repository at this point in the history
Add get credit by type
  • Loading branch information
phily245 authored Jan 28, 2020
2 parents c0065e9 + ad89dbc commit a785579
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Account/CreditClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ public function getAll()
}, $body->data);
}

/**
* Get credits for an individual service
* @param $reference
* @return Credit
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function getByReference($reference)
{
$response = $this->request("GET", "v1/credits/" . $reference);
$body = $this->decodeJson($response->getBody()->getContents());

return new Credit($body->data);
}

/**
* Gets a paginated response of credits
*
Expand Down

0 comments on commit a785579

Please sign in to comment.