Chargeback::accept()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Digikraaft\Flutterwave;
4
5
use Digikraaft\Flutterwave\ApiOperations\Fetch;
6
7
class Chargeback extends ApiResource
8
{
9
    const OBJECT_NAME = 'chargebacks';
10
11
    use ApiOperations\All;
12
13
    /**
14
     * @param string $reference
15
     * @param array $params
16
     * @return array|object
17
     * @link https://developer.flutterwave.com/reference#validate-otp-1
18
     */
19
    public static function fetch(string $reference, array $params)
0 ignored issues
show
Unused Code introduced by
The parameter $reference is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

19
    public static function fetch(/** @scrutinizer ignore-unused */ string $reference, array $params)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
20
    {
21
        $url = static::buildQueryString("", $params);
22
23
        return static::staticRequest('GET', $url);
24
    }
25
26
    /**
27
     * @param string $chargeBackId
28
     * @return array|object
29
     * @link https://developer.flutterwave.com/reference#acceptdecline-a-chargeback
30
     */
31
    public static function accept(string $chargeBackId)
32
    {
33
        $params = [
34
            'action' => 'accept',
35
        ];
36
        $url = static::endPointUrl("{$chargeBackId}");
37
38
        return static::staticRequest('GET', $url, $params);
39
    }
40
41
    /**
42
     * @param string $chargeBackId
43
     * @return array|object
44
     * @link https://developer.flutterwave.com/reference#acceptdecline-a-chargeback
45
     */
46
    public static function decline(string $chargeBackId)
47
    {
48
        $params = [
49
            'action' => 'decline',
50
        ];
51
        $url = static::endPointUrl("{$chargeBackId}");
52
53
        return static::staticRequest('GET', $url, $params);
54
    }
55
}
56