Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
36 | 1 | public function getKey(): string |
|
37 | { |
||
38 | 1 | if ($cache = $this->getCache()->get($this->getCacheKey())) { |
|
39 | 1 | return $cache; |
|
40 | } |
||
41 | |||
42 | 1 | $response = $this->requestArray('sandboxnew/pay/getsignkey'); |
|
43 | |||
44 | 1 | if ('SUCCESS' === $response['return_code']) { |
|
45 | 1 | $this->getCache()->set($this->getCacheKey(), $key = $response['sandbox_signkey'], 24 * 3600); |
|
46 | |||
47 | 1 | return $key; |
|
48 | } |
||
49 | |||
50 | 1 | throw new SandboxException($response['retmsg'] ?? $response['return_msg']); |
|
51 | } |
||
61 |