Completed
Push — master ( 200759...6ce54b )
by Ibrahim
02:21
created

Transfer::initiate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
ccs 11
cts 11
cp 1
rs 9.4285
cc 1
eloc 10
nc 1
nop 0
crap 1
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 View Code Duplication
    public static function finalizeTransfer()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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 View Code Duplication
    public static function resendOtp()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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 View Code Duplication
    public static function disableOtpFinalize()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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 View Code Duplication
    public static function fetch()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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