Settlement::fetch()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Iamolayemi\Paystack\Endpoints;
4
5
class Settlement extends Endpoint
6
{
7
    protected const ENDPOINT = '/settlement';
8
9
    /**
10
     * List settlements made to your settlement accounts.
11
     *
12
     * @param  array<string, mixed>  $query
13
     *
14
     * @link https://paystack.com/docs/api/#settlement-list
15
     */
16
    public function list(array $query = []): self
17
    {
18
        $this->get($this->url(self::ENDPOINT), $query);
19
20
        return $this;
21
    }
22
23
    /**
24
     * Get details of a settlement on your integration.
25
     *
26
     * @param  array<string, mixed>  $query
27
     *
28
     * @link https://paystack.com/docs/api/#settlement-fetch
29
     */
30
    public function fetch(string $settlement_id, array $query = []): self
31
    {
32
        $this->get($this->url(self::ENDPOINT).'/'.$settlement_id, $query);
33
34
        return $this;
35
    }
36
}
37