Test Failed
Push — master ( 5a72fc...745ae1 )
by Mehmet
03:27
created

RecurringPlan::add()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 1
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace MerchantSafeUnipay\SDK\Action;
5
6
use MerchantSafeUnipay;
7
8
class RecurringPlan extends ActionAbstract implements ActionInterface
9
{
10
11
    public function add($args)
12
    {
13
        $this->action = 'RECURRINGPLANADD';
14
        $queryParamKeys = [
15
            'CARDTOKEN', 'CUSTOMER', 'CUSTOMERNAME', 'CUSTOMEREMAIL', 'CUSTOMERPHONE', 'TCKN', 'RECURRINGPLANCODE',
16
            'FIRSTAMOUNT', 'RECURRINGAMOUNT', 'RECURRENCECOUNT', 'FREQUENCY', 'OCCURRENCE', 'STARTDATE', 'CURRENCY',
17
            'PAYMENTSYSTEM', 'NOTIFICATIONCHANNELS'
18
        ];
19
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
20
        $this->queryParameters = $args;
21
    }
22
23
    public function edit($args)
24
    {
25
        $this->action = 'RECURRINGPLANEDIT';
26
        $queryParamKeys = [
27
            'RECURRINGPLANCODE', 'RECURRINGPLANSTATUS', 'RECURRINGAMOUNT', 'PAYMENTSYSTEM'
28
        ];
29
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
30
        $this->queryParameters = $args;
31
    }
32
33 View Code Duplication
    public function delete($args)
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...
34
    {
35
        $this->action = 'RECURRINGPLANDELETE';
36
        $queryParamKeys = [
37
            'RECURRINGPLANCODE'
38
        ];
39
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
40
        $this->queryParameters = $args;
41
    }
42
43 View Code Duplication
    public function resendLink($args)
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
        $this->action = 'RECURRINGPLANRESENDLINK';
46
        $queryParamKeys = [
47
            'RECURRINGPLANCODE', 'NOTIFICATIONCHANNELS'
48
        ];
49
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
50
        $this->queryParameters = $args;
51
    }
52
}
53