RecurringPlan   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 6 1
A edit() 0 6 1
A delete() 0 6 1
A resendLink() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
namespace MerchantSafeUnipay\SDK\Action;
5
6
use MerchantSafeUnipay;
7
8
final class RecurringPlan extends ActionAbstract implements ActionInterface
9
{
10
    static private $addKeys = [
11
        'CARDTOKEN', 'CUSTOMER', 'CUSTOMERNAME', 'CUSTOMEREMAIL', 'CUSTOMERPHONE', 'TCKN', 'RECURRINGPLANCODE',
12
        'FIRSTAMOUNT', 'RECURRINGAMOUNT', 'RECURRENCECOUNT', 'FREQUENCY', 'OCCURRENCE', 'STARTDATE', 'CURRENCY',
13
        'PAYMENTSYSTEM', 'NOTIFICATIONCHANNELS'
14
    ];
15
    static private $editKeys = [
16
        'RECURRINGPLANCODE', 'RECURRINGPLANSTATUS', 'RECURRINGAMOUNT', 'PAYMENTSYSTEM'
17
    ];
18
    static private $deleteKeys = [
19
        'RECURRINGPLANCODE'
20
    ];
21
    static private $resendLinkKeys = [
22
        'RECURRINGPLANCODE', 'NOTIFICATIONCHANNELS'
23
    ];
24
25
    public function add($args)
26
    {
27
        $this->action = 'RECURRINGPLANADD';
28
        $args = MerchantSafeUnipay\filter(self::$addKeys, $args);
29
        $this->queryParameters = array_merge($this->merchantParams, $args);
30
    }
31
32
    public function edit($args)
33
    {
34
        $this->action = 'RECURRINGPLANEDIT';
35
        $args = MerchantSafeUnipay\filter(self::$editKeys, $args);
36
        $this->queryParameters = array_merge($this->merchantParams, $args);
37
    }
38
39
    public function delete($args)
40
    {
41
        $this->action = 'RECURRINGPLANDELETE';
42
        $args = MerchantSafeUnipay\filter(self::$deleteKeys, $args);
43
        $this->queryParameters = array_merge($this->merchantParams, $args);
44
    }
45
46
    public function resendLink($args)
47
    {
48
        $this->action = 'RECURRINGPLANRESENDLINK';
49
        $args = MerchantSafeUnipay\filter(self::$resendLinkKeys, $args);
50
        $this->queryParameters = array_merge($this->merchantParams, $args);
51
    }
52
}
53