1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
namespace MerchantSafeUnipay\SDK\Action; |
5
|
|
|
|
6
|
|
|
use MerchantSafeUnipay; |
7
|
|
|
|
8
|
|
|
final class PaymentType extends ActionAbstract implements ActionInterface |
9
|
|
|
{ |
10
|
|
|
static private $addKeys = [ |
11
|
|
|
'PAYMENTSYSTEM', 'NAME', 'STATUS', 'INSTALLMENTS', 'INTERESTRATE', 'DISCOUNTRATE','COMMISSIONRATE', |
12
|
|
|
'VALIDFROM', 'VALIDTO', 'APPLYFORDEBITCREDITCARD', 'APPLYFORCREDITCARD', 'APPLYFORBUSINESSCARD' |
13
|
|
|
]; |
14
|
|
|
static private $editKeys = [ |
15
|
|
|
'PAYMENTSYSTEM', 'NAME', 'STATUS', 'INSTALLMENTS', 'INTERESTRATE', 'DISCOUNTRATE','COMMISSIONRATE', |
16
|
|
|
'VALIDFROM', 'VALIDTO', 'APPLYFORDEBITCREDITCARD', 'APPLYFORCREDITCARD', 'APPLYFORBUSINESSCARD' |
17
|
|
|
]; |
18
|
|
|
static private $enableKeys = [ |
19
|
|
|
'PAYMENTSYSTEMTYPE', 'INSTALLMENTS' |
20
|
|
|
]; |
21
|
|
|
static private $disableKeys = [ |
22
|
|
|
'PAYMENTSYSTEMTYPE', 'INSTALLMENTS' |
23
|
|
|
]; |
24
|
|
|
|
25
|
|
|
public function add($args) |
26
|
|
|
{ |
27
|
|
|
$this->action = 'PAYMENTTYPEADD'; |
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 = 'PAYMENTTYPEEDIT'; |
35
|
|
|
$args = MerchantSafeUnipay\filter(self::$editKeys, $args); |
36
|
|
|
$this->queryParameters = array_merge($this->merchantParams, $args); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function enable($args) |
40
|
|
|
{ |
41
|
|
|
$this->action = 'PAYMENTTYPEENABLE'; |
42
|
|
|
$args = MerchantSafeUnipay\filter(self::$enableKeys, $args); |
43
|
|
|
$this->queryParameters = array_merge($this->merchantParams, $args); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function disable($args) |
47
|
|
|
{ |
48
|
|
|
$this->action = 'PAYMENTTYPEDISABLE'; |
49
|
|
|
$args = MerchantSafeUnipay\filter(self::$disableKeys, $args); |
50
|
|
|
$this->queryParameters = array_merge($this->merchantParams, $args); |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|