Transfer::finalizeTransfer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 9
ccs 7
cts 7
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Yabacon\Paystack\Routes;
4
5
use Yabacon\Paystack\Contracts\RouteInterface;
6
7
class Transfer implements RouteInterface
8
{
9
10 3
    public static function root()
11
    {
12 3
        return '/transfer';
13
    }
14
15 2
    public static function initiate()
16
    {
17
        return [
18 2
            RouteInterface::METHOD_KEY => RouteInterface::POST_METHOD,
19 2
            RouteInterface::ENDPOINT_KEY => Transfer::root(),
20 2
            RouteInterface::PARAMS_KEY => [
21 2
                'source',
22 2
                'amount',
23 2
                'currency',
24 2
                'reason',
25 2
                'recipient',
26 2
            ],
27 2
        ];
28
    }
29
30 2
    public static function finalizeTransfer()
31
    {
32
        return [
33 2
            RouteInterface::METHOD_KEY => RouteInterface::POST_METHOD,
34 2
            RouteInterface::ENDPOINT_KEY => Transfer::root() . '/finalize_transfer',
35 2
            RouteInterface::PARAMS_KEY => [
36 2
                'reference',
37 2
                'transfer_code',
38 2
                'otp',
39 2
            ],
40 2
        ];
41
    }
42
43 2
    public static function resendOtp()
44
    {
45
        return [
46 2
            RouteInterface::METHOD_KEY => RouteInterface::POST_METHOD,
47 2
            RouteInterface::ENDPOINT_KEY => Transfer::root() . '/resend_otp',
48 2
            RouteInterface::PARAMS_KEY => [
49 2
                'transfer_code',
50 2
                'reason',
51 2
            ],
52 2
        ];
53
    }
54
55 2
    public static function disableOtp()
56
    {
57
        return [
58 2
            RouteInterface::METHOD_KEY => RouteInterface::POST_METHOD,
59 2
            RouteInterface::ENDPOINT_KEY => Transfer::root() . '/disable_otp',
60 2
        ];
61
    }
62
63 2
    public static function enableOtp()
64
    {
65
        return [
66 2
            RouteInterface::METHOD_KEY => RouteInterface::POST_METHOD,
67 2
            RouteInterface::ENDPOINT_KEY => Transfer::root() . '/enable_otp',
68 2
        ];
69
    }
70
71 2
    public static function disableOtpFinalize()
72
    {
73
        return [
74 2
            RouteInterface::METHOD_KEY => RouteInterface::POST_METHOD,
75 2
            RouteInterface::ENDPOINT_KEY => Transfer::root() . '/disable_otp_finalize',
76 2
            RouteInterface::PARAMS_KEY => ['otp'],
77 2
        ];
78
    }
79
80 2
    public static function fetch()
81
    {
82
        return [
83 2
            RouteInterface::METHOD_KEY => RouteInterface::GET_METHOD,
84 2
            RouteInterface::ENDPOINT_KEY => Transfer::root() . '/{id}',
85 2
            RouteInterface::ARGS_KEY => ['id'],
86 2
        ];
87
    }
88
89 2
    public static function getList()
90
    {
91
        return [
92 2
            RouteInterface::METHOD_KEY => RouteInterface::GET_METHOD,
93 2
            RouteInterface::ENDPOINT_KEY => Transfer::root(),
94 2
        ];
95
    }
96
}
97