1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
namespace MerchantSafeUnipay\SDK\Action; |
5
|
|
|
|
6
|
|
|
use MerchantSafeUnipay; |
7
|
|
|
|
8
|
|
|
class PaymentSystem extends ActionAbstract implements ActionInterface |
9
|
|
|
{ |
10
|
|
View Code Duplication |
public function add($args) |
|
|
|
|
11
|
|
|
{ |
12
|
|
|
$this->action = 'PAYMENTSYSTEMADD'; |
13
|
|
|
$queryParamKeys = [ |
14
|
|
|
'PAYMENTSYSTEM', 'PAYMENTSYSTEMTYPE', 'STATUS', 'PAYMENTSYSTEMMODE', 'APIMERCHANTID', 'APIUSERNAME', |
15
|
|
|
'APIPASSWORD', 'GATE3DKEY', 'INTEGRATIONEXTRAFIELD00', 'INTEGRATIONEXTRAFIELD01', 'ISDEFAULT', |
16
|
|
|
'SUBMERCHANTCODE' |
17
|
|
|
]; |
18
|
|
|
$args = MerchantSafeUnipay\filter($queryParamKeys, $args); |
19
|
|
|
$this->queryParameters = $args; |
20
|
|
|
} |
21
|
|
|
|
22
|
|
View Code Duplication |
public function edit($args) |
|
|
|
|
23
|
|
|
{ |
24
|
|
|
$this->action = 'PAYMENTSYSTEMEDIT'; |
25
|
|
|
$queryParamKeys = [ |
26
|
|
|
'PAYMENTSYSTEMTYPE', 'PAYMENTSYSTEM', 'STATUS', 'PAYMENTSYSTEMMODE', 'APIMERCHANTID', 'APIUSERNAME', |
27
|
|
|
'APIPASSWORD', 'GATE3DKEY', 'INTEGRATIONEXTRAFIELD00', 'INTEGRATIONEXTRAFIELD01', 'ISDEFAULT', |
28
|
|
|
'SUBMERCHANTCODE' |
29
|
|
|
]; |
30
|
|
|
$args = MerchantSafeUnipay\filter($queryParamKeys, $args); |
31
|
|
|
$this->queryParameters = $args; |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function read($args) |
35
|
|
|
{ |
36
|
|
|
$this->action = 'PAYMENTSYSTEMREAD'; |
37
|
|
|
$queryParamKeys = [ |
38
|
|
|
'PAYMENTSYSTEMTYPE', 'PAYMENTSYSTEM' |
39
|
|
|
]; |
40
|
|
|
$args = MerchantSafeUnipay\filter($queryParamKeys, $args); |
41
|
|
|
$this->queryParameters = $args; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function enable($args) |
45
|
|
|
{ |
46
|
|
|
$this->action = 'PAYMENTSYSTEMENABLE'; |
47
|
|
|
$queryParamKeys = [ |
48
|
|
|
'PAYMENTSYSTEMTYPE', 'PAYMENTSYSTEM' |
49
|
|
|
]; |
50
|
|
|
$args = MerchantSafeUnipay\filter($queryParamKeys, $args); |
51
|
|
|
$this->queryParameters = $args; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function disable($args) |
55
|
|
|
{ |
56
|
|
|
$this->action = 'PAYMENTSYSTEMDISABLE'; |
57
|
|
|
$queryParamKeys = [ |
58
|
|
|
'PAYMENTSYSTEMTYPE', 'PAYMENTSYSTEM' |
59
|
|
|
]; |
60
|
|
|
$args = MerchantSafeUnipay\filter($queryParamKeys, $args); |
61
|
|
|
$this->queryParameters = $args; |
62
|
|
|
} |
63
|
|
|
} |
64
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.