Session::sessionToken()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 6
rs 10
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
final class Session extends ActionAbstract implements ActionInterface
9
{
10
    static private $sessionTokenKeys = [
11
        'CUSTOMER', 'SESSIONTYPE', 'RETURNURL', 'MERCHANTPAYMENTID', 'AMOUNT', 'CURRENCY', 'CUSTOMEREMAIL',
12
        'CUSTOMERNAME', 'CUSTOMERPHONE', 'CUSTOMERIP', 'CUSTOMERUSERAGENT', 'SESSIONEXPIRY', 'LANGUAGE',
13
        'CAMPAIGNCODE', 'ORDERITEMS', 'TMXSESSIONQUERYINPUT', 'EXTRA', 'MAXINSTALLMENTCOUNT', 'SPLITPAYMENTTYPE'
14
    ];
15
    static private $sessionExtendKeys = [
16
        'TOKEN', 'SESSIONEXPIRY'
17
    ];
18
19
    public function sessionToken($args)
20
    {
21
        $this->action = 'SESSIONTOKEN';
22
        $args = MerchantSafeUnipay\filter(self::$sessionTokenKeys, $args);
23
        $this->queryParameters = array_merge($this->merchantParams, $args);
24
    }
25
26
    public function sessionExtend($args)
27
    {
28
        $this->action = 'SESSIONEXTEND';
29
        $args = MerchantSafeUnipay\filter(self::$sessionExtendKeys, $args);
30
        $this->queryParameters = array_merge($this->merchantParams, $args);
31
    }
32
}
33