1 | <?php declare(strict_types=1); |
||
24 | class Client |
||
25 | { |
||
26 | /** |
||
27 | * |
||
28 | */ |
||
29 | const MSU_API_VERSION = 2; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | private static $validActions = [ |
||
35 | |||
36 | 'session', |
||
37 | 'financialTransactions', |
||
38 | 'approveActions', |
||
39 | 'rejectActions', |
||
40 | 'dealer', |
||
41 | 'dealerPST', |
||
42 | 'dealerType', |
||
43 | 'eWallet', |
||
44 | 'merchant', |
||
45 | 'merchantUser', |
||
46 | 'merchantContent', |
||
47 | 'messageContent', |
||
48 | 'payByLinkPayment', |
||
49 | 'paymentPolicy', |
||
50 | 'paymentSystem', |
||
51 | 'paymentType', |
||
52 | 'recurringPayment', |
||
53 | 'recurringPlan', |
||
54 | 'recurringPlanCard', |
||
55 | 'query', |
||
56 | |||
57 | ]; |
||
58 | |||
59 | /** |
||
60 | * @var Environment |
||
61 | */ |
||
62 | private $environment; |
||
63 | /** |
||
64 | * @var GuzzleClient |
||
65 | */ |
||
66 | private $guzzleClient; |
||
67 | |||
68 | private $logger; |
||
69 | |||
70 | private static $headers = [ |
||
71 | 'User-Agent' => 'MerchantSafeUnipayPhpSDK/1.0', |
||
72 | 'Accept' => 'application/json' |
||
73 | ]; |
||
74 | |||
75 | private static $merchantParams = [ |
||
|
|||
76 | 'MERCHANT' => null, |
||
77 | 'MERCHANTUSER' => null, |
||
78 | 'MERCHANTPASSWORD' => null |
||
79 | ]; |
||
80 | |||
81 | /** |
||
82 | * @var array |
||
83 | */ |
||
84 | private static $possibleResponses = [ |
||
85 | '00' => 'Approved', |
||
86 | '01' => 'Waiting for Approval', |
||
87 | '98' => 'General Error', |
||
88 | '99' => 'Declined' |
||
89 | ]; |
||
90 | |||
91 | /** |
||
92 | * Client constructor. |
||
93 | * @param Environment $environment |
||
94 | * @param GuzzleClient $guzzleClient |
||
95 | * @param LoggerInterface $logger |
||
96 | */ |
||
97 | public function __construct(Environment $environment, GuzzleClient $guzzleClient, LoggerInterface $logger) |
||
103 | |||
104 | /** |
||
105 | * @param $name |
||
106 | * @param $arguments |
||
107 | * @throws BadMethodCallException |
||
108 | * @throws RequestException |
||
109 | * @throws InvalidArgumentException |
||
110 | * @return array |
||
111 | */ |
||
112 | public function __call(string $name, array $arguments) |
||
125 | |||
126 | /** |
||
127 | * @param string $name |
||
128 | * @param array $arguments |
||
129 | * @return ActionInterface |
||
130 | * @throws BadMethodCallException |
||
131 | * @throws InvalidArgumentException |
||
132 | */ |
||
133 | private function getAction(string $name, array $arguments) |
||
159 | |||
160 | /** |
||
161 | * @param string $actionName |
||
162 | * @param array $headers |
||
163 | * @param array $queryParams |
||
164 | * @throws RequestException |
||
165 | * @return ResponseInterface |
||
166 | */ |
||
167 | private function httpRequest(string $actionName, array $headers, array $queryParams) |
||
183 | } |
||
184 |
This check marks private properties in classes that are never used. Those properties can be removed.