Bank   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 5
eloc 16
c 3
b 0
f 1
dl 0
loc 77
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A resolveBvnPremium() 0 5 1
A bvnMatch() 0 6 1
A resolveAccountNumber() 0 6 1
A resolveBvn() 0 6 1
A resolveCardBin() 0 5 1
1
<?php
2
3
namespace Digikraaft\Paystack;
4
5
class Bank extends ApiResource
6
{
7
    const OBJECT_NAME = 'bank';
8
9
    use ApiOperations\All;
10
11
    /**
12
     * @param string $bvn
13
     *
14
     * @link https://paystack.com/docs/api/#verification-resolve-bvn
15
     *
16
     * @return array|object
17
     */
18
    public static function resolveBvn(string $bvn)
19
    {
20
        $url = "resolve_bvn/{$bvn}";
21
        $url = static::endPointUrl($url);
22
23
        return static::staticRequest('GET', $url);
24
    }
25
26
    /**
27
     * @param string $bvn
28
     * @return array|object
29
     * @throws Exceptions\InvalidArgumentException
30
     * @throws Exceptions\IsNullException
31
     * @link https://paystack.com/docs/api/#verification-resolve-bvn-premium
32
     */
33
    public static function resolveBvnPremium(string $bvn)
34
    {
35
        $url = "identity/bvn/resolve/{$bvn}";
36
37
        return static::staticRequest('GET', $url);
38
    }
39
40
    /**
41
     * @param array $params
42
     *
43
     * @link https://paystack.com/docs/api/#verification-match-bvn
44
     *
45
     * @return array|object
46
     */
47
    public static function bvnMatch($params)
48
    {
49
        self::validateParams($params);
50
        $url = urlencode('bvn/match');
51
52
        return static::staticRequest('POST', $url, $params);
53
    }
54
55
    /**
56
     * @param array $params
57
     *
58
     * @link https://paystack.com/docs/api/#verification-resolve-account
59
     *
60
     * @return array|object
61
     */
62
    public static function resolveAccountNumber($params)
63
    {
64
        self::validateParams($params, true);
65
        $url = static::buildQueryString('resolve', $params);
66
67
        return static::staticRequest('GET', $url);
68
    }
69
70
    /**
71
     * @param string $bin
72
     *
73
     * @link https://paystack.com/docs/api/#verification-resolve-card
74
     *
75
     * @return array|object
76
     */
77
    public static function resolveCardBin(string $bin)
78
    {
79
        $url = "decision/bin/{$bin}";
80
81
        return static::staticRequest('GET', $url);
82
    }
83
}
84