Code Duplication    Length = 32-34 lines in 3 locations

src/SDK/Action/EWallet.php 1 location

@@ 8-41 (lines=34) @@
5
6
use MerchantSafeUnipay;
7
8
class EWallet extends ActionAbstract implements ActionInterface
9
{
10
    public function addCard($args)
11
    {
12
        $this->action = 'EWALLETADDCARD';
13
        $queryParamKeys = [
14
            'CUSTOMER', 'NAMEONCARD', 'CARDPAN', 'CARDEXPIRY', 'CARDSAVENAME', 'CUSTOMERNAME', 'CUSTOMEREMAIL',
15
            'CUSTOMERPHONE'
16
        ];
17
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
18
        $this->queryParameters = $args;
19
    }
20
21
    public function editCard($args)
22
    {
23
        $this->action = 'EWALLETEDITCARD';
24
        $queryParamKeys = [
25
            'CARDTOKEN', 'CARDEXPIRY', 'NAMEONCARD', 'CARDSAVENAME'
26
        ];
27
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
28
        $this->queryParameters = $args;
29
    }
30
31
32
    public function deleteCard($args)
33
    {
34
        $this->action = 'EWALLETDELETECARD';
35
        $queryParamKeys = [
36
            'CARDTOKEN'
37
        ];
38
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
39
        $this->queryParameters = $args;
40
    }
41
}
42

src/SDK/Action/MerchantUser.php 1 location

@@ 8-39 (lines=32) @@
5
6
use MerchantSafeUnipay;
7
8
class MerchantUser extends ActionAbstract implements ActionInterface
9
{
10
    public function add($args)
11
    {
12
        $this->action = 'MERCHANTUSERADD';
13
        $queryParamKeys = [
14
            'USERNAME', 'MERCHANTUSEREMAIL', 'ROLE', 'TIMEZONE'
15
        ];
16
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
17
        $this->queryParameters = $args;
18
    }
19
20
    public function edit($args)
21
    {
22
        $this->action = 'MERCHANTUSEREDIT';
23
        $queryParamKeys = [
24
            'USERNAME', 'MERCHANTUSEREMAIL', 'ROLE', 'ISLOCKED', 'MERCHANTUSERPASSWORD', 'CONFIRMPASSWORD'
25
        ];
26
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
27
        $this->queryParameters = $args;
28
    }
29
30
    public function reinvite($args)
31
    {
32
        $this->action = 'MERCHANTUSERREINVITE';
33
        $queryParamKeys = [
34
            'MERCHANTUSEREMAIL'
35
        ];
36
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
37
        $this->queryParameters = $args;
38
    }
39
}
40

src/SDK/Action/PayByLinkPayment.php 1 location

@@ 8-41 (lines=34) @@
5
6
use MerchantSafeUnipay;
7
8
class PayByLinkPayment extends ActionAbstract implements ActionInterface
9
{
10
11
    public function add($args)
12
    {
13
        $this->action = 'PAYBYLINKPAYMENT';
14
        $queryParamKeys = [
15
            'SESSIONEXPIRY', 'MERCHANTPAYMENTID', 'AMOUNT', 'CURRENCY', 'CUSTOMER', 'RETURNURL', 'CUSTOMEREMAIL',
16
            'CUSTOMERNAME', 'CUSTOMERPHONE', 'TCKN', 'LANGUAGE', 'ORDERITEMS'
17
        ];
18
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
19
        $this->queryParameters = $args;
20
    }
21
22
    public function cancel($args)
23
    {
24
        $this->action = 'PAYBYLINKPAYMENTCANCEL';
25
        $queryParamKeys = [
26
            'PAYBYLINKTOKEN'
27
        ];
28
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
29
        $this->queryParameters = $args;
30
    }
31
32
    public function resend($args)
33
    {
34
        $this->action = 'PAYBYLINKPAYMENTRESEND';
35
        $queryParamKeys = [
36
            'PAYBYLINKTOKEN'
37
        ];
38
        $args = MerchantSafeUnipay\filter($queryParamKeys, $args);
39
        $this->queryParameters = $args;
40
    }
41
}
42