| Total Complexity | 5 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Counterparties |
||
| 6 | { |
||
| 7 | const ENDPOINT = 'counterparty'; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * @var Client |
||
| 11 | */ |
||
| 12 | private $client; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Counterparties constructor. |
||
| 16 | * @param Client $client |
||
| 17 | */ |
||
| 18 | public function __construct(Client $client) |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @see https://revolutdev.github.io/business-api/#get-counterparties |
||
| 25 | * |
||
| 26 | * @return mixed |
||
| 27 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
| 28 | */ |
||
| 29 | public function all() |
||
| 30 | { |
||
| 31 | return $this->client->get('counterparties'); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @see https://revolutdev.github.io/business-api/#get-counterparty |
||
| 36 | * |
||
| 37 | * @param string $id |
||
| 38 | * @return mixed |
||
| 39 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
| 40 | */ |
||
| 41 | public function get(string $id) |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @see https://revolutdev.github.io/business-api/#add-revolut-counterparty |
||
| 48 | * @see https://revolutdev.github.io/business-api/#add-non-revolut-counterparty |
||
| 49 | * |
||
| 50 | * @param array $json |
||
| 51 | * @return mixed |
||
| 52 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
| 53 | */ |
||
| 54 | public function create(array $json) |
||
| 55 | { |
||
| 56 | return $this->client->post(self::ENDPOINT, $json); |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @see https://revolutdev.github.io/business-api/#delete-counterparty |
||
| 61 | * |
||
| 62 | * @param string $id |
||
| 63 | * @return mixed |
||
| 64 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
| 65 | */ |
||
| 66 | public function delete($id) |
||
| 69 | } |
||
| 70 | } |
||
| 71 |