Completed
Push — master ( 64e776...8a3d14 )
by Ibrahim
02:49
created

Transfer::initiate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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