Code Duplication    Length = 23-23 lines in 2 locations

src/SDK/Action/ApproveActions.php 1 location

@@ 8-30 (lines=23) @@
5
6
use MerchantSafeUnipay;
7
8
final class ApproveActions extends ActionAbstract implements ActionInterface
9
{
10
    static private $approveTransactionKeys = [
11
        'PGTRANID'
12
    ];
13
    static private $approveDealerKeys = [
14
        'DEALERCODE'
15
    ];
16
17
    public function approveTransaction($args)
18
    {
19
        $this->action = 'APPROVETRANSACTION';
20
        $args = MerchantSafeUnipay\filter(self::$approveTransactionKeys, $args);
21
        $this->queryParameters = array_merge($this->merchantParams, $args);
22
    }
23
24
    public function approveDealer($args)
25
    {
26
        $this->action = 'DEALERAPPROVE';
27
        $args = MerchantSafeUnipay\filter(self::$approveDealerKeys, $args);
28
        $this->queryParameters = array_merge($this->merchantParams, $args);
29
    }
30
}
31

src/SDK/Action/Merchant.php 1 location

@@ 8-30 (lines=23) @@
5
6
use MerchantSafeUnipay;
7
8
final class Merchant extends ActionAbstract implements ActionInterface
9
{
10
    static private $enableKeys = [
11
        'MERCHANTBUSINESSID'
12
    ];
13
    static private $disableKeys = [
14
        'MERCHANTBUSINESSID'
15
    ];
16
17
    public function enable($args)
18
    {
19
        $this->action = 'MERCHANTENABLE';
20
        $args = MerchantSafeUnipay\filter(self::$enableKeys, $args);
21
        $this->queryParameters = array_merge($this->merchantParams, $args);
22
    }
23
24
    public function disable($args)
25
    {
26
        $this->action = 'MERCHANTDISABLE';
27
        $args = MerchantSafeUnipay\filter(self::$disableKeys, $args);
28
        $this->queryParameters = array_merge($this->merchantParams, $args);
29
    }
30
}
31